/* 基本样式 */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
}

.content-wrapper {
    display: flex;
    min-height: 0vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background-color: #d4dae0; /* 深海蓝 */
    color: #ffffff; /* 白色文字 */
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: width 0.3s;
    overflow-y: auto;
}

.sidebar .menu-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar .menu-list a {
    text-decoration: none;
    color: #333; /* 或者你想要的任何颜色 */
    display: flex;
    align-items: center;
    padding: 10px 15px;
    transition: background-color 0.3s;
}

.sidebar .menu-list a:hover {
    background-color: #f0f0f0; /* 或者你想要的任何悬停颜色 */
}

.sidebar .menu-list i {
    margin-right: 10px;
    width: 20px; /* 确保图标宽度一致 */
    text-align: center;
}

.sidebar .menu-list span {
    flex: 1;
}

.sidebar .logo {
    padding: 10px 0;
    text-align: center;
    background-color: #f8f9fa; /* 更深的海蓝 */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
}

.sidebar .logo a {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar .logo img {
    width: 200px;
    height: 40px;
    object-fit: contain;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    color: #ffffff; /* 确保链接颜色为白色 */
}

.sidebar ul li a:hover {
    background-color: #2e7d9a; /* 稍浅的海蓝，用于悬停效果 */
}
 
.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* 主容器样式 */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 250px; /* 与侧边栏宽度相同 */
    min-height: 100vh; /* 确保主容器至少占据整个视口高度 */
}

.welcome-message {
    background-color: #f8f9fa; /* 或者其他你喜欢的颜色 */
    padding: 10px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.welcome-message h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    /* 添加上下 padding 以防止内容被 header 和 footer 遮挡 */
    padding-top: 60px; /* 根据你的 header 高度调整 */
    padding-bottom: 60px; /* 根据你的 footer 高度调整 */
}

/* 头部样式 */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #f8f9fa;
    padding: 10px 20px;
    height: 50px;
    border-bottom: 1px solid #e0e0e0;
}

.user-info {
    font-size: 14px;
    text-align: right;
}

/* 页脚样式 */
footer {
    position: sticky;
    bottom: 0;
    z-index: 1000;    
    background-color: #f8f9fa; /* 或者你想要的任何颜色 */
    padding: 10px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

/* 仪表盘小部件样式 */
.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.widget {
    background-color: #ffffff; /* 保持小部件为白色背景 */
    border: 1px solid #c5e1e6; /* 添加浅蓝色边框 */
}

.widget h2 {
    color: #1a5f7a; /* 使用深海蓝色作为小标题颜色 */
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: #fff;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
}

/* 切换按钮样式 */
.toggle-sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    cursor: pointer;
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
    }

    .sidebar .logo {
        height: 50px; /* 调整小屏幕下logo区域的高度 */
    }

    .sidebar .logo img {
        width: 200px;
        height: 40px;
    }
    .sidebar ul li span {
        display: none;
    }
    
    .sidebar ul li a {
        justify-content: center;
        padding: 15px 0;
    }

    .sidebar ul li a i {
        margin-right: 0;
    }

    .main-container {
        margin-left: 60px;
        width: calc(100% - 60px);
    }

    .sidebar.expanded {
        width: 250px;
    }

    .sidebar.expanded .logo img {
        width: 200px;
        height: 40px;
    }
    
    .sidebar.expanded ul li span {
        display: inline-block;
    }

    .sidebar.expanded ul li a {
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .sidebar.expanded ul li a i {
        margin-right: 10px;
    }
}