/* ========== 植物园导航栏样式 - 参考图片设计 ========== */
:root {
    --primary-green: #38a660;
    --light-green: #6c9f3d;
    --dark-green: #1e7e34;
    --accent-pink: #e91e63;
    --nav-gradient: linear-gradient(135deg, #4CAF50, #45a049);
    --header-height: 70px;
    --tabs-height: 60px; 
}
/* ========== 导航栏基础样式 - 始终保持半透明磨砂效果 ========== */
.navbar {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 1rem 0;
    max-height: 80px;
    z-index: 1000;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}
 
/* 滚动时的导航栏样式 - 变成白色背景 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.6rem 0;
    min-height: 60px;
}

/* ========== 品牌Logo样式 - 白色字体 ========== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    text-decoration: none;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 滚动时Logo变成黑色 */
.navbar.scrolled .navbar-brand {
    color: rgba(0, 0, 0, 0.85) !important;
    font-size: 1.3rem;
    text-shadow: none;
}

.navbar-brand i {
    margin-right: 0.6rem;
    font-size: 1.2em;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Logo悬停时的3D变换效果 */
.navbar-brand:hover {
    text-decoration: none;
    color: inherit !important;
    transform: translateY(-2px);
}

.navbar-brand:hover i {
    transform: rotate(15deg) scale(1.15) translateY(-1px);
    color: #4CAF50;
    filter: drop-shadow(0 4px 8px rgba(76, 175, 80, 0.4));
}

.navbar.scrolled .navbar-brand:hover i {
    color: var(--light-green);
    filter: drop-shadow(0 2px 6px rgba(108, 159, 61, 0.3));
}

/* ========== 导航菜单样式 - 白色字体磨砂效果 ========== */
.navbar-nav {
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 540;
    font-size: 18px;
    font-family: 'SourceHanSansSC-regular';
    padding: 0.8rem 1.5rem !important;
    white-space: nowrap;
    border-radius: 8px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: transparent; /* 子元素无背景 */
}

/* 滚动时菜单项变成黑色 */
.navbar.scrolled .nav-link {
    color: rgba(0, 0, 0, 0.8) !important;
    text-shadow: none;
}

/* 光滑动画效果 - 扫光 */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.6s ease;
    z-index: -1;
}

.nav-link:hover::before {
    left: 100%;
}

/* 3D变换悬停效果 - 轻微上移营造浮起感 */
.nav-link:hover {
    color: rgba(255, 255, 255, 1) !important;
    background: transparent; /* 悬停时也保持透明 */
    transform: translateY(-3px);
   
    text-decoration: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 滚动时悬停效果 - 绿色主题 */
.navbar.scrolled .nav-link:hover {
    color: var(--primary-green) !important;
    background: transparent;
   
    text-shadow: none;
}

/* 激活状态 - 和悬停效果一样 */
.nav-link.active {
    color: rgba(255, 255, 255, 1) !important;
    background: transparent;
    transform: translateY(-3px);
    
    text-decoration: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.navbar.scrolled .nav-link.active {
    color: var(--primary-green) !important;
    background: transparent;
    text-shadow: none;
    transform: translateY(-3px);
}

/* ========== 移动端汉堡菜单 ========== */
.navbar-toggler {
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    background: transparent; /* 汉堡菜单无背景 */
    transition: all 0.3s ease;
    position: relative;
}

.navbar.scrolled .navbar-toggler {
    background: transparent; /* 滚动时也保持透明 */
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

.navbar-toggler:hover {
    background: transparent; /* 悬停时保持透明 */
    transform: translateY(-2px);
}

.navbar.scrolled .navbar-toggler:hover {
    background: transparent; /* 悬停时保持透明 */
    transform: translateY(-2px);
}

/* 自定义汉堡菜单图标 */
.navbar-toggler-icon {
    background-image: none;
    width: 26px;
    height: 20px;
    position: relative;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled .navbar-toggler-icon {
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1.5px;
    transition: all 0.3s ease;
    box-shadow: inherit;
}

.navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler-icon::after {
    bottom: -8px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* 折叠菜单 */
.navbar-collapse {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    margin-top: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease;
}

@media (max-width: 991px) {
    .nav-link {
        color: rgba(255, 255, 255, 0.95) !important;
        padding: 1rem 1.5rem !important;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 1) !important;
        transform: translateX(10px);
    }
    
    .nav-link::before {
        display: none;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 导航栏下划线装饰 ========== */
.navbar {
    overflow: visible;
}

.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8), 
        rgba(255, 255, 255, 0.6), 
        rgba(255, 255, 255, 0.8));
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}

.navbar.scrolled .navbar-nav .nav-item::after {
    /* background: linear-gradient(90deg, 
        var(--primary-green), 
        var(--light-green), 
        var(--primary-green)); */
    background: var(--primary-green);
 
}

.navbar-nav .nav-item:hover::after,
.navbar-nav .nav-item.active::after {
    width: 80%;
}

@media (max-width: 991px) {
    .navbar-nav .nav-item::after {
        display: none;
    }
    
    .desktop-nav .navbar-brand {
        margin-right: auto;
    }
}

/* ========== 搜索框样式 ========== */
.nav-right {
    display: flex;
    align-items: center;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 0.4rem 1rem;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 250px;
    padding: 0.5rem 0;
}

.navbar.scrolled .search-container {
    background: #efefef;
    border-color:#cecece;

}

.search-input {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.95);
    outline: none;
    font-size: 14px;
    padding-left: 20px;
    flex: 1;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.navbar.scrolled .search-input {
    color: #cecece;
}

.navbar.scrolled .search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.navbar.scrolled .search-btn {
    color: rgba(0, 0, 0, 0.6);
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.navbar.scrolled .search-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

.search-container:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled .search-container:hover {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.search-input:focus {
    color: rgba(255, 255, 255, 1);
}

@media (max-width: 991px) {
    .nav-right,
    .mobile-right {
        margin-left: auto;
    }
    
    .mobile-right .search-container {
        min-width: 200px;
    }
    
    .mobile-right .search-input {
        font-size: 13px;
    }
    
    .mobile-right .search-input::placeholder {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .nav-link {
        font-size: 16px;
        padding: 0.7rem 1.2rem !important;
    }
}

@media (max-width: 768px) {
    .mobile-right .search-container {
        min-width: 150px;
        padding: 0.3rem 0.8rem;
        border-radius: 20px;
    }
}

/* ========== 桌面端和移动端布局 ========== */
.desktop-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-right {
    display: flex;
    align-items: center;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0rem;
}

.mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-left {
    display: flex;
    align-items: center;
}

.mobile-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.mobile-right .search-container {
    min-width: 180px;
}

.mobile-right .search-input {
    font-size: 14px;
}

.mobile-right .search-btn {
    font-size: 13px;
    width: 28px;
    height: 28px;
}

/* ========== 移动端菜单按钮 ========== */
.mobile-menu-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .mobile-menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* 汉堡菜单图标 */
.menu-icon {
    width: 24px;
    height: 3px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s ease;
}

.navbar.scrolled .menu-icon {
    background: rgba(0, 0, 0, 0.8);
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: inherit;
    border-radius: 2px;
    transition: all 0.3s ease;
    left: 0;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    bottom: -8px;
}

.mobile-menu-btn.active .menu-icon {
    background: transparent;
}

.mobile-menu-btn.active .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-btn.active .menu-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* ========== 移动端导航弹窗 ========== */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-popup {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-nav-popup.show {
    left: 0;
}

.mobile-nav-content {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.mobile-nav-popup.show .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 70px;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.9);
}

.mobile-nav-body {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-list a {
    display: block;
    padding: 1rem 1.5rem;
    color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-list a:hover,
.mobile-nav-list a.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-green);
    padding-left: 2rem;
}

.mobile-nav-list a i {
    margin-right: 0.75rem;
    width: 20px;
}

@media (max-width: 576px) {
    .mobile-right .search-container {
        min-width: 130px;
    }
    
    .mobile-nav-content {
        width: 100vw;
    }
    
    .mobile-nav-header {
        padding: 1rem;
    }
    
    .mobile-nav-list a {
        font-size: 15px;
    }
}

@media (max-width: 375px) {
    .mobile-right .search-container {
        min-width: 120px;
    }
    
    .mobile-right .search-input {
        font-size: 12px;
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
    
    .menu-icon {
        width: 20px;
    }
    
    .menu-icon::before,
    .menu-icon::after {
        width: 20px;
    }
    
    .mobile-nav-content {
        width: 70vw;
    }
    
    .mobile-nav-header {
        padding: 0.75rem;
    }
    
    .mobile-nav-list a {
        font-size: 14px;
        padding: 0.75rem 1rem;
    }
}

/* ========== 大屏幕优化 ========== */
@media (min-width: 992px) {
    .nav-link {
        font-size: 17px;
        padding: 0.75rem 5px !important;
    }
    
    .navbar-nav .nav-item {
        margin: 0 0.2rem;
    }
    
    .navbar-nav .nav-item::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 50%;
        width: 0;
        height: 3px;
        background: linear-gradient(90deg, 
            rgba(255, 255, 255, 0.8), 
            rgba(255, 255, 255, 0.6), 
            rgba(255, 255, 255, 0.8));
        border-radius: 2px;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        transform: translateX(-50%);

    }

    .navbar.scrolled .navbar-nav .nav-item::after {
        background: linear-gradient(90deg, 
            var(--primary-green), 
            var(--light-green), 
            var(--primary-green)) !important;
        /* box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4); */
    }

    .navbar-nav .nav-item:hover::after,
    .navbar-nav .nav-item.active::after {
        width: 90%;
    }
    
    /* .desktop-nav .nav-link:hover,
    .desktop-nav .nav-link.active {
        color: rgba(255, 255, 255, 1) !important;
        background: transparent;
        transform: translateY(-2px);
        /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3); */
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    } */

    /* .navbar.scrolled .desktop-nav .nav-link:hover,
    .navbar.scrolled .desktop-nav .nav-link.active {
        color: var(--primary-green) !important;
        background: transparent;
       
        text-shadow: none;
    } */
}

/* ========== 响应式导航栏高度调整 ========== */
@media (min-width: 992px) {
    .navbar {
        padding: 1.2rem 0;
    }
    
    .navbar.scrolled {
        padding: 0.8rem 0;
    }
}

@media (max-width: 991px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .navbar.scrolled {
        padding: 0.6rem 0;
    }
}
