/* 现代化头部导航样式 */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 1rem; /* 添加内边距 */
}

/* 品牌区域 */
.brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0; /* 防止品牌区域被压缩 */
}

.logo {
    flex-shrink: 0;
}

.logo-image {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.brand-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6366f1;
    margin: 0;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
}

/* 主导航 */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-start; /* 从左开始排列 */
    margin: 0 2rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem; /* 增加间距 */
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-start; /* 从左到右排列 */
    white-space: nowrap; /* 防止换行 */
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    line-height: 1; /* 确保行高一致 */
    height: 40px; /* 固定高度 */
}

.nav-link:hover,
.nav-link.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #6366f1;
    border-radius: 50%;
}

.nav-link i {
    font-size: 1rem;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0; /* 防止图标被压缩 */
}

/* Mobile Menu Toggle */
/* 移动端菜单简化样式 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 12px;
    background: none;
    border: none;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    display: block;
}

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

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

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

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #eee;
}

.mobile-nav-link {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

.mobile-nav-link:hover {
    background: #f5f5f5;
}

@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
}

body.mobile-menu-open {
    overflow: hidden;
}

.mobile-nav::-webkit-scrollbar {
    width: 4px;
}

.mobile-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    margin-bottom: 15px;
}

.mobile-nav-link {
    display: block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    transform: translateX(5px);
}

.mobile-nav-link:active {
    transform: scale(0.98);
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    transform: scaleY(1);
}



/* Responsive Design */
@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-right: 5px;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    body.mobile-menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    /* 确保菜单按钮在移动端可见 */
    .header-container {
        padding: 0 15px;
    }
    
    .mobile-menu-toggle {
        margin-left: auto;
    }
}

@media screen and (max-width: 480px) {
    .mobile-nav {
        width: 100%;
        right: -100%;
    }
    
    .mobile-nav.active {
        right: 0;
    }
    
    .mobile-nav-link {
        font-size: 16px;
        padding: 12px 15px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .mobile-nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}