/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航栏 */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-brand i {
    margin-right: 10px;
    color: #3498db;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 500;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.user-btn:hover {
    background: rgba(255,255,255,0.2);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 150px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 5px;
    display: none;
    z-index: 1001;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-menu a:hover {
    background: #f5f7fa;
}

.dropdown-menu a i {
    margin-right: 8px;
    width: 20px;
    color: #3498db;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

/* 主容器 */
.container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid #e1e5eb;
    padding: 20px 0;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    z-index: 999;
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-details h4 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.role {
    font-size: 0.85rem;
    color: #7f8c8d;
    background: #f5f7fa;
    padding: 2px 8px;
    border-radius: 10px;
}

.menu {
    list-style: none;
    padding: 20px 0;
}

.menu li {
    margin-bottom: 5px;
}

.menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.menu li a:hover {
    background: #f5f7fa;
    color: #3498db;
}

.menu li.active a {
    background: #3498db;
    color: white;
    border-left: 4px solid #2980b9;
}

.menu li a i {
    width: 25px;
    margin-right: 10px;
    font-size: 1.1rem;
}

.badge {
    background: #e74c3c;
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.badge.alert {
    background: #f39c12;
}

.menu-divider {
    padding: 15px 20px 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.system-status {
    padding: 20px;
    border-top: 1px solid #e1e5eb;
    margin-top: auto;
}

.status-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.status-label {
    color: #7f8c8d;
    margin-right: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.active {
    background: #2ecc71;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.mini {
    cursor: pointer;
    padding: 15px;
}

.stat-card.mini:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 内容区域 */
.content-wrapper {
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5eb;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.section-header h2 i {
    margin-right: 10px;
    color: #3498db;
}

/* 图表容器 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.chart-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5eb;
}

.chart-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.chart-body {
    padding: 20px;
    height: 300px;
}

/* 表格容器 */
.tables-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.table-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.table-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.table-body {
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e5eb;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e1e5eb;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* 表单样式 */
.form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group label .required {
    color: #e74c3c;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5eb;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn i {
    font-size: 0.9rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* 警告框 */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d5edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 状态徽章 */
.status-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.success {
    background: #d5edda;
    color: #155724;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.status-badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.primary {
    background: #d6eaf8;
    color: #21618c;
}

.status-badge.low {
    background: #fdebd0;
    color: #ba4a00;
}

.status-badge.normal {
    background: #d5edda;
    color: #1e8449;
}

.status-badge.high {
    background: #d6eaf8;
    color: #21618c;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    color: #2c3e50;
    margin: 0;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
}

/* 搜索输入框 */
.search-input {
    width: 300px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 活动列表 */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 15px;
    border-bottom: 1px solid #e1e5eb;
    display: flex;
    align-items: center;
    gap: 15px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.text-success {
    color: #2ecc71;
}

.text-danger {
    color: #e74c3c;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.activity-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* 信息卡片 */
.info-card {
    background: white;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

.info-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5eb;
}

.info-header h4 {
    color: #2c3e50;
    margin: 0;
}

.info-header h4 i {
    margin-right: 10px;
    color: #3498db;
}

.info-body {
    padding: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.info-value {
    font-weight: 500;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .user-details,
    .sidebar .menu span,
    .sidebar .menu-divider,
    .sidebar .system-status {
        display: none;
    }
    
    .sidebar .menu li a {
        justify-content: center;
        padding: 15px;
    }
    
    .sidebar .menu li a i {
        margin: 0;
        font-size: 1.3rem;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-container,
    .tables-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 10px;
    }
    
    .nav-brand h1 {
        font-size: 1.2rem;
    }
    
    .user-name {
        display: none;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}