* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    font-family: 'Arial', sans-serif; /* 使用更常见的字体，提升兼容性 */
}

.header {
    background: #FFFFFF;
    color: #333333;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 添加微妙阴影，增加层次感 */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%; /* 限制最大宽度，使内容居中 */
    margin: 0 auto;
    padding: 10px 20px;
    background-color: #FFFFFF;
}

.logo img {
    height: 40px; /* 稍微增大 logo 尺寸 */
    transition: transform 0.3s ease; /* 添加缩放效果 */
}

.logo img:hover {
    transform: scale(1.05); /* 鼠标悬停时轻微放大 */
}

.nav ul {
    list-style-type: none;
    display: flex;
    gap: 20px; /* 增加导航项之间的间距 */
}

.nav li {
    position: relative;
}

.nav a {
    color: #333333; /* 更柔和的文字颜色 */
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    font-size: 16px;
    font-weight: 500; /* 增加字体粗细，提升可读性 */
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.nav a:hover {
    color: #007BFF; /* 悬停时变为蓝色，提升交互性 */
    border-bottom: 2px solid #007BFF;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #FFFFFF;
    min-width: 220px; /* 增加下拉菜单宽度 */
    border-radius: 4px; /* 圆角效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 更自然的阴影 */
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px); /* 下拉菜单初始位置偏移 */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0); /* 悬停时滑入 */
}

.dropdown-content a {
    color: #333333;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    border-bottom: none;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #F5F5F5; /* 悬停时背景变灰 */
    color: #007BFF; /* 文字变为蓝色 */
}

.slogan {
    text-align: center;
    font-size: 14px;
    color: #666666; /* 更柔和的颜色 */
}

.slogan strong {
    display: block;
    font-size: 18px;
    color: #333333;
}

.slogan span {
    display: block;
    font-size: 12px;
    color: #999999;
}

.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: #333333;
    transition: transform 0.4s ease, color 0.3s ease;
}

.hamburger:hover {
    color: #007BFF; /* 悬停时颜色变化 */
}

/* Media Query for Mobile */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 10px 15px 10px 25px;
        flex-wrap: nowrap; /* 确保不换行 */
        justify-content: space-between; /* 调整为两端对齐 */
        align-items: center;
        position: relative;
        width: 100%; /* 确保容器宽度为 100% */
    }

    .hamburger {
        display: block;
        order: 1; /* 汉堡菜单在左侧 */
        margin-right: 10px; /* 与 logo 保持间距 */
        margin-left: 10px; /* 左侧边距 */
        flex-shrink: 0; /* 防止被压缩 */
    }

    .hamburger.active {
        transform: rotate(90deg);
        color: #007BFF; /* 激活时颜色变化 */
    }

    .logo {
        order: 2; /* logo 在中间 */
        flex: 1; /* 确保 logo 占据中间位置 */
        display: flex;
        justify-content: center; /* 居中显示 */
        min-width: 0; /* 防止 logo 占用过多空间 */
    }

    .logo img {
        height: 25px; /* 移动端缩小 logo */
    }

    .slogan {
        order: 3; /* slogan 在右侧 */
        font-size: 12px;
        margin-left: 10px; /* 与 logo 保持间距 */
        margin-right: 60px; /* 右侧边距 */
        text-align: center; /* 文字右对齐 */
        max-width: 30%; /* 限制 slogan 的最大宽度 */
        flex-shrink: 1; /* 允许 slogan 被压缩 */
        white-space: normal; /* 允许文本换行 */
        overflow: hidden; /* 隐藏溢出内容 */
        text-overflow: ellipsis; /* 溢出时显示省略号 */
    }

    .slogan strong {
        font-size: 14px; /* 稍微减小字体，防止占用过多空间 */
        display: block;
        white-space: nowrap; /* strong 部分尽量不换行 */
        overflow: hidden;
        text-overflow: ellipsis; /* 溢出时显示省略号 */
    }

    .slogan span {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav {
        display: none;
        position: absolute;
        top: 60px; /* 调整位置以适应移动端 */
        left: 0;
        width: 100%;
        background: #FFFFFF;
        padding: 20px 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        opacity: 0;
        transform: translateY(-20px); /* 初始位置偏移 */
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 999; /* 确保在最上层 */
    }

    .nav.active {
        display: block;
        opacity: 1;
        transform: translateY(0); /* 激活时滑入 */
    }

    .nav ul {
        flex-direction: column;
        gap: 0; /* 移除横向间距 */
    }

    .nav li {
        margin-bottom: 5px;
        border-bottom: 1px solid #EEEEEE; /* 分隔线 */
        width: 100%;
        margin-left: 10px;
    }

    .nav a {
        padding: 15px 25px;
        font-size: 16px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        display: none;
        background: #F9F9F9; /* 稍微不同的背景色区分层级 */
        padding-left: 20px;
        opacity: 0;
        height: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, height 0.3s ease;
    }

    .dropdown.active .dropdown-content {
        display: block;
        opacity: 1;
        height: auto;
    }

    .dropdown-content a {
        padding: 12px 25px;
        font-size: 14px;
        border-bottom: 1px solid #EEEEEE;
    }
}

/* Adjust logo and nav spacing on desktop */
@media screen and (min-width: 769px) {
    .logo {
        margin-left: 20px;
        margin-right: 30px;
    }
}

/* Additional media query for very small screens */
@media screen and (max-width: 320px) {
    .slogan {
        max-width: 25%;
        font-size: 10px;
    }
    .slogan strong {
        font-size: 12px;
    }
    .hamburger {
        margin-left: 5px;
        margin-right: 5px;
        font-size: 24px;
    }
    .logo img {
        height: 25px;
    }
}
