/*
 * 导航栏样式
 * 版本: 2.0.0
 */

.navbar {
    background-color: var(--navbar-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--navbar-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 992px) {
    .navbar .container {
        justify-content: space-between; /* 大屏幕下保持两端对齐 */
    }

    .navbar-logo {
        display: none !important; /* 大屏幕下隐藏Logo */
    }

    .navbar-actions {
        display: flex !important; /* 大屏幕下显示右侧工具栏 */
    }

    .nav-menu {
        flex-grow: 1; /* 让导航菜单占据中间空间 */
        justify-content: center; /* 导航菜单居中 */
    }
}

/* 左侧Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    font-size: 1.7em;
    font-weight: 600;
    color: var(--dark-text);
    text-decoration: none;
}

.navbar-logo:hover {
    color: var(--primary-color);
}

.logo-icon {
    margin-right: 8px;
    color: var(--primary-color);
    font-size: 1.1em;
}

/* 左侧网站名称 (标题样式) */
.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.7em; /* 标题字体大小 */
    font-weight: 600; /* 标题字体粗细 */
    color: var(--dark-text); /* 标题颜色 */
    text-decoration: none; /* 移除下划线 */
    transition: color 0.3s ease; /* 添加颜色过渡效果 */
}

.navbar-brand:hover {
    color: var(--primary-color); /* 悬停颜色 */
}

/* 中间导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-grow: 1;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    font-size: 1.05em;
    color: var(--light-text);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.nav-menu a.active,
.nav-menu a:hover {
    color: var(--primary-color);
}

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

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

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-toggle i {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}



.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--navbar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 8px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
}

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

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 8px;
}

.dropdown-menu a i {
    margin-right: 8px;
    font-size: 1.1em;
    width: 16px;
    text-align: center;
}

.dropdown-menu a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

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

/* 右侧工具栏 */
.navbar-actions {
    display: flex;
    align-items: center;
}

/* 搜索框 */
.search-form {
    display: flex;
    align-items: center;
    background-color: var(--search-input-bg);
    border-radius: 20px;
    padding: 2px 5px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.search-input {
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 0.95em;
    color: var(--search-input-text);
    outline: none;
    width: 120px;
    transition: width 0.3s ease, color 0.3s ease;
}

.search-input::placeholder {
    color: #8899b3;
    opacity: 1;
}

.search-button {
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.search-button i {
    font-size: 1.2em;
}

.search-button:hover {
    color: var(--primary-hover);
}

/* 搜索切换按钮（小屏幕上显示） */
.search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(66, 133, 244, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-toggle i {
    font-size: 1.2em;
    color: var(--dark-text);
    transition: color 0.3s ease;
}

.search-toggle:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-toggle:hover i {
    color: white;
}

.search-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 深色模式切换按钮 */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(251, 188, 5, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle:hover i {
    color: white;
}

.dark-mode-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle i {
    font-size: 1.2em;
    color: var(--dark-text);
    transition: color 0.3s ease;
}

/* 语言切换按钮 */
.lang-switch,
.language-toggle,
#languageToggle {
    display: none !important; /* 隐藏语言切换按钮 */
}

/* 原始语言切换按钮样式（已隐藏） */
.lang-switch-original {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 18px;
    background-color: rgba(52, 168, 83, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    gap: 6px;
    color: var(--dark-text);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0 12px;
}

.lang-switch-original:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.lang-switch-original:hover i,
.lang-switch-original:hover span {
    color: white;
}

.lang-switch-original:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lang-switch-original i {
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.lang-switch-original span {
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* 移动菜单按钮 */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(234, 67, 53, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle i {
    font-size: 1.4em;
    color: var(--dark-text);
    transition: color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:hover i {
    color: white;
}

.mobile-menu-toggle:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .search-input {
        width: 100px;
    }

    .nav-menu li {
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }

    .nav-menu {
        flex-basis: 100%;
        flex-direction: column;
        align-items: center;
        padding: 15px 0;
        display: none;
        order: 5;
    }

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

    .nav-menu li {
        margin: 10px 0;
    }

    /* 移动端下拉菜单样式 */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(255, 255, 255, 0.05);
        border: none;
        border-radius: 8px;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        margin: 8px 0;
        padding: 8px;
        display: none;
    }

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

    .dropdown-menu a {
        margin: 4px 0;
        padding: 8px 12px;
        border-radius: 6px;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .dropdown-toggle i {
        transition: transform 0.3s ease;
    }

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

    .navbar-actions {
        margin-left: auto;
        order: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        padding-right: 10px;
    }

    .search-toggle {
        display: flex;
    }

    .search-form {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: var(--navbar-bg);
        padding: 10px 15px;
        border-radius: 0 0 10px 10px;
        box-shadow: var(--card-shadow);
        z-index: 100;
        display: none;
        margin-top: 5px;
        border-top: 1px solid var(--border-color);
    }

    .search-form.active {
        display: flex;
    }

    .search-input {
        width: 100%;
    }

    .lang-switch-original {
        border-radius: 50%;
        padding: 0;
        width: 36px;
        min-width: 36px;
    }

    .lang-switch-original span {
        display: none;
    }
}

@media (max-width: 480px) {
    .navbar-logo {
        font-size: 1.4em;
    }

    /* 确保按钮间距一致 */
    .navbar-actions {
        gap: 12px;
    }

    /* 统一按钮样式 - 精致现代设计 */
    .dark-mode-toggle,
    .search-toggle,
    .mobile-menu-toggle,
    .lang-switch-original {
        width: 38px;
        height: 38px;
        margin: 0;
        background-color: var(--search-input-bg);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
        overflow: hidden;
    }

    /* 按钮悬停效果 */
    .dark-mode-toggle:hover,
    .search-toggle:hover,
    .mobile-menu-toggle:hover,
    .lang-switch-original:hover {
        background-color: var(--primary-color);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    /* 按钮激活效果 */
    .dark-mode-toggle:active,
    .search-toggle:active,
    .mobile-menu-toggle:active,
    .lang-switch-original:active {
        transform: translateY(1px);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    /* 按钮图标样式 */
    .dark-mode-toggle i,
    .search-toggle i,
    .mobile-menu-toggle i,
    .lang-switch-original i {
        font-size: 1.3em;
        color: var(--dark-text);
        transition: color 0.3s ease;
    }

    /* 按钮悬停时图标颜色 */
    .dark-mode-toggle:hover i,
    .search-toggle:hover i,
    .mobile-menu-toggle:hover i,
    .lang-switch-original:hover i {
        color: white;
    }

    /* 为每个按钮设置不同的微妙背景色 */
    .search-toggle {
        background-color: rgba(66, 133, 244, 0.1);
    }

    .dark-mode-toggle {
        background-color: rgba(251, 188, 5, 0.1);
    }

    .lang-switch-original {
        background-color: rgba(52, 168, 83, 0.1);
    }

    .mobile-menu-toggle {
        background-color: rgba(234, 67, 53, 0.1);
    }
}
