/* 全局重置：确保顶部导航顶格显示 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 60px;
    /* 避开固定顶部导航的高度 */
}

/* 顶部导航容器 */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* Logo 样式 */
.header-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo i {
    color: #2563eb;
}

/* PC端导航菜单 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #2563eb;
    background: #f3f4f6;
}

/* 下拉菜单（PC端 Hover 显示） */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    list-style: none;
    display: none;
    /* 默认隐藏 */
    z-index: 10000;
}

.nav-item:hover .nav-dropdown {
    display: block;
    /* PC端 Hover 显示 */
}

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    /* 修复：强制设为flex，保证布局和点击区域正常 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 移动端点击兼容：扩大可点击区域 */
    min-height: 44px;
    width: 100%;
}

.dropdown-link:hover {
    color: #2563eb;
    background: #f3f4f6;
}

/* 移动端汉堡按钮 */
.hamburger-btn {
    display: none;
    /* PC端隐藏 */
    width: auto;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: #1a1a1a;
    /* 移动端点击兼容：最小点击区域 */
    min-width: 44px;
    min-height: 44px;
}

/* 修复：修正dropdown-link的flex布局（仅PC端生效） */
@media (min-width: 769px) {
    .nav-dropdown-item .dropdown-link {
        flex-direction: row-reverse;
        justify-content: flex-start;
        gap: 10px;
        /* 箭头和文字间距 */
    }

    /* 箭头间距（仅PC端） */
    .nav-dropdown-item .dropdown-link .fa-chevron-right {
        margin-right: 10px;
        margin-left: 0;
        transform: rotate(180deg);
    }
}

/* 【响应式】移动端适配 */


/* 调整原页面布局，移除左侧导航依赖 */
.container {
    padding-top: 0;
}

.main-content {
    margin-left: 0 !important;
    /* 取消原左侧导航的 margin */
}

.header-logo-img {
    height: 36px;
    /* 导航栏高度 60px，Logo 设 36px 视觉上最协调 */
    width: auto;
    /* 宽度自适应，防止图片拉伸变形 */
    vertical-align: middle;
    /* 与文字垂直居中对齐 */
    margin-right: 10px;
    /* 和右侧文字保持间距 */
}

/* ------------------------------ */
/* 【四层导航】专属样式 */
/* ------------------------------ */

/* 基础：通用菜单项 */
.nav-dropdown-item.has-children {
    position: relative;
    width: 100%;
}

/* ------------------------------ */
/* PC端逻辑 */
/* ------------------------------ */
@media (min-width: 769px) {

    /* 通用子菜单容器样式 */
    .nav-dropdown-level-2,
    .nav-dropdown-level-3,
    .nav-dropdown-level-4 {
        display: none;
        position: absolute;
        min-width: 180px;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        padding: 8px 0;
        list-style: none;
        margin: 0;
        z-index: 10000;
    }

    /* 第二层：赛道 (核心修改：右对齐 right: 0) */
    .nav-dropdown-level-2 {
        top: 100%;
        right: 0;
        /* 这里设置为 0，实现二级菜单右对齐，不超出屏幕 */
    }

    /* 第三层：场景 (向左展开) */
    .nav-dropdown-level-3 {
        top: 0;
        right: 100%;
        /* 贴在上一级的左侧 */
        margin-right: -2px;
    }

    /* 第四层：问题 (继续向左展开) */
    .nav-dropdown-level-4 {
        top: 0;
        right: 100%;
        margin-right: -2px;
    }

    /* Hover 显示逻辑 */
    .nav-item:hover .nav-dropdown-level-2 {
        display: block;
    }

    .nav-dropdown-item.has-children:hover>.nav-dropdown-level-3 {
        display: block;
    }

    .nav-dropdown-item.has-children:hover>.nav-dropdown-level-4 {
        display: block;
    }
}

/* ------------------------------ */
/* 移动端逻辑（已合并到上方响应式里，这里保留注释即可） */
/* ------------------------------ */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        /* 开启Flex布局 */
        align-items: center;
        /* 垂直居中 */
        justify-content: center;
        /* 水平居中 */
        gap: 6px;
        /* 文字和图标之间的间距 */

        /* 下面是原有属性，微调了宽度 */
        height: 44px;
        padding: 0 12px;
        /* 改为左右内边距，不要固定宽度 */
        border: none;
        background: none;
        cursor: pointer;
        font-size: 0.95rem;
        /* 文字稍微调小一点，配合图标 */
        color: #1a1a1a;

    }

    .nav-menu {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 20px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
        display: none;
        gap: 0;
        z-index: 9998;
        list-style: none;
        /* 🔥 去掉主菜单的点 */
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
        list-style: none;
        /* 🔥 去掉一级菜单项的点 */
    }

    .nav-link {
        padding: 14px 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    /* 所有层级子菜单：默认隐藏，active显示，去掉点 */
    .nav-dropdown-level-2,
    .nav-dropdown-level-3,
    .nav-dropdown-level-4 {
        position: static;
        box-shadow: none;
        padding: 0 0 12px 16px;
        display: none;
        width: 100%;
        list-style: none !important;
        /* 🔥 核心：去掉二、三、四级菜单的点 */
        margin: 0;
        /* 去掉默认外边距 */
    }

    .nav-dropdown-level-2.active,
    .nav-dropdown-level-3.active,
    .nav-dropdown-level-4.active {
        display: block !important;
    }

    /* 子菜单项：也去掉点 */
    .nav-dropdown-item {
        list-style: none !important;
        /* 🔥 去掉所有子菜单项的点 */
        margin: 0;
        padding: 0;
    }

    /* 子菜单触发按钮 */
    .nav-dropdown-item.has-children .dropdown-link {
        display: flex;
        width: 100%;
        min-height: 44px;
        padding: 10px 20px;
        cursor: pointer;
        justify-content: space-between;
        align-items: center;
    }

    /* 统一所有菜单箭头逻辑 */
    .nav-item .nav-link .fa-chevron-right,
    .nav-dropdown-item .dropdown-link .fa-chevron-right {
        transform: rotate(0deg) !important;
        transition: transform 0.2s ease;
    }

    .nav-item.active>.nav-link>.fa-chevron-right,
    .nav-dropdown-item.active>.dropdown-link>.fa-chevron-right {
        transform: rotate(90deg) !important;
        transition: transform 0.2s ease;
    }
}