/* 顶部导航栏 */
.header {
    background-color: #2e91f6;
    padding: 10px 0 12px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 商城Logo */
.logo a {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
}

/* 导航菜单 */
.nav-links {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 导航项 */
.nav-links li {
    /* margin-left: 20px; */
    position: relative; /* 用于定位下拉菜单 */
}

/* 导航链接样式 */
.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-size: 16px;
    /* padding: 8px 8px; */
    transition: background-color 0.3s ease;
}

/* 悬停效果 */
.nav-links>li>a:hover {
    /* background-color: #555; */
    color: #35f0f7;
    border-radius: 5px;
}

/* 下拉菜单样式 */
.dropdown-menu {
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    /* background-color: #444; */
    display: none; /* 默认不显示 */
    width: 100px;
    border-radius: 5px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    padding-top: 13px;
}

/* 下拉菜单项 */
.dropdown-menu li {
    margin: 0;
    background-color: #ffffff;
}

.dropdown-menu a {
    text-decoration: none;
    color: #6c6c6c;
    padding: 10px 15px;
    display: block;
}

/* 下拉菜单项悬停效果 */
.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

/* 显示下拉菜单 */
.dropdown:hover .dropdown-menu {
    display: block;
}


.right_nav{
    display: flex;
    gap: 40px;
}


.user_logo{
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 5px !important;
}

/* 语言切换器样式 */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 60px;
    justify-content: space-between;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #35f0f7;
}

.language-btn i {
    font-size: 10px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.language-dropdown.active .language-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-dropdown.active .language-btn i {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    /* min-width: 120px; */
    z-index: 1001;
    display: none;
    list-style: none;
    /* padding: 4px 0; */
    margin: 0;
    overflow: hidden;
}

.language-dropdown.active .language-menu {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-option {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.language-option:hover {
    background-color: #f8f9fa;
    color: #2e91f6;
}
.language-menu a{
    color: #000;
}

/* 汉堡菜单按钮 - 默认隐藏（桌面端） */
.hamburger-btn {
    display: none !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* 防止菜单打开时body滚动 - 仅在移动端生效 */
@media screen and (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }
}

/* 移动端菜单 - 默认完全隐藏（桌面端） */
.mobile-menu {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: 60px;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-item a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.mobile-nav-item a:hover {
    background-color: #f5f5f5;
    color: #2e91f6;
}

.mobile-nav-item .user_logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.mobile-nav-item .user_name {
    display: inline-flex;
    align-items: center;
}

/* 移动端语言切换器 */
.language-switcher-mobile {
    padding: 15px 20px;
}

.language-dropdown-mobile {
    position: relative;
}

.language-btn-mobile {
    width: 100%;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #333;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    transition: all 0.3s ease;
}

.language-btn-mobile:hover {
    background: #e8e8e8;
}

.language-btn-mobile i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.language-dropdown-mobile.active .language-btn-mobile i {
    transform: rotate(180deg);
}

.language-menu-mobile {
    display: none;
    margin-top: 8px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.language-dropdown-mobile.active .language-menu-mobile {
    display: block;
}

.language-option-mobile {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.language-option-mobile:last-child {
    border-bottom: none;
}

.language-option-mobile:hover {
    background-color: #f8f9fa;
    color: #2e91f6;
}

/* 手机端适配 */
@media screen and (max-width: 768px) {
    /* 显示汉堡菜单按钮 */
    .hamburger-btn {
        display: flex !important;
    }

    /* 隐藏桌面端导航 */
    .right_nav {
        display: none !important;
    }

    /* 显示移动端菜单容器（但内容仍通过active类控制） */
    .mobile-menu {
        display: block !important;
        pointer-events: auto;
    }

    .navbar {
        padding: 0 15px;
    }

    .logo a {
        font-size: 16px;
    }
}

