/* GPU列表 */
.gpu-list {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.gpu-card {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.gpu-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.gpu-card.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.gpu-name {
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-block;
    vertical-align: middle; 
}

.gpu-status {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
    display: inline-block;
    vertical-align: middle; 
}

.gpu-status.available {
    background-color: #d1fae5;
    color: #065f46;
}

.gpu-status.disabled {
    background-color: #fee2e2;
    color: #991b1b;
}

.gpu-status.busy {
    background-color: #fed7aa;
    color: #9a3412;
}

.gpu-switch {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    float: right;
    font-size: 0.9rem;
    display: none;
}

.gpu-card:hover .gpu-switch {
    display: block;
}

.gpu-switch:hover {
    background-color: #1d4ed8;
}

.gpu-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 0.9rem;
}

.progress-bar-container {
    position: flex;
    display: inline-block;
}

.progress-bar-text {
    position: flex;
    font-size: 13px;
    font-weight: 500;
    color: #4c505a;
    pointer-events: none;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background-color: #e3e3e3;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 4px;
}

.progress-bar-fill.warning {
    background-color: #f59e0b;
}

.progress-bar-fill.danger {
    background-color: #ef4444;
}

/* 右侧内容区 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
    gap: 15px;
}

.gpu-details, .gpu-tasks, .processes {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.details-info {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.detail-item {
    background-color: #f9fafb;
    padding: 12px;
    border-radius: 6px;
}

.detail-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 任务列表 */
.tasks-list {
    padding: 15px;
}

.task-card {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.task-status.running {
    background-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.task-status.completed {
    background-color: #3b82f6;
}

.task-status.failed {
    background-color: #ef4444;
}

.task-status.killed {
    background-color: #6b7280;
}

.task-info {
    flex: 1;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.task-id {
    font-weight: 600;
}

.task-task-id {
    color: #6b7280;
    font-size: 0.6rem;
    background-color: #d0d0d0;
    border-radius: 40px;
    padding: 1px 6px;
}

.task-command {
    color: #4b5563;
    font-size: 0.9rem;
    font-family: monospace;
    background-color: #f3f4f6;
    padding: 5px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.task-actions button {
    background-color: #2563eb;
    border: none;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.task-actions button:hover {
    background-color: #ffa5a5;
}

.task-actions button.kill {
    color: #ffffff;
}

.task-actions button.kill:hover {
    color: #ff0000;
}

/* 进程表格 */
.table-container {
    padding: 15px;
    overflow-x: auto;
    max-width: 100%;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px;
}

th, td {
    text-align: left;
    padding: 10px 15px;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #4b5563;
}

tbody tr:hover {
    background-color: #f9fafb;
}

.process-status {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.process-status.running {
    background-color: #d1fae5;
    color: #065f46;
}

.process-status.completed {
    background-color: #dbeafe;
    color: #1e40af;
}

.process-status.failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.process-status.killed {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* 设置各列的宽度 */
th:nth-child(1), td:nth-child(1) { width: 80px; }
th:nth-child(2), td:nth-child(2) { width: 90px; }
th:nth-child(3), td:nth-child(3) { width: 100px; }
th:nth-child(4), td:nth-child(4) { width: 80px; }
th:nth-child(5), td:nth-child(5) { width: 80px; }
th:nth-child(6), td:nth-child(6) { width: 80px; }
th:nth-child(7), td:nth-child(7) { width: 190px; }
th:nth-child(8), td:nth-child(8) { width: 100px; }
th:nth-child(9), td:nth-child(9) { width: 500px; }

/* 命令列可以在必要时允许文本换行 */
.command {
    white-space: normal;
    word-break: break-word;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .details-info {
        grid-template-columns: 1fr;
    }
}