/* ========== 页头样式文件 header.css ========== */

/* ========== 顶部工具栏 ========== */

.top-bar {
    background-color: #1E88E5;
    color: #fff;
    font-size: 13px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.top-bar-left span {
    margin-right: 20px;
}

.top-bar-right {
    display: flex;
    align-items: center;
}

.top-bar-right a {
    color: #fff;
    margin-left: 20px;
}

.top-bar-right a:hover {
    opacity: 0.8;
}

/* ========== 主页头 ========== */

.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* ========== Logo区域 ========== */

.logo {
    flex-shrink: 0;
}

.logo a {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #1E88E5;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
}

/* ========== 导航菜单 ========== */

.nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    overflow-x: auto;
    padding: 0 10px;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav a {
    padding: 8px 12px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav a:hover,
.nav a.active {
    color: #1E88E5;
    background-color: rgba(30, 136, 229, 0.1);
}

.nav a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #1E88E5;
    transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
    width: 60%;
}

/* ========== 移动端菜单按钮 ========== */

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* ========== 移动端菜单 ========== */

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

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

.mobile-nav a {
    display: block;
    padding: 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: #1E88E5;
    padding-left: 10px;
}

/* ========== 遮罩层 ========== */

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* ========== 页头样式结束 ========== */