/* 分析页面样式 */

/* 主内容区域最大宽度限制，居中自适应 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
}

/* 任务表格、卡片区域自适应宽度 */
.file-list-container,
.analysis-list,
.task-group,
.file-list {
  width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

/* 图片、按钮、文本等内容自适应缩放 */
.task-thumbnail,
.analysis-result-item img {
  max-width: 120px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 让表格内容自动换行，避免撑破页面 */
.analysis-list-header > div,
.analysis-task-item > div,
.analysis-result-item > div {
  word-break: break-all;
  white-space: normal;
  min-width: 0;
}

/* 分析状态区域 */
.analysis-status {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.analysis-status h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.analysis-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.analysis-summary {
    font-size: 14px;
    color: #666;
}

.task-stats {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.analysis-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.analysis-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.start-all-analysis-btn {
    background: #28a745;
    color: white;
}

.start-all-analysis-btn:hover {
    background: #218838;
}

.pause-all-analysis-btn {
    background: #ffc107;
    color: #212529;
}

.pause-all-analysis-btn:hover {
    background: #e0a800;
}

.cancel-all-analysis-btn {
    background: #dc3545;
    color: white;
}

.cancel-all-analysis-btn:hover {
    background: #c82333;
}

.cleanup-btn {
    background: #6c757d;
    color: white;
}

.cleanup-btn:hover {
    background: #5a6268;
}

.refresh-btn {
    background: #17a2b8;
    color: white;
}

.refresh-btn:hover {
    background: #138496;
}

/* 分析任务列表 */
.analysis-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.analysis-task-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-top: none;
    align-items: center;
    transition: background-color 0.2s;
}

.analysis-task-item:hover {
    background: #f8f9fa;
}

.analysis-task-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* 任务组样式 */
.task-group-header {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    border: 1px solid #e9ecef;
    border-bottom: none;
    margin-top: 20px;
}

.task-group-header:first-child {
    margin-top: 0;
}

.task-group {
    border: 1px solid #e9ecef;
    border-radius: 0 0 6px 6px;
    margin-bottom: 20px;
}

.task-group .analysis-task-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* 任务图片区域 */
.task-image {
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.task-time {
    font-size: 11px;
    color: #666;
    font-weight: normal;
}

/* 任务状态 */
.task-status {
    display: flex;
    justify-content: center;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

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

.status-analyzing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    animation: pulse 2s infinite;
}

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

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

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

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

/* 进度条 */
.task-progress {
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-width: 80px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

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

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    display: none;
}

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

.empty-state .title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.empty-state .description {
    font-size: 14px;
    margin-bottom: 20px;
}

/* 分析结果详情样式 */
.analysis-result-detail {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: relative;
}

.result-detail-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-detail-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.result-detail-item {
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
}

.result-detail-item:last-child {
    border-bottom: none;
}

.result-detail-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.result-number {
    font-weight: 600;
    color: #007bff;
    font-size: 14px;
}

.result-time {
    font-size: 12px;
    color: #666;
}

.result-detail-desc {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.result-detail-objects {
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.result-object-item {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #28a745;
}

.object-name {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.object-confidence {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
}

.object-desc {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* 分析结果项样式 */
.analysis-result-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-top: none;
    align-items: center;
    transition: background-color 0.2s;
}

.analysis-result-item:hover {
    background: #f8f9fa;
}

.analysis-result-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* 分析任务表格列宽拖拽手柄样式 */
.analysis-list-header .resizer {
  display: inline-block;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  margin-left: 2px;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
}
.analysis-list-header > div {
  position: relative;
  min-width: 60px;
  /* 允许宽度被JS动态设置 */
  transition: background 0.2s;
}
.analysis-list-header .resizer:hover {
  background: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .analysis-list-header,
    .analysis-task-item,
    .analysis-result-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .analysis-list-header {
        display: none;
    }
    
    .analysis-task-item,
    .analysis-result-item {
        padding: 15px;
        border-radius: 6px;
        margin-bottom: 10px;
        border: 1px solid #e9ecef;
    }
    
    .task-image {
        justify-content: center;
    }
    
    .task-actions {
        justify-content: center;
    }
    
    .analysis-progress-info {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analysis-actions {
        justify-content: center;
    }
    
    .result-detail-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .result-detail-title {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
} 