/*  {
    scroll-behavior: smooth;
} */


header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    background: 0 0;
    -webkit-transition: all .4s ease;
    transition: all .4s ease;
}

/* navbar元素样式 */
header .logo {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.5em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

header ul {
    display: flex;
    justify-content: center;
    align-items: center;
}

header ul li {
    list-style: none;
    margin-left: 20px;
}

header ul li a {
    text-decoration: none;
    padding: 6px 2px;
    color: transparent;
    border-radius: 20px;
}

/* 悬浮显示按钮颜色 */
/* header ul li a:hover,
header ul li a.active {
    background: #fff;
    color: #2b1055;
} */
/* 悬浮显示非选中模糊 */
header ul:hover li {
    opacity: 0.5;
    filter: blur(2px);
}

header ul li:hover {
    opacity: 1;
    filter: blur(0px);
    text-decoration: underline;
}

/* 悬浮显示选中背景颜色 */
header.scrolled,
header:hover {
    background-color: #fff;
    color: black;
}

header.scrolled .logo,
header.scrolled ul li a,
header:hover .logo,
header:hover ul li a {
    color: black;
}

/* 添加按钮样式 */
header .toggle-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1em;
}



/*
 屏幕自适应
*/
@media (max-width: 600px) {
    header {
        padding: 15px 20px;
        /* 减小内边距以便适应更小的屏幕 */
    }

    header .logo {
        font-size: 0.5em;
    }

    /*  */
    /* 添加动画类 */
    .show-menu {
        max-height: 500px;
        /* 或一个足够大的高度，以容纳所有菜单项 */
        opacity: 1;
        visibility: visible;
    }

    header .toggle-btn {
        display: block;
    }

    header .toggle-btn:hover {
        display: block;
        color: #000000;
    }

    header ul {
        flex-direction: column;
        position: absolute;
        top: 100%;
        /* 将菜单放置在header下方 */
        left: 0;
        width: 100%;
        background-color: #fff;
        /* 背景色可根据需求调整 */
        overflow: hidden;
        /* 隐藏超出部分 */
        max-height: 0;
        /* 初始高度为0 */
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        /* 过渡动画 */
    }

    header ul li {
        margin-left: 0;
        height: 40px;
    }

}