/* 导航栏基本样式 */
:root {
    --primary-color: #2b4b6f; /* 保持现代蓝色 */
    --secondary-color: #2b4b6f;
    --molecule-blue: #60A5FA;
    --molecule-green: #34D399;
    --molecule-red: #F87171;
    --molecule-yellow: #FBBF24;
}

/* 添加始终显示滚动条的样式 */
body {
    overflow-y: scroll;
}

/* Logo Design */
.logo-design-2 {
    display: flex;
    align-items: center;
    position: relative;
    font-size: 6rem;  /* Match about page */
}

.map-text {
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    margin-left: 2px;  /* 减少左边距 */
    transition: all 0.3s ease;
}

/* i-structure styles */
.i-structure {
    position: relative;
    height: 48px;
    width: 18px;
    margin-right: 0;  /* 减少右边距 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glowing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(white, var(--molecule-blue));
    margin-bottom: 3px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite alternate;
}

.dna-stem {
    position: relative;
    height: 35px;
    width: 10px;
    overflow: hidden;
}

.stem-helix {
    position: absolute;
    height: 100%;
    width: 4px;
    border-radius: 2px;
    animation: twist 6s linear infinite;
}

.helix-left {
    left: 0;
    background-color: var(--molecule-blue);
}

.helix-right {
    right: 0;
    background-color: var(--molecule-green);
    animation-delay: 1.5s;
}

.stem-base {
    position: absolute;
    height: 2px;
    width: 10px;
    left: 0;
    border-radius: 1px;
}

.base-1 {
    top: 20%;
    background-color: var(--molecule-red);
    animation: glow 2s infinite alternate;
    animation-delay: 0.2s;
}

.base-2 {
    top: 40%;
    background-color: var(--molecule-yellow);
    animation: glow 2s infinite alternate;
    animation-delay: 0.7s;
}

.base-3 {
    top: 60%;
    background-color: var(--molecule-red);
    animation: glow 2s infinite alternate;
    animation-delay: 1.2s;
}

.base-4 {
    top: 80%;
    background-color: var(--molecule-yellow);
    animation: glow 2s infinite alternate;
    animation-delay: 1.7s;
}

.brand-text {
    display: flex;
    align-items: baseline;
    margin-left: 0;
}

/* Navigation */
.navbar {
    background: var(--primary-color);
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0;
    height: 85px;
    display: flex;
    align-items: center;
}

.navbar > .container {
    display: flex;
    align-items: center;
    margin: 0 auto;   /* 保持容器居中 */
    height: 100%;
    padding-left: 0;
    max-width: 1400px;  /* 设置最大宽度 */
    width: 100%;  /* 确保容器占满可用空间 */
    justify-content: center;  /* 容器内容居中 */
}

.navbar-header {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 0;
    position: absolute;  /* 将logo固定在左侧 */
    left: 100px;  /* 增加左边距，使logo向右移动 */
}

.navbar-brand {
    padding: 0;
    margin-left: 0;
    height: auto;
    line-height: 1;
    display: flex;
    align-items: center;
    position: relative;
    left: 0 !important;
    margin-right: 10px !important;
    transform: translateX(0);
}

.nav-logo {
    height: 90px;
    width: auto;
    padding: 5px 0;
    margin-top: 8px;
    margin-left: 0;  /* 确保logo无左边距 */
}

.navbar-collapse {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    margin-left: 250px;  /* 增加左边距，为logo预留更多空间 */
}

.navbar-nav {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: center;  /* 导航项居中 */
    width: 100%;  /* 使用全宽 */
}

.navbar-nav > li {
    margin: 0 8px;  /* 减小项目之间的边距 */
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-nav > li > a {
    color: rgba(255,255,255,0.95) !important;
    font-size: 3rem;
    font-weight: 500;
    padding: 0 12px;
    transition: all 0.3s ease;
    line-height: 1;
    height: auto;
    display: flex;
    align-items: center;
    border-radius: 6px;
    margin: 0 5px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}


.navbar-nav > li.dropdown > a {
    flex-direction: row;
    justify-content: center;
    padding-right: 20px;  /* 调整为更紧凑的右侧填充，为箭头留出空间 */
    white-space: nowrap;
    width: auto;
    min-width: 120px;  /* 减小最小宽度 */
    text-align: center;
    line-height: 1 !important;
    padding-top: 5px;
    padding-bottom: 5px;
}


.navbar-nav > li.dropdown > a .caret {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid;  /* 增大三角箭头的大小 */
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
    vertical-align: middle;
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
}

.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus {
    color: white !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.navbar-nav > li.active > a {
    color: #2B4B6F !important;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 600;
}

.navbar-nav > li.active > a:hover {
    background: rgba(255,255,255,1);
    transform: translateY(-2px);
}

/* 导航栏下拉菜单悬停效果 */
.navbar-nav > li.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* 确保下拉菜单位置正确 */
.navbar-nav > li.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 20px;  /* 调整位置 */
    margin-top: 0;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: rgb(235, 240, 247);
    padding: 8px 0;
    min-width: 160px;  /* 调整最小宽度 */
}

/* 删除小三角形 */
/* .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 30px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgb(235, 240, 247);
} */

.dropdown-menu > li > a {
    padding: 12px 20px;
    color: var(--primary-color);
    font-size: 1.8rem;  /* 增大下拉菜单字体大小 */
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 6px;
}

.dropdown-menu > li > a:hover {
    background: rgb(200, 215, 235);
    color: var(--primary-color);
}

.dropdown-header {
    font-size: 1.6rem !important;  /* 增大下拉菜单标题字体大小 */
    padding: 12px 20px !important;
    font-weight: 600 !important;
    color: #666 !important;
}

/* 汉堡菜单按钮样式 */
.navbar-toggle {
    border: none;
    margin-top: 15px;
    background-color: transparent;
    position: relative;
    margin-right: 15px;
    padding: 10px;
    border-radius: 4px;
    display: none; /* 默认隐藏 */
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.navbar-toggle .icon-bar {
    background-color: white;
    display: block;
    width: 30px;
    height: 3px;
    border-radius: 1px;
    margin: 6px 0;
    transition: all 0.3s ease;
}

/* 当菜单打开时，汉堡按钮变成X */
.navbar-toggle.active .icon-bar:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.navbar-toggle.active .icon-bar:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .icon-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Animations */
@keyframes twist {
    0% {
        transform: scaleX(0.8) translateX(0) translateY(0);
    }
    25% {
        transform: scaleX(1.2) translateX(1px) translateY(1px);
    }
    50% {
        transform: scaleX(0.8) translateX(0) translateY(2px);
    }
    75% {
        transform: scaleX(1.2) translateX(-1px) translateY(1px);
    }
    100% {
        transform: scaleX(0.8) translateX(0) translateY(0);
    }
}

@keyframes glow {
    0% {
        opacity: 0.6;
        filter: brightness(0.8);
        width: 8px;
    }
    100% {
        opacity: 1;
        filter: brightness(1.3);
        width: 12px;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 更新媒体查询以保持居中对齐 */
@media (min-width: 1200px) {
    .navbar > .container {
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 15px;
    }
}

/* 添加中等屏幕宽度的媒体查询，取消logo绝对定位 */
@media (max-width: 1650px) {
    .navbar-header {
        position: relative;
        left: 0;
        padding-left: 15px;
    }
    
    .navbar-collapse {
        margin-left: 0;
        justify-content: flex-end;
        padding-right: 15px;
    }
    
    .navbar > .container {
        justify-content: space-between;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .navbar > .container {
        width: 100%;
        max-width: 1170px;
        margin: 0 auto;
        padding: 0 15px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .navbar > .container {
        width: 100%;
        max-width: 970px;
        margin: 0 auto;
        padding: 0 15px;
    }
}

/* 移动端和小屏幕设备的样式 */
@media (max-width: 767px) {
    /* 显示汉堡菜单按钮 */
    .navbar-toggle {
        display: block;
        position: absolute;
        right: 15px;
        top: 15px;
    }
    
    /* 调整导航栏布局 */
    .navbar > .container {
        padding: 0;
        justify-content: flex-start;
    }
    
    .navbar-header {
        position: relative;
        left: 15px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding-right: 15px;
    }
    
    /* Logo样式调整 */
    .nav-logo {
        height: 70px;
        margin-top: 5px;
    }
    
    /* 导航菜单折叠样式 */
    .navbar-collapse {
        position: fixed;
        top: 85px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        background-color: var(--primary-color);
        transition: max-height 0.5s ease;
        margin-left: 0;
        z-index: 1000;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    
    /* 菜单展开时的样式 */
    .navbar-collapse.show {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        height: auto;
        padding: 10px 0;
    }
    
    .navbar-nav > li {
        width: 100%;
        margin: 0;
        height: auto;
    }
    
    .navbar-nav > li > a {
        width: 100%;
        padding: 15px 20px;
        font-size: 2rem;
        justify-content: flex-start;
        margin: 0;
        border-radius: 0;
    }
    
    .navbar-nav > li > a:hover {
        transform: none;
        background-color: rgba(255,255,255,0.05);
    }
    
    .navbar-nav > li > a:after {
        display: none;
    }
    
    /* 下拉菜单调整 */
    .navbar-nav > li.dropdown > a {
        padding-right: 50px;
        min-width: 100%;
        justify-content: flex-start; /* 覆盖默认的居中对齐 */
        text-align: left; /* 覆盖默认的居中对齐 */
    }
    
    .navbar-nav > li.dropdown > a .caret {
        right: 20px;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        background-color: rgba(235, 240, 247, 0.9);
        margin: 0;
        padding: 0;
        left: 0;
        border-radius: 0;
        display: none;
    }
    
    /* 点击时展开下拉菜单 */
    .navbar-nav > li.dropdown.open .dropdown-menu {
        display: block;
    }
    
    /* 禁用悬停展开下拉菜单 */
    .navbar-nav > li.dropdown:hover .dropdown-menu {
        display: none;
    }
    
    /* 手机端展开下拉菜单的类 */
    .navbar-nav > li.dropdown.open:hover .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu > li > a {
        padding: 12px 30px;
    }
}

/* 添加汉堡菜单动画效果 */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 100vh;
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        max-height: 100vh;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

/* 汉堡菜单展开和收起动画 */
.navbar-collapse.show {
    animation: slideDown 0.5s forwards;
}

.navbar-collapse.hide {
    animation: slideUp 0.5s forwards;
}

.navbar-nav > li > a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.navbar-nav > li > a:hover:after,
.navbar-nav > li.active > a:after {
    transform: translateX(0);
} 

/* JavaScript交互说明 */
/* 
对应的JavaScript代码应添加以下功能：
1. 点击汉堡菜单按钮时切换.navbar-collapse的.show类
2. 点击汉堡菜单按钮时切换.navbar-toggle的.active类
3. 点击下拉菜单时添加.open类以展开子菜单
4. 在小屏幕上禁用hover触发下拉菜单，改为点击触发
*/ 