/* 基础重置 */
header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

header {
    margin-bottom: 0px;
}
/* 原header样式强化（大屏>800px时的基础样式） */
.header-top {
    background: rgba(54, 54, 54, 0.35) !important; /* 强制大屏半透明，修复变黑问题 */
    position: fixed;
    top: 0;
    left: 0; /* 新增：确保header顶头，无左侧留白 */
    width: 100%;
    padding: 8px 0;
    z-index: 1001 !important; /* 高于菜单，确保不被遮挡 */
    height: 60px; /* 固定高度 */
    border: none;
    outline: none;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 2vw;
    width: 100%;
    height: 100%; /* 新增：填满header高度，避免对齐问题 */
}
/* Logo自适应样式（大屏基础样式）- 上移4px */
header .header-top .logo {
    display: flex;
    justify-content: flex-start; /* 修正：大屏也左对齐，保持统一 */
    align-items: center; /* 修正：垂直居中，避免Logo偏移 */
    height: 100%;
    width: auto; /* 新增：默认不占满宽度 */
    max-width: 250px;
    flex-shrink: 0;
    transform: translateY(-4px); /* Logo上移4px */
}
header .header-top .logo img {
    max-width: 300px;
    width: 100%;
    max-width: 25vw;
    height: auto;
    margin: 0 !important; /* 修正：移除负边距，避免Logo溢出 */
}

.logo {
    display: block;
    max-width: 250px;
}
.logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* 导航项基础样式（大屏显示，核心修复：恢复大屏导航项） */
.nav-items {
    display: flex !important; /* 强制大屏显示，修复消失问题 */
    align-items: center;
    gap: 4vw;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}
/* 导航链接基础样式 */
.nav-items > li > a {
    color: #fff;
    text-decoration: none;
    font-size: clamp(14px, 1.5vw, 16px);
    padding: 8px 12px;
    display: block;
    position: relative;
    transition: 0.2s;
}
.nav-items > li > a:hover {
    background: #626262;
    color: #fff;
    opacity: 0.9;
    transform: translateY(-2px);
}
/* 当前激活状态 */
.nav-items > li > a.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: #fff;
}
/* 下拉菜单系统 */
.has-dropdown {
    position: relative;
}

.has-dropdown .dropdown {
    display: none;
    position: absolute;
    left: 50%;
    top: calc(100% + 5px);
    transform: translateX(-50%);
    background: #101010;
    min-width: 200px;
    width: 100%;
    max-width: 250px;
    padding: 15px 0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}
/* 悬停触发 */
.has-dropdown:hover .dropdown {
    display: block;
    opacity: 1;
}

/* 防止鼠标移出时立即关闭 */
.has-dropdown .dropdown::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 10px;
}
/* 下拉菜单项 */
.dropdown li {
    margin: 8px 0;
    text-align: center;
}

.dropdown a {
    color: #fff !important;
    padding: 10px 25px;
    display: block;
    transition: 0.3s;
    font-size: clamp(13px, 1.2vw, 15px);
}
/* 下拉菜单悬停效果 */
.dropdown a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

/* ===== 复用汉堡/关闭按钮样式 ===== */
.hamburger-btn {
    display: none; /* 大屏隐藏 */
    position: relative;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    align-items: center;
    justify-content: center;
}
/* 汉堡图标样式 */
.hamburger-icon {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 中间横线 */
.hamburger-icon span {
    display: block !important;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
/* 上下横线 */
.hamburger-icon::before,
.hamburger-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 30px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.hamburger-icon::before {
    top: 5px;
}

.hamburger-icon::after {
    bottom: 5px;
}

/* 关闭图标样式 */
.close-icon {
    display: none;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
}
/* 菜单打开时切换按钮样式 */
.hamburger-btn.open .hamburger-icon {
    display: none;
}

.hamburger-btn.open .close-icon {
    display: block;
}

/* 移除侧边栏内关闭按钮 */
.sidebar-header, .close-btn {
    display: none !important;
}
/* ===== 侧边菜单样式（从header下边缘展开） ===== */
.sidebar-menu {
    position: fixed;
    top: 60px; /* 和header高度一致 */
    left: 0;
    width: 100vw !important;
    height: calc(100vh - 60px) !important;
    background: #101010 !important; /* 实色，覆盖页面 */
    z-index: 1000 !important; /* 低于header，高于页面内容 */
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    padding: 20px;
    margin: 0 !important; /* 移除默认边距 */
}
/* 菜单打开状态 */
.sidebar-menu.open {
    transform: translateY(0);
}

/* 侧边导航样式 */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav li a {
    color: #fff;
    text-decoration: none;
    padding: 18px 0;
    display: block;
    font-size: 18px;
}
.sidebar-nav li a.active {
    background: rgba(255,255,255,0.1);
}

/* 侧边下拉菜单样式 */
.sidebar-has-dropdown .sidebar-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* 侧边下拉菜单容器 + 0.3s展开动画 */
.sidebar-dropdown {
    display: block;
    list-style: none;
    background: #101010 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease; /* 和箭头同速动画 */
}

.sidebar-dropdown li a {
    padding: 15px 0 15px 20px;
    font-size: 16px;
}
/* 展开状态：显示子菜单 + 动画 */
.sidebar-dropdown.open {
    max-height: 1000px;
    opacity: 1;
}
/* ===== 修复大屏（>800px）侧边栏遮挡导航项 ===== */
@media (min-width: 801px) {
    /* 强制大屏下侧边栏完全隐藏，且不占空间、不遮挡 */
    .sidebar-menu {
        display: none !important; /* 彻底隐藏，比transform更彻底 */
        position: static !important; /* 取消固定定位，回归文档流 */
        width: 0 !important;
        height: 0 !important;
        z-index: -1 !important; /* 层级压到最低，绝对不遮挡任何元素 */
    }
    /* 强制大屏下显示正常导航项（兜底） */
    .nav-items {
        display: flex !important;
    }

    /* 确保大屏下汉堡按钮隐藏 */
    .hamburger-btn {
        display: none !important;
    }
}
/* ===== 媒体查询（800px以下） ===== */
@media (max-width: 800px) {
    /* 显示汉堡按钮 */
    .hamburger-btn {
        display: flex;
        margin-right: 0;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* 隐藏大屏导航项 */
    .nav-items {
        display: none !important;
    }
    /* 修正navbar样式，顶头无留白 */
    .navbar {
        justify-content: space-between !important;
        align-items: center;
        gap: 0 !important;
        padding: 0 10px !important;
        width: 100%;
        height: 100%;
    }
    /* 小屏header样式：实色+顶头+无留白 */
    .header-top {
        background: #101010 !important; /* 改为侧边栏同款实色，修复透明问题 */
        padding: 0 !important; /* 移除上下内边距，顶头 */
        height: 60px !important; /* 固定高度 */
        top: 0 !important;
        left: 0 !important;
    }
    /* 小屏Logo样式 - 上移4px */
    header .header-top .logo {
        justify-content: flex-start;
        width: auto;
        max-width: 250px;
        margin-left: 0 !important;
        flex-shrink: 0;
        height: 100%;
        align-items: center;
        position: relative !important; /* 新增：开启层级控制 */
        z-index: 1003 !important; /* 高于header(1001)、菜单(1000)、按钮(1002) */
        transform: translateY(-4px); /* Logo上移4px */
    }
    header .header-top .logo img {
        max-width: 250px !important;
        margin: 0 !important;
    }
    .sidebar-has-dropdown {
        display:  block !important;
        justify-content: center;
        align-items: center;
        position: relative;
        padding-right: 60px; /* 放大箭头后预留60px空间 */
    }
    /* 文字部分：纯跳转，居中 */
    .sidebar-has-dropdown > a {
        display: block;
        text-align: center;
        flex: 1;
    }
    /* 新增：父菜单的文字+三角容器，用flex并排 */
    .sidebar-has-dropdown > .menu-header {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        width: 100%;
    }
    /* 产品中心/解决方案的文字部分：纯跳转，居中 */
    .sidebar-has-dropdown > .menu-header > a {
        display: block;
        text-align: center;
        flex: 1;
    }
    /* 独立三角按钮样式：固定右侧 + 放大尺寸 */
    .sidebar-triangle-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: #fff;
        font-size: 18px;
        width: 50px;
        height: 50px;
        line-height: 50px; /* 修正：行高和高度一致，箭头居中 */
        text-align: center;
        padding: 0;
        cursor: pointer;
        transition: transform 0.3s ease; /* 0.3s旋转动画 */
    }
    /* 展开时三角旋转 */
    .sidebar-has-dropdown.open .sidebar-triangle-btn {
        transform: translateY(-50%) rotate(180deg);
    }
    /* 统一所有侧边菜单项的布局：文字居中，预留三角空间 */
    .sidebar-nav li a {
        display: flex !important;
        justify-content: center !important; /* 文字绝对居中 */
        align-items: center !important;
        position: relative !important;
        width: 100% !important; /* a标签宽度=li宽度，填满无空隙 */
        padding: 18px 0 !important; /* 移除右侧40px预留，彻底消除空隙 */
        margin: 0 !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    /* 子菜单对齐核心修改：和主标题同规则，缩进后相对居中 */
    /* 确保子菜单项文字颜色为白色，无其他杂色 */
    .sidebar-dropdown li a {
        color: #fff !important;
        background: transparent !important; /* 子菜单项本身透明，继承父容器背景 */
        padding-right: 40px !important;
        padding-left: 40px !important;
        justify-content: center !important;
    }
    .sidebar-nav > li {
        position: relative;
        padding-right: 0 !important; /* 和产品中心的右侧预留空间一致 */
        width: 100%;
    }
    /* 首页/关于我们的文字部分：和产品中心文字部分对齐 */
    .sidebar-nav > li:not(.sidebar-has-dropdown) > a {
        display: flex !important;
        justify-content: center !important;
        align-items: center;
        position: relative;
        width: 100%;
        padding-right: 0 !important; /* 已通过父li预留40px，这里无需重复 */
        text-align: center;
    }
}
