/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 头部样式 */
header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

/* header左侧区域样式 */
.header-left {
    display: flex;
    align-items: center;
    flex-direction: row; /* 默认为水平排列 */
    justify-content: flex-start; /* 添加靠左对齐 */
    margin-left: 20%; /* 设置为屏幕宽度的30% */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-right: 15px;
}

/* 头部右侧区域包含菜单按钮和顶部导航 */
.header-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* 确保右对齐 */
    margin-right: 5%; /* 减小右侧边距 */
}

/* 顶部导航 */
.top-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

.top-nav li {
    margin-left: 30px; /* 增加导航项之间的间距 */
    position: relative; /* 添加相对定位，用于添加分隔线 */
}

.top-nav a {
    color: #1e5bb0;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 0;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

/* 主导航 - 修改为平铺展示 */
.main-nav {
    width: 100%;
    background-color: #1e5bb0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: block;
    padding: 15px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-link {
    background-color: rgba(255,255,255,0.1);
}

/* 子菜单样式 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 4px;
    padding: 10px 0;
    list-style: none;
}

/* 鼠标悬停显示子菜单 */
.nav-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.submenu a:hover {
    background-color: #f5f5f5;
}

/* 箭头指示器 */
.has-submenu > .nav-link:after {
    content: '▼';
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.search-box {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.search-box:hover {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-box form {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-box input {
    border: none;
    outline: none;
    padding: 5px;
    width: 150px;
    font-size: 16px;
    color: #ffffff;
    background: transparent;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-btn:hover {
    color: #e0e0e0;
}

.search-btn i {
    font-size: 16px;
}

/* 菜单切换按钮 */
.menu-toggle {
    display: none;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 5px;
    background-color: rgba(30, 91, 176, 0.8);
    transition: all 0.3s ease;
    z-index: 100;
    margin-left: 20px; /* 增加左侧间距 */
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.menu-toggle:hover {
    background-color: #2a6bc2;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 主导航 - 修改为平铺展示 */
.main-nav {
    width: 100%;
    background-color: #1e5bb0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.nav-list {
    list-style: none;
    display: flex; /* 添加flex布局实现横向排列 */
    justify-content: center;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    display: block;
    padding: 15px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.nav-item:hover .nav-link {
    background-color: rgba(255,255,255,0.1);
}

/* 子菜单样式 - 加强纯CSS控制 */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 4px;
    padding: 10px 0;
}

/* 鼠标悬停显示子菜单 */
.nav-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu a {
    color: #333;
    text-decoration: none;
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.submenu a:hover {
    background-color: #f5f5f5;
    color: #1e5bb0;
}

.has-submenu > .nav-link:after {
    content: "▾";
    margin-left: 5px;
    font-size: 12px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .header-right {
        margin-right: 0;
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    /* 在移动端改为上下排列 */
    .header-left {
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: 10px;
        margin-left: 0; /* 移动端不需要左边距 */
        justify-content: center; /* 在移动端仍然居中对齐 */
    }
    
    .logo {
        margin-bottom: 10px;
    }
    
    .header-container {
        flex-direction: column;
    }
    
    .header-container {
        position: relative; /* 添加相对定位作为菜单按钮的定位上下文 */
        width: 100%; /* 确保容器宽度为100% */
    }
    
    .menu-toggle {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    /* 确保顶部导航正确折叠 */
    #top-nav {
        position: absolute;
        top: 70px;
        right: 0;
        background-color: #1e5bb0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease;
        z-index: 1000;
    }
    
    #top-nav.show {
        max-height: 300px;
    }
    
    .top-nav ul {
        flex-direction: column;
    }
    
    .top-nav li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .top-nav li:not(:first-child):before {
        display: none; /* 移除分隔线 */
    }
    
    .top-nav a {
        padding: 12px 20px;
        width: 100%;
        text-align: center;
    }
    
    /* 主导航菜单样式调整 */
    .main-nav {
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.5s ease;
        position: relative;
        z-index: 999;
        width: 100%;
    }
    
    .main-nav.show {
        max-height: 1000px;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    /* 移动端导航菜单样式 */
    .main-nav {
        display: none;
        position: fixed;
        top: 60px; /* 调整顶部距离，让出菜单按钮的位置 */
        right: 0; /* 修改为靠右 */
        width: 50%;
        background-color: #1e5bb0;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    
    .main-nav.show {
        display: block !important;
    }
    
    .nav-item {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        position: relative;
    }
    
    .nav-link {
        padding: 15px 10px;
        font-size: 16px;
        color: white;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 移动端子菜单指示器 */
    .has-submenu > .nav-link:after {
        content: "▾"; /* 改为向下箭头 */
        position: absolute;
        right: 10px;
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .nav-item.active > .nav-link:after {
        transform: rotate(180deg); /* 旋转180度变为向上箭头 */
    }
    
    /* 子菜单的移动端显示方式 */
    .nav-item .submenu {
        position: static;
        display: none;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        border-radius: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: #f5f5f5;
        transition: max-height 0.3s ease;
    }
    
    /* 激活时显示子菜单 */
    .nav-item.active .submenu {
        display: block;
        max-height: 500px; /* 足够大的高度以显示所有子菜单项 */
        padding: 5px 0;
    }
    
    /* 移动端子菜单项样式 */
    .submenu li {
        padding: 0;
        border-bottom: 1px solid #eaeaea;
    }
    
    .submenu li:last-child {
        border-bottom: none;
    }
    
    .submenu a {
        padding: 10px 20px;
        color: #444;
        display: block;
        text-align: left;
    }
    
    /* 添加移动端菜单切换按钮 */
    .has-submenu > .nav-link:after {
        content: '+';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
    }
    
    /* 菜单展开时变换加号为减号 */
    .nav-item.active > .nav-link:after {
        content: '-';
    }
}

/* 根据不同屏幕尺寸调整header-right的样式 */
@media (min-width: 769px) and (max-width: 1200px) {
    .header-right {
        margin-right: 5%; /* 中等屏幕上的右侧边距 */
    }
    .header-left {
        margin-left: 10%; /* 设置为屏幕宽度的30% */
    }
}

@media (min-width: 1201px) and (max-width: 1600px) {
    .header-right {
        margin-right: 5%; /* 大屏幕上的右侧边距 */
    }
    .header-left {
        margin-left: 10%; /* 设置为屏幕宽度的30% */
    }
}

@media (min-width: 1601px) {
    .header-right {
        margin-right: 5%; /* 超大屏幕上的右侧边距 */
    }
    .header-left {
        margin-left: 10%; /* 设置为屏幕宽度的30% */
    }
}

/* 整体布局容器 */
.header-container {
    width: 100%;
    max-width: 100%; /* 确保容器不会溢出 */
}

.header-bg {
    background-image: linear-gradient(rgba(114, 222, 236, 0.7), rgba(30, 91, 176, 0.7)), url('../images/header-bg.jpg');
    background-size: 100% 100%; /* 修改为完全覆盖区域 */
    background-position: center top; /* 调整为顶部对齐 */
    background-repeat: no-repeat; /* 不重复背景图 */
    height: 160px; /* 增加高度从120px到160px */
    display: flex;
    align-items: center;
    padding: 0 10px; /* 减少左右内边距，让header-left的margin-left生效 */
    position: relative; /* 添加定位上下文 */
    overflow: hidden; /* 防止内容溢出 */
}

.header-bg .logo img {
    height: 80px; /* 保持logo图片高度 */
    margin-right: 20px;
}

/* 标题区域样式 */
.title-area {
    position: relative;
    transition: all 0.3s ease;
    padding: 10px 0;
}

.title-area.platform-title {
    margin-left: 10px; /* 减小标题左侧边距 */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    position: relative;
    transition: all 0.3s ease;
}

.title-area.platform-title h1 {
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    letter-spacing: 2px;
    /* 结合platform-title的样式 */
    font-size: 36px;
    color: #ffffff;
    font-weight: bold;
    position: relative;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.3);
    transform: perspective(500px) rotateX(0deg);
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

.title-area.platform-title:hover h1 {
    transform: perspective(500px) rotateX(5deg);
}

/* 添加platform-title的下划线效果 */
.title-area.platform-title h1::after {
    content: '';
    display: block;
    width: 80%;
    height: 3px;
    background: linear-gradient(to right, transparent, #ffffff, transparent);
    position: absolute;
    bottom: -15px;
    left: 10%;
}

/* 手机端响应式设计 */
@media screen and (max-width: 768px) {
    .header-bg {
        flex-direction: column;
        padding: 15px;
        text-align: center;
        justify-content: center; /* 确保移动端内容居中 */
    }

    .header-bg .logo img {
        height: 40px;
        margin-right: 0;
    }

    .title-area.platform-title {
        margin-left: 0;
        text-align: center;
        width: 100%;
    }

    .title-area.platform-title h1 {
        font-size: 18px;
        letter-spacing: 1px;
        margin-top: 10px;
        width: 100%;
        text-align: center;
    }
    
    .title-area.platform-title:hover h1 {
        transform: none; /* 移动端取消悬停效果 */
    }
    
    .title-area.platform-title h1::after {
        height: 2px;
        bottom: -10px;
        background: linear-gradient(to right, transparent, #ffffff, transparent);
    }
} 