/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* 顶部蓝色导航条 */
.top-bar {
    background-color: rgba(0,156,235);
    color: white;
    padding: 8px 5%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 14px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 顶部导航链接样式 */
.top-nav {
    display: flex;
    gap: 20px;
}

.top-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.top-nav a:hover {
    opacity: 0.8;
}

/* 语言切换样式 */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switcher span {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 2px;
    transition: background-color 0.3s;
}

.language-switcher .active {
    background-color: rgba(255, 255, 255, 0.2);
}

.language-switcher span:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主导航区域 */
.main-nav {
    background-color: white;
    padding: 20px 8%; /* 增加原始内边距 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    min-height: 80px; /* 设置最小高度 */
}

/* 当页面滚动时，缩短高度30% */
.main-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 5px 5%; /* 减少上下内边距，高度缩短约30% */
    min-height: 45px; /* 80px的70%约为56px */
}

/* 品牌标识样式 */
.brand {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

/* 品牌标识在缩短状态下的调整 */
.main-nav.scrolled .brand img {
    width: 80px; /* 适当缩小logo */
}

/* 主导航链接样式 */
.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

/* 主导航链接在缩短状态下的调整 */
.main-nav.scrolled .nav-links a {
    font-size: 20px; /* 稍微减小字体 */
}

.nav-links a:hover {
    color: rgba(0,156,235);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: rgba(0,156,235);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 服务触发器的样式 */
.services-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
}

.services-trigger i {
    font-size: 12px;
    transition: transform 0.3s;
}

.main-nav:hover .services-trigger i {
    transform: rotate(180deg);
}

/* 搜索区域样式 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.search-icon {
    cursor: pointer;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    z-index: 2;
}

.search-icon:hover {
    transform: scale(1.1);
}

.search-box {
    position: absolute;
    right: 0;
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    display: flex;
    justify-content: flex-end;
}

.search-container:hover .search-box {
    width: 180px;
    height: 45px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
    transform: translateX(0);
    direction: ltr;
    text-align: left;
}

.search-input:focus {
    border-color: rgba(0,156,235);
}

/* 副菜单栏 - 修改定位方式 */
.sub-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); */
    /* border-top: 1px solid #eee; */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
    /* 添加高度限制 */
    max-height: 120px; /* 调整为原来的50%左右 */
    overflow: hidden;
}

/* 副菜单栏在缩短状态下的位置调整 */
.main-nav.scrolled + .sub-nav {
    top: 56px; /* 根据缩短后的导航栏高度调整 */
}

.sub-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 8%; /* 减少内边距以降低高度 */
    display: flex;
    justify-content: center;
    gap: 30px; /* 稍微减少间距 */
}

.sub-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px; /* 减少内边距 */
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 80px; /* 稍微减小最小宽度 */
}

.sub-nav-item:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sub-nav-icon {
    width: 35px; /* 减小图标大小 */
    height: 35px;
    background: linear-gradient(135deg, rgba(0,156,235), #2c7fda);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px; /* 减少底部边距 */
    transition: all 0.3s ease;
}
.sub-nav-item:hover .sub-nav-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, #164a8d, rgba(0,156,235));
}

.sub-nav-icon i {
    color: white;
    font-size: 16px; /* 减小图标字体大小 */
}
.sub-nav-item span {
    font-size: 12px; /* 减小文字大小 */
    font-weight: 600;
    color: #333;
}
.sub-nav-item:hover span {
    color: rgba(0,156,235);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-nav {
        display: none;
    }
    
    .nav-links {
        display: none;
    }
    
    .sub-nav-container {
        flex-wrap: wrap;
        gap: 20px;
        padding: 15px 5%;
    }
    
    .sub-nav-item {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .sub-nav-icon {
        width: 40px;
        height: 40px;
    }
    
    .sub-nav-icon i {
        font-size: 16px;
    }
}