* {
    box-sizing: border-box;
}

body {
    font-family: '微软雅黑', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f3f4f6;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* 100%视口高度 */
}

.logo {
  height: 120px;
  margin-right: 20px;
  background-color: transparent;
}


.navbar {
    position: relative;
    background: linear-gradient(to bottom, #5a5a5a, #3e3e3e);
    display: flex;
    align-items: center;
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hamburger {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    margin-right: 15px;
}


.menu {
    display: none;
    flex-grow: 1;
    justify-content: flex-start;
}

.menu.show {
    display: flex;
    flex-direction: column;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #ffffff;
    padding: 10px 15px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    font-size: 18px;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: #007bff; /* 主色调 */
    color: #ffffff; /* 白色文字 */
}

/* Mega Menu 样式 */
.mega-menu {
    display: none; /* 默认隐藏Mega Menu */
    position: absolute; /* 绝对定位 */
    left: 0;
    top: 100%; /* 在父菜单下方显示 */
    background: rgba(100, 100, 100, 0.9); /* 半透明背景颜色 */
    padding: 20px; /* 增加内边距 */
    border-radius: 5px; /* 圆角效果 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* 增加阴影效果 */
    z-index: 100; /* 确保Mega Menu在其他元素之上 */
    animation: fadeIn 0.3s ease; /* 添加动画效果 */
}

.nav-item:hover .mega-menu {
    display: block; /* 鼠标悬停时显示Mega Menu */
}

.mega-menu ul {
    list-style: none; /* 移除列表样式 */
    padding: 0; /* 移除内边距 */
    margin: 0; /* 移除外边距 */
}

.sub-link {
    color: #ffffff; /* 子菜单白色文字 */
    padding: 10px 15px; /* 缩小padding */
    text-decoration: none;
    display: block; /* 使链接成为块级元素 */
    font-size: 16px; /* 保持子链接字体大小 */
    transition: background-color 0.3s; /* 增加过渡效果 */
    white-space: nowrap; /* 防止换行 */
}

.sub-link:hover {
    background-color: #007bff; /* 子菜单选中颜色 */
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 当前选中的菜单项样式 */
.mega-menu a.active {
    background-color: #333; /* 可以根据需求调整颜色 */
    color: #fff;
    font-weight: bold;
}


.content {
    flex: 1; /* 占满剩余空间 */
    padding: 15px; /* 内容区内边距 */
    background-color: #ffffff; /* 内容区背景颜色 */
    overflow-y: auto; /* 内容区可滚动 */
    border-radius: 5px; /* 圆角效果 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 增加阴影效果 */
}

.footer {
    text-align: center;
    padding: 10px;
    background-color: #4a4a4a; /* 深色Footer */
    color: #ffffff; /* 白色文字 */
    font-size: 12px;
}

/* 当前选中菜单名称的样式 */
#current-menu {
    font-size: 18px;
    color: #f0ba46;
    font-weight: bold;
    margin: 10px 0;
    padding-left: 15px;
    cursor: pointer;
}

/* 当前选中菜单名称的样式 */
#span-username {
    font-size: 18px;
    color: #22e66d;
    font-weight: bold;
    cursor: pointer;
}

#nologin-username{
    font-size: 18px;
    color: #22e66d;
    font-weight: bold;
    cursor: pointer;
}

/* 添加媒体查询以优化移动端显示 */
@media (max-width: 768px) {
    .menu {
        display: none; /* 确保菜单在小屏幕上默认隐藏 */
    }

    .menu.show {
        display: flex; /* 在菜单显示时确保它显示 */
        flex-direction: column; /* 垂直排列 */
        padding: 10px 0; /* 增加上下内边距 */
    }

    .hamburger {
        display: block; /* 显示汉堡菜单 */
    }
}
