* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background-color: #1a1f2e;
    color: #fff;
    flex-shrink: 0;
}

.logo {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu {
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    gap: 12px;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background-color: #3b82f6;
    color: #fff;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    overflow-x: hidden;
}

.header {
    background-color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.admin-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #6b7280;
}

/* 统计区域 */
.stats-section {
    padding: 20px 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.stats-grid.secondary {
    margin-bottom: 0;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.stat-change {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 14px;
    font-weight: 500;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.stat-change.stable {
    color: #10b981;
}

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

.stat-icon {
    font-size: 24px;
}

.stat-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* 智能体区域 */
.agents-section {
    padding: 0 24px 24px;
}

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

.agents-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.refresh-btn {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.agent-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.agent-card:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.agent-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.agent-status {
    font-size: 13px;
    color: #6b7280;
}

.agent-status.online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    margin-right: 6px;
}

.agent-status.offline::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
    margin-right: 6px;
}

.agent-status.maintenance::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    margin-right: 6px;
}

.agent-stats {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Loading状态 */
.loading .stat-value,
.loading .stat-change,
.loading .agents-header h2 {
    color: transparent;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.loading .stat-value {
    display: inline-block;
    min-width: 80px;
    height: 32px;
}

.loading .stat-change {
    position: absolute;
    top: 20px;
    right: 20px;
    min-width: 60px;
    height: 20px;
}

.loading .agents-header h2 {
    display: inline-block;
    min-width: 180px;
    height: 22px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
