/* 顶部导航栏的样式 */
.navbar {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-width: 1px;
    padding: 5px 20px;
    color: white;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    transition: all 0.3s ease;
    min-height: 70px;
}

/* 下滑时将导航栏固定并且修改链接颜色为黑色 */
.navbar.fixed {
    position: fixed;
    border-style: solid;
    border-color: white white #dddddd white;
    border-width: 1px;
    background-color: white;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar.fixed ul li a {
    color: black;
}

.navbar.fixed .logo img {
    visibility: visible;

}

/* 平滑滚动锚点 */
html {
    scroll-behavior: smooth;
}

/* 防止iOS Safari缩放 */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px;
    }
}

/* 网站Logo或标题 */
#logo {
    visibility: hidden;

}

.navbar.fixed #logo {
    visibility: visible;
    animation: fadeIn 0.3s ease forwards;
}

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

/* 导航链接的样式 */
.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.navbar ul li {
    margin: 0 40px 0 0;
    position: relative;
}

.navbar ul li a {
    text-decoration: none;
    color: white;
    font-size: 20px;
    display: block;
    padding: 8px 0;
    transition: all 0.2s ease;
    position: relative;
}

.navbar ul li a:hover {
    color: #ddd;
    transform: translateY(-1px);
}

.navbar ul li a[aria-current="page"] {
    color: #fff;
    font-weight: 600;
}

.navbar ul li a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
}

/* 固定状态下的当前页面标识 */
.navbar.fixed ul li a[aria-current="page"] {
    color: #333;
}

.navbar.fixed ul li a[aria-current="page"]::after {
    background-color: #333;
}

/* 移动端汉堡菜单 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.navbar.fixed .menu-toggle span {
    background-color: black;
}

/* 汉堡菜单动画增强 */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 桌面端保持原有样式 - 隐藏语言切换按钮 */
@media (min-width: 769px) {
    .language-toggle {
        display: none;
    }
}

/* 移动端语言切换按钮样式 */
@media (max-width: 768px) {
    .mobile-lang-toggle {
        display: block;
        order: 2;
        margin: 0 8px;
    }
    
    .mobile-lang-toggle .lang-link {
        font-size: 15px;
        padding: 6px 10px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: white;
        text-decoration: none;
        font-weight: 500;

        border-radius: 4px;

    }
    
    .mobile-lang-toggle .lang-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .navbar.fixed .mobile-lang-toggle .lang-link {
        color: #333;
        border-color: rgba(0, 0, 0, 0.3);
    }
    
    .navbar.fixed .mobile-lang-toggle .lang-link:hover {
        background-color: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.5);
    }
    
    /* 确保导航栏元素正确排序 */
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        order: 1;
    }
    
    .menu-toggle {
        order: 3;
    }
    
    nav ul {
        order: 4;
    }
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 5px 15px;
        min-height: 60px;
    }
    
    .navbar ul {
        position: fixed;
        top: 60px;
        left: -100%;
        flex-direction: column;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(30, 30, 30, 0.95) 100%);
        width: 100%;
        text-align: center;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 25px 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        margin: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .navbar ul.active {
        left: 0;
    }
    
    .navbar ul li {
        margin: 20px 0;
        opacity: 0;
        transform: translateY(-10px);
        animation: slideIn 0.3s ease forwards;
    }
    
    .navbar ul li:nth-child(1) { animation-delay: 0.1s; }
    .navbar ul li:nth-child(2) { animation-delay: 0.2s; }
    .navbar ul li:nth-child(3) { animation-delay: 0.3s; }
    .navbar ul li:nth-child(4) { animation-delay: 0.4s; }
    
    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .navbar ul li a {
        font-size: 20px;
        padding: 15px 0;
        display: block;
        color: #fff;
        text-decoration: none;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .navbar ul li a:hover {
        color: #ddd;
        transform: translateX(5px);
    }
    
    .navbar ul li a[aria-current="page"] {
        color: #4CAF50;
        font-weight: bold;
    }
    
    .navbar ul li a[aria-current="page"]::after {
        content: '';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 2px;
        background-color: #4CAF50;
        border-radius: 1px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    /* 固定状态下导航栏样式 */
    .navbar.fixed {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar.fixed ul {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 245, 0.95) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    .navbar.fixed ul li a {
        color: #333;
    }
    
    .navbar.fixed ul li a:hover {
        color: #000;
    }
    
    .navbar.fixed ul li a[aria-current="page"] {
        color: #2E7D32;
    }
    
    .navbar.fixed ul li a[aria-current="page"]::after {
        background-color: #2E7D32;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 5px 10px;
        min-height: 55px;
    }
    
    .navbar ul {
        top: 55px;
        padding: 20px 0;
        height: calc(100vh - 55px);
    }
    
    .navbar ul li {
        margin: 15px 0;
    }
    
    .navbar ul li a {
        font-size: 18px;
        padding: 12px 0;
    }
    
    .menu-toggle {
        padding: 6px;
    }
    
    .menu-toggle span {
        width: 22px;
        height: 2.5px;
    }
    
    /* 小屏设备上增大触摸区域 */
    .menu-toggle {
        min-width: 48px;
        min-height: 48px;
    }
}