/* 状态颜色 */
.status-not-uploaded { color: #dc3545; font-weight: 600; }
.status-uploaded { color: #198754; font-weight: 600; }
.status-failed { color: #ffc107; font-weight: 600; }
.status-vendor-not-uploaded { color: #dc3545; font-weight: 600; }
.status-vendor-called { color: #0dcaf0; font-weight: 600; }
.status-vendor-uploaded { color: #198754; font-weight: 600; }
.status-vendor-failed { color: #ffc107; font-weight: 600; }
.status-vendor-queued { color: #6c757d; font-weight: 600; }

/* 统计卡片样式 */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

/* 特殊颜色的统计卡片 */
.stat-card.success { background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%); }
.stat-card.warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card.info { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.danger { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

/* 表格样式优化 */
.table-container {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 表格内容优化 */
.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

/* 确保文本不会被截断 */
.table th, .table td {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.vendor-data-cell, .json-cell {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 4px 8px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vendor-data-cell:hover, .json-cell:hover {
    background: #e9ecef;
}

/* 线程池监控特殊样式 */
.thread-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}
.thread-card.warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.thread-card.danger { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }

/* 移动端全屏优化 */
@media (max-width: 768px) {
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    .container-fluid { 
        padding: 0.5rem !important; 
        max-width: 100vw !important;
        margin: 0 !important;
        width: 100vw !important;
    }
    .stat-number { font-size: 1.8rem; }
    .display-5 { font-size: 1.5rem; }
    .table-responsive { 
        border-radius: 8px; 
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem; /* 扩展到屏幕边缘 */
    }
    
    /* 移动端表格优化 - 确保每列都有足够宽度 */
    .table { 
        min-width: 1200px; /* 调整回合适的宽度，因为任务ID列现在使用缩略显示 */
        white-space: nowrap;
    }
    
    /* 移动端列宽优化 */
    .table th, .table td {
        padding: 0.4rem 0.2rem !important;
        font-size: 0.65rem !important;
        vertical-align: middle;
        text-align: center;
    }
    
    /* 确保各列有合适的最小宽度 */
    .col-basic { min-width: 80px !important; }
    .col-status { min-width: 65px !important; }
    .col-time { min-width: 85px !important; }
    .col-vendor { min-width: 75px !important; }
    .col-trace { min-width: 85px !important; }
    
    /* 任务ID列在移动端的特殊处理 */
    .task-id-cell {
        min-width: 120px !important; /* 移动端使用缩略显示，不需要太宽 */
        max-width: 140px !important;
        font-size: 0.6rem !important;
        padding: 0.3rem 0.15rem !important;
        line-height: 1.3 !important;
        white-space: normal !important;
    }
    
    .task-id-cell code {
        font-size: 0.6rem !important;
        line-height: 1.2;
        word-break: break-all;
        display: block;
        white-space: normal;
    }
    
    .task-id-short {
        font-weight: 600;
        color: #0d6efd !important;
    }
    
    /* 移动端点击提示 */
    .task-id-cell small {
        margin-top: 0.2rem;
        font-size: 0.45rem !important;
        color: #6c757d !important;
    }
    
    /* 移动端不隐藏任何列，通过滑动查看 */
    .d-none, .d-md-table-cell, .d-lg-table-cell, .d-xl-table-cell {
        display: table-cell !important;
    }
    
    /* 隐藏移动端不重要的列 */
    .d-none-mobile { display: none !important; }
    
    /* 移动端卡片间距调整 */
    .card { margin-bottom: 0.5rem !important; }
    .card-body { padding: 0.5rem !important; }
    
    /* 移动端按钮组优化 */
    .btn-group { 
        flex-direction: column; 
        width: 100%;
    }
    .btn-group .btn { 
        margin-bottom: 2px; 
        width: 100%;
    }
    
    /* 移动端表单优化 */
    .row.g-2 { margin: 0 -0.25rem; }
    .row.g-2 > * { padding: 0 0.25rem; }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.25rem !important;
    }
    
    .btn-group { flex-direction: column; }
    .btn-group .btn { margin-bottom: 2px; }
    
    /* 超小屏幕下的表格优化 */
    .table-responsive {
        margin: 0 -0.25rem;
        border-radius: 0;
    }
    
    /* 超小屏幕下的卡片优化 */
    .card {
        border-radius: 0.5rem;
        margin-bottom: 0.25rem !important;
    }
    
    /* 超小屏幕下的统计卡片 */
    .row.g-2 { margin: 0 -0.125rem; }
    .row.g-2 > * { padding: 0 0.125rem; }
    
    /* 页面标题优化 */
    .card-body.text-white h4 {
        font-size: 1.1rem;
    }
    .card-body.text-white p {
        font-size: 0.7rem;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 任务ID列特殊样式 */
.task-id-cell {
    min-width: 200px !important;
    max-width: 280px !important;
    word-break: break-all;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    white-space: normal !important;
    line-height: 1.3;
    padding: 0.4rem 0.2rem !important;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-id-cell:hover {
    background-color: #e3f2fd;
}

.task-id-cell code {
    background: transparent;
    padding: 0;
    font-size: 0.65rem;
    color: #0d6efd;
    word-break: break-all;
    white-space: normal;
    display: block;
    line-height: 1.2;
    /* 确保UUID能够在合适的位置换行 */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.task-id-full {
    font-size: 0.6rem !important;
}
.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
}

.badge-xs {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
}

.table-sm td {
    padding: 0.25rem 0.4rem;
    vertical-align: middle;
}

.table-sm th {
    padding: 0.4rem 0.4rem;
    font-size: 0.8rem;
}

/* 水平滚动条样式 */
.horizontal-scroll-indicator {
    display: none;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #dee2e6;
    z-index: 1020;
    padding: 0.5rem;
    text-align: center;
    backdrop-filter: blur(5px);
}

.scroll-indicator {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    position: relative;
    margin: 0 auto;
    width: 200px;
}

.scroll-thumb {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    position: absolute;
    top: 0;
    transition: left 0.1s ease;
    min-width: 20px;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.scroll-hint {
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .horizontal-scroll-indicator {
        display: block;
        padding: 0.75rem;
    }
    
    .scroll-hint {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .scroll-indicator {
        height: 10px;
        width: 250px;
    }
}

/* 移动端列切换器 - 已移除，改用水平滚动 */

@media (max-width: 768px) {
    .horizontal-scroll-indicator {
        display: block;
    }
    
    body {
        padding-bottom: 20px; /* 减少底部padding，因为不需要列切换器 */
    }
    
    /* 在移动端显示所有列，但通过水平滚动查看 */
    .col-status, .col-time, .col-vendor, .col-trace {
        display: table-cell !important;
    }
}