/* 服务器监控显示样式 */

/* 基础样式 */
.servers-list-container,
.single-server-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 登录提示 */
.servers-login-prompt {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #856404;
    font-size: 16px;
}

/* 错误提示 */
.servers-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #721c24;
    font-size: 16px;
}

/* 无结果提示 */
.servers-no-results {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #0c5460;
    font-size: 18px;
}

/* 服务器网格布局 */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .servers-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .servers-list-container,
    .single-server-container {
        padding: 10px;
    }
}

/* 服务器卡片 */
.server-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 服务器头部 */
.server-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.server-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* 状态指示器 */
.server-status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.server-status-indicator.normal {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.server-status-indicator.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.server-status-indicator.critical {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.server-status-indicator.unknown {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* 服务器统计 */
.server-stats {
    margin-bottom: 15px;
}

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

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    color: #495057;
    font-weight: 600;
}

/* 更新时间 */
.server-update-time {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

/* 无数据提示 */
.server-no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px 0;
}

/* 服务器操作 */
.server-actions {
    text-align: center;
}

.server-details-btn {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.server-details-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* 分页样式 */
.servers-pagination {
    text-align: center;
    margin-top: 30px;
}

.servers-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #007cba;
    transition: all 0.3s ease;
}

.servers-pagination .page-numbers.current,
.servers-pagination .page-numbers:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.servers-pagination .page-numbers.dots {
    border: none;
    color: #6c757d;
}

/* 单个服务器页面样式 */
.server-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.server-info-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
}

.back-to-list {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-list:hover {
    color: #005a87;
}

/* 图表区域 */
.server-charts-container {
    display: grid;
    gap: 30px;
}

.chart-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 进程监控表格 */
.processes-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.processes-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.processes-table-container {
    overflow-x: auto;
}

.processes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.processes-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.processes-table tr:hover {
    background: #f8f9fa;
}

/* 进程状态 */
.process-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.process-status.active {
    background: #d4edda;
    color: #155724;
}

.process-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .server-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .server-info-header h1 {
        font-size: 24px;
    }
    
    .chart-section,
    .processes-section {
        padding: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .processes-table {
        font-size: 12px;
    }
    
    .processes-table th,
    .processes-table td {
        padding: 8px 10px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .server-card,
    .chart-section,
    .processes-section {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .server-title,
    .chart-section h3,
    .processes-section h3 {
        color: #e2e8f0;
    }
    
    .stat-label,
    .server-update-time {
        color: #a0aec0;
    }
    
    .servers-pagination .page-numbers {
        border-color: #4a5568;
        color: #63b3ed;
    }
    
    .servers-pagination .page-numbers.current,
    .servers-pagination .page-numbers:hover {
        background: #63b3ed;
        color: #1a202c;
    }
}