:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --info: #4895ef;
    --warning: #f72585;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fb;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    height: 100vh;
    position: fixed;
    transition: all 0.3s;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    padding: 12px 20px;
    transition: all 0.3s;
}

.sidebar-menu li.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid white;
}

.sidebar-menu li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 20px;
    transition: all 0.3s;
}

/* 顶部导航栏 */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: 30px;
    padding: 8px 15px;
    width: 300px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 8px;
}

.nav-icons {
    display: flex;
    gap: 20px;
}

.nav-icons .icon {
    position: relative;
    cursor: pointer;
}

.nav-icons .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 欢迎区域 */
.welcome-section {
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
}

.welcome-section h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.quick-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* KPI 卡片区域 */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    border-left: 4px solid var(--primary);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.kpi-card.sales {
    border-left-color: var(--primary);
}

.kpi-card.users {
    border-left-color: var(--success);
}

.kpi-card.orders {
    border-left-color: var(--info);
}

.kpi-card.revenue {
    border-left-color: var(--warning);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kpi-header i {
    font-size: 1.5rem;
    opacity: 0.7;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.kpi-change {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.kpi-change.positive {
    color: #28a745;
}

.kpi-change.negative {
    color: #dc3545;
}

/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-actions {
    display: flex;
    gap: 10px;
}

.chart-actions select {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px 10px;
    outline: none;
}

/* 动态信息区域 */
.dynamic-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.info-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-list {
    list-style: none;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-item:last-child {
    border-bottom: none;
}

.status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status.processing {
    background: #d4edda;
    color: #155724;
}

/* 系统状态区域 */
.system-status {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-header {
    display: flex;
    justify-content: space-between;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 4px;
}

.progress.safe {
    background: #28a745;
}

.progress.warning {
    background: #ffc107;
}

.progress.danger {
    background: #dc3545;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .charts-section {
        grid-template-columns: 1fr;
    }

    .dynamic-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1600px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header h2 span,
    .sidebar-menu li span {
        display: none;
    }

    .sidebar-menu li {
        text-align: center;
        padding: 15px 0;
    }

    .sidebar-menu i {
        margin-right: 0;
        font-size: 1.2rem;
    }

    .main-content {
        margin-left: 0;
    }

    .quick-actions {
        flex-wrap: wrap;
    }
}