/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    height: 60px;
    background-color: #2c3e50;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.user-info span {
    color: white;
    margin-right: 15px;
}

.user-info a {
    color: #ecf0f1;
    text-decoration: none;
}

.user-info a:hover {
    color: #3498db;
}

/* 侧边栏样式 */
.sidebar {
    width: 220px;
    background-color: #2c3e50;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    border-bottom: 1px solid #34495e;
}

.sidebar a {
    display: block;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar a:hover, .sidebar a.active {
    background-color: #34495e;
    color: #3498db;
}

.sidebar i {
    margin-right: 10px;
    font-size: 18px;
}

/* 主内容区域 */
.main-content {
    margin-left: 220px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.card h3 {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 10px;
}

.card p {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.recent-activity {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.recent-activity h2 {
    padding: 20px;
    background-color: #f8f9fa;
    margin: 0;
    font-size: 18px;
}

.recent-activity table {
    width: 100%;
    border-collapse: collapse;
}

.recent-activity th, .recent-activity td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.recent-activity th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.login-box {
    width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 30px;
}

.logo {
    text-align: center;
}

.logo h1 {
    color: #2c3e50;
    margin-top: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
}

.form-group input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 90px;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        position: relative;
    }
    
    .sidebar {
        width: 60px;
        left: -60px;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}
/* ========== 用户管理页面专属样式（基于公共CSS适配，无冲突） ========== */
/* 1. 适配主内容区域：基于公共CSS的220px侧边栏，修正位置和宽度 */
.main-content.user-management {
    margin-top: 80px;
    margin-left: 220px !important; /* 匹配公共CSS的sidebar宽度 */
    padding: 20px 20px 40px !important; /* 继承公共padding，增加底部间距 */
    min-height: calc(100vh - 60px) !important; /* 继承公共高度计算逻辑 */
    background-color: #f5f7fa !important; /* 继承body背景色 */
}

/* 2. 红框卡片容器：复用公共.card样式，避免冲突 */
.main-content.user-management .content-card {
    background: white !important;
    border-radius: 8px !important; /* 继承公共圆角 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important; /* 继承公共阴影 */
    padding: 20px !important;
    margin-bottom: 0 !important;
}

/* 3. 页面标题：继承公共字体体系 */
.main-content.user-management h1 {
    font-size: 18px !important; /* 匹配公共recent-activity标题大小 */
    color: #333 !important;
    margin: 0 0 20px 0 !important;
    font-weight: 600 !important;
}

/* 4. 提示消息：复用公共.alert样式，统一风格 */
.main-content.user-management .alert {
    margin-bottom: 16px !important;
    padding: 12px !important; /* 继承公共alert内边距 */
    border-radius: 4px !important; /* 继承公共圆角 */
}
.main-content.user-management .alert-success {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

/* 5. 工具栏：继承公共flex布局，适配按钮/搜索框 */
.main-content.user-management .toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important; /* 响应式换行，避免溢出 */
    gap: 12px !important;
}

/* 6. 按钮样式：完全继承公共.btn样式，仅微调尺寸适配表格 */
.main-content.user-management .btn {
    padding: 8px 16px !important; /* 基础按钮尺寸 */
    font-size: 14px !important; /* 继承公共字体大小 */
    border-radius: 4px !important; /* 继承公共圆角 */
    text-decoration: none !important;
}
/* 小按钮：适配表格操作列，缩小尺寸 */
.main-content.user-management .btn-sm {
    padding: 6px 12px !important;
    font-size: 12px !important;
}
/* 危险按钮：基于公共色系扩展，无冲突 */
.main-content.user-management .btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
}
.main-content.user-management .btn-danger:hover {
    background-color: #c0392b !important;
}

/* 7. 搜索框：继承公共输入框样式，统一视觉 */
.main-content.user-management .search-box input {
    width: 220px !important;
    padding: 10px 15px !important; /* 继承公共form-group输入框内边距 */
    border: 1px solid #ddd !important; /* 继承公共输入框边框 */
    border-radius: 4px !important; /* 继承公共圆角 */
    font-size: 14px !important;
    outline: none !important;
}
.main-content.user-management .search-box input:focus {
    border-color: #3498db !important; /* 继承公共输入框聚焦色 */
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2) !important;
}
.main-content.user-management .search-box button {
    padding: 10px 16px !important;
    background-color: #3498db !important; /* 继承公共主按钮颜色 */
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
}

/* 8. 表格容器：复用公共表格样式，避免溢出 */
.main-content.user-management .table-container {
    background: white !important;
    border-radius: 8px !important; /* 继承公共卡片圆角 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important; /* 继承公共阴影 */
    overflow-x: auto !important; /* 仅表格横向滚动，不影响整体 */
}

/* 9. 表格样式：完全继承公共table样式，仅优化细节 */
.main-content.user-management table {
    width: 100% !important;
    border-collapse: collapse !important;
}
.main-content.user-management table th,
.main-content.user-management table td {
    padding: 12px 15px !important; /* 继承公共表格内边距 */
    border-bottom: 1px solid #eee !important;
    font-size: 14px !important;
}
.main-content.user-management table th {
    background-color: #f8f9fa !important; /* 继承公共表头背景 */
    color: #555 !important;
    font-weight: 600 !important;
}
/* 表格行悬停：新增交互，不冲突 */
.main-content.user-management table tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* 10. 状态标签：基于公共色系，适配表格 */
.main-content.user-management .status-active {
    padding: 4px 8px !important;
    background-color: #d4edda !important;
    color: #155724 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
}
.main-content.user-management .status-inactive {
    padding: 4px 8px !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
}

/* 11. 头像样式：适配表格单元格 */
.main-content.user-management table td img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

/* 12. 分页区域：继承公共样式，适配布局 */
.main-content.user-management .pagination {
    padding: 15px !important;
    text-align: right !important;
    font-size: 14px !important;
    color: #555 !important;
}
.main-content.user-management .pagination .btn {
    margin-left: 8px !important;
}

/* 13. 空数据提示：继承公共样式 */
.main-content.user-management table tbody tr td[colspan="9"] {
    text-align: center !important;
    padding: 40px 0 !important;
    color: #777 !important;
    font-size: 14px !important;
}

/* 14. 响应式适配：继承公共@media逻辑，适配小屏幕 */
@media (max-width: 768px) {
    .main-content.user-management {
        margin-left: 0 !important; /* 匹配公共响应式逻辑 */
        padding: 15px !important;
    }
    .main-content.user-management .search-box input {
        width: 100% !important;
    }
}
/* ========== 用户管理页面样式结束 ========== */
/* 侧边栏主样式 - 完全匹配截图深色主题 */
.sidebar {
    width: 210px; /* 截图宽度更窄，更紧凑 */
    height: 100%;
    background-color: #1f2937; /* 截图侧边栏背景色 */
    color: #e5e7eb;
    position: fixed;
    top: 60px; /* 与顶部导航栏高度一致 */
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
    transition: all 0.2s ease;
}

.menu-root {
    list-style: none;
}

/* 一级菜单项 */
.menu-item {
    position: relative;
}

/* 一级菜单链接 */
.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* 菜单项激活态 - 左侧蓝条 + 背景高亮 */
.menu-item.active > .menu-link {
    background-color: #214c9b;
    color: #fff; /* 蚂蚁蓝，与截图按钮颜色一致 */
    border-left: 3px solid #16418f;
    padding-left: 13px; /* 抵消border-left的3px，保持文字对齐 */
}

/* 菜单项悬停态 */
.menu-link:hover {
    background-color: #374151;
    color: #ffffff;
}

/* 图标样式 */
.iconfont {
    font-size: 16px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* 菜单标题 */
.menu-title {
    flex: 1;
}

/* 箭头图标 */
.arrow-icon {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.menu-item.expanded .arrow-icon {
    transform: rotate(180deg);
    color: #fff;
}

/* 二级子菜单 */
.submenu {
    list-style: none;
    background-color: #111827; /* 子菜单背景更深，突出层级 */
    display: none;
}

.submenu li a {
    display: block;
    padding: 10px 16px 10px 44px; /* 左侧大缩进，体现层级 */
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

/* 子菜单激活态 */
.submenu li a.active {
    color: #fff;
    background-color:#2857ae;
    font-weight: 500;
}

/* 子菜单悬停态 */
.submenu li a:hover {
    color: #ffffff;
    background-color: #1f2937;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        left: -60px;
    }

    .sidebar.open {
        left: 0;
    }

    .menu-title, .arrow-icon {
        display: none;
    }

    .menu-link {
        justify-content: center;
    }

    .iconfont {
        margin-right: 0;
    }

    .submenu {
        position: absolute;
        left: 100%;
        top: 0;
        width: 180px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}