/* ==================================== */
/* 头部组件样式 (header.css) - 顶部导航与轮播图融合版 */
/* ==================================== */

* {
    margin: 0;
    padding: 0;
    
}



.site-header {
    position: relative;
    font-family: Arial, sans-serif;
    color: #333;
    width: 100%;
    height: 676px; /* 桌面端高度 */
    overflow: hidden; /* 添加防止溢出 */
}

/* 轮播图背景 - 完全重新定义 */
.site-header__carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    font-size: 30px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 5;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-caption {
    position: absolute;
    top: 50%;
    left: 10%;
    text-align: center;
    color: #fff;
    padding: 0 20px;
    z-index: 10;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 1s ease-out, opacity 1s ease-out;
}

.carousel-slide.active .carousel-caption {
    transform: translateY(0);
    opacity: 1;
}

.carousel-caption .small-text {
    font-size: 1.2em;
    font-weight: normal;
    margin-bottom: 10px;
    line-height: 1.5;
}

.carousel-caption .big-text {
    font-size: 3em;
    font-weight: bold;
    line-height: 1.2;
}

/* 顶部条 - 完全重写 */
.site-header__top {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    z-index: 100;
    /* 移除或设置背景为透明 */
    background: transparent !important;
    height: 80px;
    box-sizing: border-box;
    color: #fff;
    transition: all 0.3s ease;
}

/* 滚动时的顶部条样式 */
.site-header__top.scrolled {
    position: fixed !important;
    background: rgba(0, 0, 0, 0.95) !important;
    height: 70px;
    padding: 10px 40px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 汉堡菜单 */
.site-header__hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    z-index: 101;
}

.site-header__hamburger span {
    height: 2px;
    width: 25px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-header__hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.site-header__hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 语言选择 */
.site-header__language-wrapper {
    position: relative;
    margin-left: auto;
    z-index: 101;
}

/* 语言选择按钮 - 修复大小 */
.site-header__language-btn {
    /* 使用黑白地球图标图片 */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>') no-repeat center;
    background-size: 24px 24px;
    text-indent: -9999px; /* 隐藏原始文本 */
    width: 44px;
    height: 44px;
    border: none;
    cursor: pointer;
}

    .site-header__language-btn:hover {
        color: #f0f0f0 !important; /* 悬停时轻微变亮 */
        opacity: 1;
    }

.site-header__language-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(0,0,0,0.7) !important; /* 菜单背景调整为深色半透明 */
    list-style: none;
    padding: 5px 0;
    margin: 5px 0 0 0;
    border: 1px solid rgba(255,255,255,0.2);
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 4px;
    min-width: 120px;
}

.site-header__language-menu.show {
    display: block;
}

.site-header__language-menu li a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.site-header__language-menu li a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* LOGO - 重新定位 */
.site-header__logo {
    position: absolute;
    left: 50%;
    top: 50px; /* 调整为主菜单栏的中间位置 */
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    z-index: 101;
}

.site-header__logo img {
    max-height: 50px;
    transition: all 0.3s ease;
}

/* 滚动时logo变小 */
.site-header__top.scrolled .site-header__logo img {
    max-height: 40px;
}

/* 主菜单 (桌面端) */
.site-header__main-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background: transparent;
    width: 100%;
    position: absolute;
    top: 80px; /* 在顶部条下方 */
    left: 0;
    z-index: 10;
    padding: 15px 0;
}

.site-header__main-nav a {
    padding: 12px 35px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-header__main-nav a:hover,
.site-header__main-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 3px;
}

/* 手机端样式 */
@media (max-width: 768px) {
    .site-header {
        height: 400px; /* 增加移动端高度 */
    }

    .site-header__top {
        position: absolute !important;
        padding: 12px 20px;
        height: 70px;
        /* 移除或设置背景为透明 */
        background: transparent !important;
    }

    .site-header__top.scrolled {
        position: fixed !important;
        background: rgba(0, 0, 0, 0.95) !important;
    }

    .site-header__hamburger {
        display: flex;
        order: 1;
    }

    .site-header__logo {
        position: static;
        order: 2;
        margin: 0 auto;
        transform: none;
    }

    .site-header__logo img {
        max-height: 50px;
    }

    .site-header__top.scrolled .site-header__logo img {
        max-height: 30px;
    }

    .site-header__language-wrapper {
        position: static;
        order: 3;
    }



    /* 主菜单移动端 */
    .site-header__main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 99;
    }

    .site-header__main-nav.show {
        transform: translateX(0);
    }

        .site-header__main-nav a {
            width: 80%;
            text-align: center;
            padding: 15px 30px; /* 增大点击区域 */
            margin: 5px 0;
            font-size: 18px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

    .carousel-caption {
        position: absolute;
        top: 30% !important; /* 垂直居中 */
        left: 50% !important; /* 水平居中 */
        transform: translate(-50%, 100px) !important; /* 初始位置在下方，准备向上移动 */
        text-align: center; /* 文字居中 */
        width: 90%; /* 适当宽度 */
        padding: 0 20px;
        z-index: 10;
        opacity: 0;
        transition: transform 1s ease-out, opacity 1s ease-out;
    }

    /* 修改轮播图背景定位 */
    /* 或者使用更具体的定位 */
    .site-header__carousel .carousel-slide {
        background-position: 80% center !important; /* 从右边20%处开始 */
        background-size: cover !important;
    }

    .carousel-slide.active .carousel-caption {
        transform: translate(-50%, -50%) !important; /* 激活时移动到正中间 */
        opacity: 1;
    }

    .carousel-caption .small-text {
        font-size: 1em;
    }

    .carousel-caption .big-text {
        font-size: 1.8em;
    }

    .carousel-prev,
    .carousel-next {
        top: 50%;
        font-size: 24px;
        padding: 8px 12px;
    }
}

