/* 全局样式 */
body {
    background-color: #f8f9fa;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* 表格样式 */
.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* 进度条样式 */
.progress {
    background-color: #e9ecef;
}

.progress-bar {
    font-weight: 600;
    line-height: 25px;
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
}

/* 警告框样式 */
.alert {
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #e7f3ff;
    border-color: #b3d7ff;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* 代码样式 */
pre {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

pre code {
    color: #495057;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 空状态样式 */
.empty-state {
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.775rem;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 报告页面特殊样式 */
.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.report-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.report-section {
    margin-bottom: 2rem;
}

.code-block {
    max-height: 500px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-success {
    background-color: #28a745;
}

.status-warning {
    background-color: #ffc107;
}

.status-danger {
    background-color: #dc3545;
}

.status-info {
    background-color: #17a2b8;
}

/* 移动端适配 - 添加到 style.css 文件末尾 */
@media (max-width: 768px) {
    /* 搜索表单优化 */
    #searchForm .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* 表格响应式处理 */
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    .table {
        min-width: 700px; /* 确保表格有最小宽度，可以横向滚动 */
        margin-bottom: 0;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    /* 按钮组优化 */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem !important;
    }
    
    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Badge 优化 */
    .badge {
        font-size: 0.75rem;
        padding: 0.25em 0.4em;
    }
    
    /* 分页优化 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin: 0.125rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .table {
        font-size: 0.75rem;
    }
    
    .btn-group .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
}

/* 结果表：比赛名称收窄，报告操作和重新生成保持单行。 */
.results-table .contest-name-column {
    width: 10rem;
    max-width: 10rem;
}

.results-table .contest-name-text {
    display: block;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table .result-actions,
.results-table .result-regenerate,
.results-table .result-actions .btn,
.results-table .result-regenerate .btn {
    white-space: nowrap;
}

.results-table .result-actions .btn-group {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: auto;
}

.results-table .result-actions .btn {
    margin-bottom: 0;
}
