/* 全局样式 */
:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-color: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-color: #f59e0b;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-color: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-color: #3b82f6;
    --info-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.card:hover {
    box-shadow: var(--card-hover-shadow);
    transform: translateY(-4px);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border-radius: 16px 16px 0 0 !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border: none;
}

/* 资源监控卡片 */
.resource-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    overflow: hidden;
}

.resource-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

.resource-card .card-body {
    padding: 1.5rem;
}

.resource-card i.display-4 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.resource-card.cpu-card i { background: var(--primary-gradient); -webkit-background-clip: text; background-clip: text; }
.resource-card.memory-card i { background: var(--success-gradient); -webkit-background-clip: text; background-clip: text; }
.resource-card.disk-card i { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); -webkit-background-clip: text; background-clip: text; }
.resource-card.disk-card .progress-bar { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.resource-card.upload-card i { background: var(--info-gradient); -webkit-background-clip: text; background-clip: text; }
.resource-card.download-card i { background: var(--warning-gradient); -webkit-background-clip: text; background-clip: text; }
.resource-card.io-read-card i { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); -webkit-background-clip: text; background-clip: text; }
.resource-card.io-write-card i { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); -webkit-background-clip: text; background-clip: text; }
.resource-card.uptime-card i { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); -webkit-background-clip: text; background-clip: text; }

.resource-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.resource-label {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 警告状态 */
.warning-high {
    background: var(--danger-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.warning-medium {
    background: var(--warning-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e5e7eb;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.progress-bar.bg-success {
    background: var(--success-gradient);
}

.progress-bar-warning, .progress-bar.bg-warning {
    background: var(--warning-gradient);
}

.progress-bar-danger, .progress-bar.bg-danger {
    background: var(--danger-gradient);
}

/* 服务器列表 */
.server-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.server-item:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    transform: scale(1.02);
}

.server-item.active {
    background: var(--primary-gradient);
    color: white;
}

/* 表单样式 */
.form-control {
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
}

.btn-outline-success {
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.btn-outline-danger {
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

/* 登录/注册页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.auth-card .card-header {
    background: transparent;
    color: var(--dark-color);
    text-align: center;
    padding: 2rem 1.5rem 1rem;
}

.auth-card .card-header h4 {
    font-weight: 700;
    font-size: 1.5rem;
}

.auth-card .card-body {
    padding: 1.5rem 2rem 2rem;
}

/* 仪表盘 */
.dashboard-header {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.dashboard-header h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.chart-card {
    border-radius: 20px;
    overflow: hidden;
}

.chart-card .card-header {
    background: white;
    color: var(--dark-color);
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* 历史数据表格 */
.history-table {
    font-size: 0.9rem;
}

.history-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.history-table td {
    vertical-align: middle;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 状态指示器 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.status-online {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-offline {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 磁盘卡片 */
.disk-item {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.disk-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* IO 卡片 */
.io-card {
    background: white;
    border-radius: 16px;
}

.io-card .card-header {
    background: transparent;
    color: var(--dark-color);
    border-bottom: 1px solid #e5e7eb;
}

/* Badge 样式 */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .resource-value {
        font-size: 1.8rem;
    }
    
    .dashboard-header h2 {
        font-size: 1.3rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .auth-card {
        margin: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* 刷新按钮动画 */
.refresh-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
