.navbar {
    z-index: 100;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    padding: 1px 20px;
    box-shadow: 0px 5px 5px rgba(202, 202, 202, 0.5);
    position: fixed;
    width: 100%;
    left: 0px;
    top: 0;
    text-transform: uppercase; /* 使所有文本变为大写 */
}

.navbar {
    height: 7vh;
}

.logo {
    color: #9b9b9b;
    font-size: 22px;
    font-weight: 600;
    padding: 15px 15px;
}

.navbar ul {
    list-style-type: none;
    display: flex;
    margin: auto;
    left: 0;
}

.navbar ul li {
    padding: 15px 15px;
}

.navbar ul li a {
    padding: 5px 5px;
    color: #000000;
    text-decoration: none;
    font-size: 18px;
    width: 100%;
    display: inline-block; /* 或者 block，取决于布局需求 */
    max-width: 100px; /* 设置一个最大宽度 */
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden; /* 隐藏超出部分 */
    text-overflow: ellipsis; /* 超出部分显示省略号 */
}

.navbar ul li a:hover {
    background-color: rgba(202, 202, 202, 0.5);
    box-shadow: 3px 3px 5px rgba(202, 202, 202, 0.5);
    border-radius: 5px;
    font-size: 22px;
    width: 100%;
    max-width: 500px; /* 设置一个最大宽度 */
}

.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.burger div {
    background-color: #000000;
    box-shadow: 3px 3px 5px rgba(202, 202, 202, 0.5);
    margin: 3px 0;
    width: 25px;
    height: 2px;
}

.box {
    width: 100%;
    height: 7vh;
}


/* Responsive */
@media (max-width: 1200px) {
    .navbar ul {
        z-index: 99999;
        position: fixed;
        top: 0;
        left: -50vw; /* 使用 vh 单位 */
        height: 100%;
        min-width: 130px;
        width: 20vw; /* 使用 vh 单位 */
        flex-direction: column;
        align-items: start;
        padding: 20px;
        background-color: #fafafa;
        box-shadow: 3px 3px 5px rgba(202, 202, 202, 0.5);
        transform: translateX(0);
        opacity: 0; /* 初始透明度设置为 0 */
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* 添加 opacity 到 transition */
    }

    .navbar .logo {
        color: #9b9b9b;
        font-size: 17px;
        font-weight: 600;
        padding: 15px 15px;
    }

    .navbar ul.active {
        transform: translateX(50vw); /* 使用与 width 相同的值 */
        opacity: 1; /* 当 active 类被添加时改变透明度 */
    }

    .burger {
        position: fixed;
        display: flex;
        right: 10px;
    }

    .navbar ul li {
        padding: 20px 0;
    }

    .navbar ul li a {
        font-size: 12px;
        max-width: 100%;
    }
    
    .navbar ul li a:hover {
        background-color: rgba(202, 202, 202, 0.5);
        border-radius: 5px;
        font-size: 12px;
    }
}