/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: white;
    border-radius: 10px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 28px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.status-indicator.online {
    background: #d4edda;
    color: #155724;
}

.status-indicator.offline {
    background: #f8d7da;
    color: #721c24;
}

.time-display {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}

/* 主要内容区 */
.main-content {
    display: flex;
    gap: 20px;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.sidebar a:hover {
    background: #f0f0f0;
    color: #333;
}

.sidebar a.active {
    background: #007bff;
    color: white;
}

/* 内容区 */
.content {
    flex: 1;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 600px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 卡片样式 */
.card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.card h3 {
    margin-bottom: 20px;
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* 状态框 */
.status-box {
    background: #f1f3f5;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.status-box p {
    margin-bottom: 10px;
    font-size: 14px;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0;
    transition: width 0.3s;
}

/* 任务列表 */
.task-list {
    margin-top: 20px;
}

.task-list h4 {
    margin-bottom: 15px;
    color: #495057;
}

.task-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.task-client {
    font-weight: 500;
}

.task-time {
    color: #6c757d;
    font-size: 13px;
}

.task-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.task-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

.task-status.success {
    background: #d4edda;
    color: #155724;
}

.task-status.warning {
    background: #fff3cd;
    color: #856404;
}

.task-status.error {
    background: #f8d7da;
    color: #721c24;
}

.task-retry {
    color: #dc3545;
    font-size: 12px;
}

/* 历史记录表格 */
.history-list {
    margin-top: 20px;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
}

#history-table th,
#history-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

#history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

#history-table tbody tr:hover {
    background: #f8f9fa;
}

/* 状态网格 */
.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.status-item {
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.status-item .label {
    color: #6c757d;
    font-size: 13px;
}

.status-item .value {
    font-size: 20px;
    font-weight: 600;
    color: #007bff;
    display: block;
    margin-top: 5px;
}

/* 日志框 */
.logs-box {
    background: #1e1e1e;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    height: 300px;
    overflow-y: auto;
}

.logs-box pre {
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .sidebar ul {
        display: flex;
        gap: 10px;
        overflow-x: auto;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .system-status {
        margin-top: 15px;
    }
}

/* 测试结果样式 */
.test-result {
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease-in;
}

.test-result.loading {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.test-result.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.test-result.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 表单提示样式 */
.form-hint {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.modal-content p {
    margin-bottom: 10px;
    color: #555;
}

.warning-text {
    color: #dc3545 !important;
    font-size: 14px;
    background: #fff3f3;
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #dc3545;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 重启遮罩层 */
.restart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    color: white;
    font-size: 18px;
}

.restart-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}