/* ============================================
   任务管理样式 - 优化版
   ============================================ */

/* 统计概览卡片 */
.tasks-stats-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-wrap: wrap;
}

.tasks-stats-bar .stat-card {
    flex: 1;
    min-width: 100px;
    max-width: 160px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tasks-stats-bar .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tasks-stats-bar .stat-card .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.tasks-stats-bar .stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 状态色带 */
.tasks-stats-bar .stat-card.stat-pending {
    border-top: 3px solid #faad14;
}

.tasks-stats-bar .stat-card.stat-running {
    border-top: 3px solid #1890ff;
}

.tasks-stats-bar .stat-card.stat-completed {
    border-top: 3px solid #52c41a;
}

.tasks-stats-bar .stat-card.stat-warning {
    border-top: 3px solid #fa8c16;
}

.tasks-stats-bar .stat-card.stat-failed {
    border-top: 3px solid #f5222d;
}

/* 任务列表头部 */
#subtab-tasks-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

#subtab-tasks-panel .panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

#subtab-tasks-panel .panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 批量删除按钮 */
#btn-batch-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    transition: all 0.2s;
}

#btn-batch-delete .btn-icon {
    font-size: 14px;
}

/* 状态筛选下拉框 */
.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-white);
    min-width: 120px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 表格容器 */
.tasks-table-container {
    padding: 0;
    overflow-x: auto;
}

/* 任务表格 */
.tasks-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tasks-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.tasks-table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

/* 列宽定义 */
.tasks-table .checkbox-col {
    width: 40px;
    text-align: center;
}

.tasks-table .checkbox-col input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.tasks-table .status-col {
    width: 90px;
}

.tasks-table .info-col {
    width: auto;
    min-width: 200px;
}

.tasks-table .model-col {
    width: 140px;
}

.tasks-table .time-col {
    width: 150px;
    color: var(--text-secondary);
    font-size: 12px;
}

.tasks-table .duration-col {
    width: 70px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.tasks-table .actions-col {
    width: 120px;
    text-align: center;
}

/* 任务信息单元格 */
.task-info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-info-cell .task-desc {
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.4;
}

.task-info-cell .task-id {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

/* 模型单元格 */
.model-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-cell .model-id {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.model-cell .eval-date {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.pending {
    background: #fff7e6;
    color: #d46b08;
}

.status-badge.pending::before {
    background: #faad14;
    animation: pulse 1.5s infinite;
}

.status-badge.running {
    background: #e6f7ff;
    color: #096dd9;
}

.status-badge.running::before {
    background: #1890ff;
    animation: pulse 1s infinite;
}

.status-badge.completed {
    background: #f6ffed;
    color: #389e0d;
}

.status-badge.completed::before {
    background: #52c41a;
}

.status-badge.warning {
    background: #fff7e6;
    color: #d46b08;
}

.status-badge.warning::before {
    background: #fa8c16;
}

.status-badge.failed {
    background: #fff1f0;
    color: #cf1322;
}

.status-badge.failed::before {
    background: #f5222d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 操作按钮 */
.task-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.task-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s;
    animation: progress-stripes 1s linear infinite;
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

@keyframes progress-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* 分页栏 */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-current {
    font-size: 13px;
    color: var(--text-color);
}

/* 空状态 */
.tasks-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.tasks-empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tasks-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* 表格行交互 */
.tasks-table tbody tr {
    transition: background 0.15s;
}

.tasks-table tbody tr:hover {
    background: #f5f5f5;
}

.tasks-table tbody tr.selected {
    background: #e6f7ff;
}

.tasks-table tbody tr.selected:hover {
    background: #d9f0ff;
}

/* ============================================
   导出步骤进度追踪器
   ============================================ */

.export-step-tracker {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.export-step-tracker .step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.export-step-tracker .step-header.step-completed {
    background: #f6ffed;
    border-color: #b7eb8f;
}

.export-step-tracker .step-header.step-running {
    background: #e6f7ff;
    border-color: #91d5ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}

.export-step-tracker .step-header.step-failed {
    background: #fff2f0;
    border-color: #ffccc7;
}

.export-step-tracker .step-header.step-pending {
    background: #fafafa;
    border-color: #e8e8e8;
    opacity: 0.6;
}

/* 步骤图标 */
.export-step-tracker .step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s;
}

.step-pending .step-icon {
    background: #e8e8e8;
    color: #bfbfbf;
}

.step-running .step-icon {
    background: #1890ff;
    color: #fff;
    animation: step-pulse 1.2s infinite;
}

.step-completed .step-icon {
    background: #52c41a;
    color: #fff;
}

.step-failed .step-icon {
    background: #f5222d;
    color: #fff;
}

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(24, 144, 255, 0); }
}

/* 步骤信息 */
.export-step-tracker .step-info {
    flex: 1;
    min-width: 0;
}

.export-step-tracker .step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
}

.export-step-tracker .step-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.step-completed .step-label { color: #389e0d; }
.step-failed .step-label { color: #cf1322; }
.step-running .step-label { color: #096dd9; }

/* 步骤耗时 */
.export-step-tracker .step-time {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 总进度条 */
.export-progress-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.export-progress-summary .progress-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.export-progress-summary .progress-text.status-completed { color: #389e0d; }
.export-progress-summary .progress-text.status-failed { color: #cf1322; }
.export-progress-summary .progress-text.status-running { color: #096dd9; }

.export-progress-bar {
    flex: 1;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.export-progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    background: linear-gradient(90deg, #1890ff, #52c41a);
}

.export-progress-bar .progress-fill.fill-failed {
    background: #f5222d;
}

.export-progress-bar .progress-fill.fill-completed {
    background: #52c41a;
}

.export-progress-percent {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    min-width: 36px;
    text-align: right;
}

/* ============================================
   导出记录表格
   ============================================ */

.export-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.export-history-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.export-history-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.export-history-row {
    cursor: pointer;
    transition: background 0.15s;
}

.export-history-row:hover {
    background: #f5f5f5;
}

.export-history-row.expanded {
    background: #f0f7ff;
    border-bottom: none;
}

.export-history-row .expand-icon {
    font-size: 10px;
    color: var(--text-secondary);
}

.export-history-row .btn-sm {
    padding: 3px 8px;
    font-size: 11px;
}

/* 进度详情行 */
.export-progress-row {
    display: none;
}

.export-progress-row.expanded {
    display: table-row;
}

.export-progress-row td {
    padding: 0 16px 16px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fafcff;
}

.export-progress-detail {
    max-width: 600px;
}
