/* 引入自定义字体 */
@font-face {
    font-family: 'VivoSans';
    src: url('../fonts/vivoSansSCVF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'MuseoSans';
    src: url('../fonts/MuseoSans_700_Italic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

/* Navbar组件样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 为html和body设置最小宽度，防止页面被压缩到900px以下 */
html {
    min-width: 900px;
}

body {
    margin: 0;
    padding: 0;
    min-width: 900px;
    overflow-x: auto; /* 当内容超出时显示水平滚动条 */
}

/* 为主要容器添加最小宽度限制 */
.nav-container,
.container,
.main-content,
.content-wrapper {
    min-width: 900px;
}

/* 移动设备上移除最小宽度限制 */
@media (max-width: 768px) {
    html,
    body,
    .nav-container,
    .container,
    .main-content,
    .content-wrapper {
        min-width: auto;
    }
    
    body {
        overflow-x: auto;
    }
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* 移除 transition 动画 */
    opacity: 0; /* 初始隐藏，防止语言切换闪烁 */
    transition: opacity 0.3s ease;
}

.navbar.visible {
    opacity: 1;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

/* Logo 容器样式 */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    /* 移除 transition 动画 */
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    gap: 0.75rem;
    min-height: 3rem;
}

.logo-container:hover {
    /* 移除 transform 动画 */
}

/* Logo 图片样式 */
.logo-image {
    height: 2.5rem;
    width: auto;
    max-width: 2.5rem;
    object-fit: contain;
    /* 移除 transition 动画 */
    flex-shrink: 0;
    display: block;
}

.logo1-image {
    height: 3.5rem;
    width: auto;
    /* max-width: 2.5rem; */
    object-fit: contain;
    /* 移除 transition 动画 */
    flex-shrink: 0;
    display: block;
}

.logo-container:hover .logo-image {
    /* 移除 transform 动画 */
}

/* Logo 文字样式 */
.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    font-style: italic;
    color: #000000;
    margin: 0;
    font-family: 'MuseoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
    letter-spacing: -0.025em;
    /* 移除 transition 动画 */
    flex-shrink: 0;
    /* line-height: 1.2; */
    white-space: nowrap;
}

.logo-container:hover .logo-text {
    color: #000000;
}

/* 兼容旧的 logo 类 */
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    /* 移除 transition 动画 */
    font-family: 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
}

.logo:hover {
    color: #5a6fd8;
}

.nav-menu {
    display: flex;
    list-style: none;
    /* justify-content: space-between; */
    /* align-content: space-around; */
    /* 不使用 gap，改为居中并由子项外边距提供间距 */
    justify-content: center;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* 顶部导航的间距由 li 的水平外边距提供（等效于 gap: 3rem） */
.nav-menu > li {
    margin: 0 0.8rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1.0rem;
    /* 移除 transition 动画 */
    position: relative;
    font-family: 'VivoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: #667eea;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    /* 移除 transition 动画 */
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a.active {
    color: #667eea;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 300px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    /* 移除 transition 动画 */
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    /* 移除 transition 动画 */
    border-radius: 0;
    font-family: 'VivoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
}

.dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu .lang-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #333;
    text-align: left;
    cursor: pointer;
    font-family: 'VivoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
}

.dropdown-menu .lang-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.lang-switch .dropdown-toggle {
    border: none;
    background: transparent;
    padding: 0.5rem 0;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    font-family: 'VivoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
}

.lang-switch .dropdown-toggle:hover {
    color: #667eea;
}

.lang-switch .dropdown-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
}

.lang-switch .dropdown-toggle:hover::after {
    width: 100%;
}

.lang-switch .dropdown-menu {
    left: auto;
    right: 0;
    min-width: 180px;
    padding: 0.25rem 0;
}

.dropdown-toggle {
    cursor: pointer;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

/* 语言切换按钮（右上角） */
.lang-switch {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 1002;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 0.25rem 0.4rem;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    font-family: 'VivoSans', 'SimHei', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', sans-serif;
}

.lang-btn:hover {
    color: #667eea;
}

.lang-btn.active {
    color: #667eea;
    font-weight: 600;
}

.lang-sep {
    color: #999;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    /* 移除 transition 动画 */
    border-radius: 2px;
}

/* 移动端菜单按钮动画 */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    /* 移动端 Logo 优化 */
    .logo-container {
        padding: 0.125rem 0.25rem;
        gap: 0.5rem;
        min-height: 2.5rem;
    }
    
    .logo-image {
        height: 2rem;
        max-width: 2rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
        margin: 0;
    }
    
    /* 改为下拉面板：不覆盖整屏，避免遮挡页面 */
    .nav-menu {
        position: absolute;
        top: 100%;
        /* left: 0; */
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0.5rem 0;
        /* 默认隐藏，点击按钮后展示 */
        display: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 0.25rem 0;
        width: 100%;
        text-align: left;
    }

    .nav-menu a {
        font-size: 1.1rem;
        display: block;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }

    .lang-switch {
        right: 3.5rem; /* 为汉堡按钮留出空间 */
        font-size: 1rem;
    }

    /* 移动端下拉菜单样式 */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(102, 126, 234, 0.05);
        border-radius: 0;
        margin-top: 0.25rem;
        padding: 0;
        display: none; /* 默认隐藏 */
    }

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

    .dropdown-menu a {
        padding: 0.5rem 2rem;
        font-size: 1rem;
    }
}

/* 滚动时的样式变化 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.15);
}

/* 活动状态的菜单项 */
.nav-menu a.active {
    color: #667eea;
}

.nav-menu a.active::after {
    width: 100%;
}
