/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar-light-blue {
    background-color: #007bff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    padding: 15px 20px;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.1);
}

/* 浅绿色表头样式 */
.table-light-green thead {
    background-color: #d4edda !important;
}

.table-light-green thead th {
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
    font-weight: 600;
}

/* 特定列的浅绿色背景 */
.table-light-green tbody tr td:nth-child(1),  /* ID列 */
.table-light-green tbody tr td:nth-child(2),  /* 主队名列 */
.table-light-green tbody tr td:nth-child(3) { /* 客队名列 */
    background-color: #f8fff9 !important;
    border-color: #e8f5e9 !important;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

/* 按钮样式 */
.btn {
    border-radius: 5px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* 标签页样式 */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: #495057;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border: none;
    border-bottom: 3px solid #007bff;
    font-weight: 600;
}

/* 日期选择器样式 */
.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-selector .form-label {
    margin-bottom: 0;
    font-weight: 500;
}

.date-selector .form-control {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 6px 12px;
}

.date-selector .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 图表容器样式 */
canvas {
    max-width: 100%;
    height: 300px !important;
}

/* 模态框样式 */
.modal-content {
    border-radius: 10px;
    border: none;
}

.modal-header {
    border-radius: 10px 10px 0 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* 页脚样式 */
footer {
    margin-top: 40px;
    border-top: 1px solid #dee2e6;
}

footer h5 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 600;
}

footer p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 10px;
}

/* 响应式调整 - 移动端适配 */
@media (max-width: 768px) {
    /* 导航栏调整 */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    /* 卡片标题调整 */
    .card-title {
        font-size: 1.25rem;
    }
    
    /* 日期选择器调整 */
    .date-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-top: 10px;
    }
    
    .date-selector .form-control {
        width: 100% !important;
        max-width: 200px;
    }
    
    /* 表格调整 - 增强移动端适配 */
    .table-responsive {
        font-size: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .table th, .table td {
        padding: 0.4rem;
        white-space: nowrap;
        min-width: 60px;
    }
    
    /* 操作按钮调整 */
    .btn-sm {
        padding: 4px 6px;
        font-size: 0.65rem;
        margin-bottom: 3px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 标签页调整 */
    .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* 模态框调整 */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-xl {
        max-width: calc(100% - 1rem);
    }
    
    .modal-lg {
        max-width: calc(100% - 1rem);
    }
    
    .modal-fullscreen {
        padding: 0;
    }
    
    /* 图表容器调整 */
    .chart-container {
        height: 300px !important;
    }
    
    /* 页脚调整 */
    footer .row {
        flex-direction: column;
    }
    
    footer .col-md-6 {
        margin-bottom: 20px;
    }
    
    /* 隐藏更多表格列以节省空间 */
    .matches-table th:nth-child(4),  /* 胜赔率 */
    .matches-table td:nth-child(4),
    .matches-table th:nth-child(5),  /* 平赔率 */
    .matches-table td:nth-child(5),
    .matches-table th:nth-child(6),  /* 负赔率 */
    .matches-table td:nth-child(6),
    .matches-table th:nth-child(7),  /* 主胜凯利方差 */
    .matches-table td:nth-child(7),
    .matches-table th:nth-child(8),  /* 平凯利方差 */
    .matches-table td:nth-child(8),
    .matches-table th:nth-child(9),  /* 负凯利方差 */
    .matches-table td:nth-child(9),
    .matches-table th:nth-child(10), /* 亚盘主队水位 */
    .matches-table td:nth-child(10),
    .matches-table th:nth-child(11), /* 亚盘让球数 */
    .matches-table td:nth-child(11),
    .matches-table th:nth-child(12), /* 亚盘客队水位 */
    .matches-table td:nth-child(12) {
        display: none;
    }
    
    /* 操作列优化 - 防止重叠 */
    .matches-table td:last-child {
        min-width: 120px;
        max-width: 120px;
        position: sticky;
        right: 0;
        background-color: #fff;
        z-index: 1;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }
    
    .matches-table td:last-child .btn {
        display: block;
        width: 100%;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .matches-table td:last-child .btn:last-child {
        margin-bottom: 0;
    }
    
    /* 确保表格行有足够高度容纳按钮 */
    .matches-table tr {
        min-height: 120px;
    }
    
    /* 简化表头文本 */
    .matches-table th:nth-child(1)::after {
        content: "ID";
    }
    
    .matches-table th:nth-child(1) span {
        display: none;
    }
    
    .matches-table th:nth-child(2)::after {
        content: "主队";
    }
    
    .matches-table th:nth-child(2) span {
        display: none;
    }
    
    .matches-table th:nth-child(3)::after {
        content: "客队";
    }
    
    .matches-table th:nth-child(3) span {
        display: none;
    }
    
    .matches-table th:nth-child(13)::after {
        content: "时间";
    }
    
    .matches-table th:nth-child(13) span {
        display: none;
    }
    
    .matches-table th:last-child::after {
        content: "操作";
    }
    
    .matches-table th:last-child span {
        display: none;
    }
}

/* 超小屏幕调整 */
@media (max-width: 576px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .card {
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .card-header {
        padding: 8px 12px;
    }
    
    .card-header h4 {
        font-size: 1rem;
    }
    
    /* 进一步优化表格布局 */
    .table-responsive {
        font-size: 0.7rem;
        border: 1px solid #dee2e6;
        border-radius: 5px;
    }
    
    .table th, .table td {
        padding: 0.3rem;
        min-width: 50px;
    }
    
    /* 在超小屏幕上只显示最关键列 */
    .matches-table th:nth-child(1),  /* ID */
    .matches-table td:nth-child(1),
    .matches-table th:nth-child(2),  /* 主队 */
    .matches-table td:nth-child(2),
    .matches-table th:nth-child(3),  /* 客队 */
    .matches-table td:nth-child(3),
    .matches-table th:nth-child(13), /* 时间 */
    .matches-table td:nth-child(13),
    .matches-table th:last-child,    /* 操作 */
    .matches-table td:last-child {
        display: table-cell;
    }
    
    /* 隐藏所有其他列 */
    .matches-table th:nth-child(4),
    .matches-table td:nth-child(4),
    .matches-table th:nth-child(5),
    .matches-table td:nth-child(5),
    .matches-table th:nth-child(6),
    .matches-table td:nth-child(6),
    .matches-table th:nth-child(7),
    .matches-table td:nth-child(7),
    .matches-table th:nth-child(8),
    .matches-table td:nth-child(8),
    .matches-table th:nth-child(9),
    .matches-table td:nth-child(9),
    .matches-table th:nth-child(10),
    .matches-table td:nth-child(10),
    .matches-table th:nth-child(11),
    .matches-table td:nth-child(11),
    .matches-table th:nth-child(12),
    .matches-table td:nth-child(12) {
        display: none;
    }
    
    /* 进一步优化操作列 */
    .matches-table td:last-child {
        min-width: 100px;
        max-width: 100px;
        position: sticky;
        right: 0;
        background-color: #fff;
        z-index: 2;
        box-shadow: -2px 0 5px rgba(0,0,0,0.15);
    }
    
    .matches-table td:last-child .btn {
        padding: 3px 5px;
        font-size: 0.6rem;
        margin-bottom: 3px;
        min-height: 28px;
    }
    
    .matches-table td:last-child .btn i {
        font-size: 0.7rem;
        margin-right: 2px;
    }
    
    /* 简化按钮文本 */
    .matches-table td:last-child .btn .btn-text {
        display: inline;
    }
    
    /* 确保表格行高度 */
    .matches-table tr {
        min-height: 100px;
    }
    
    /* 图表标签页调整 */
    .nav-tabs .nav-link {
        padding: 5px 6px;
        font-size: 0.7rem;
    }
    
    /* 趋势图模态框中的表格调整 */
    #chartContainer .table-responsive {
        font-size: 0.6rem;
    }
    
    #chartContainer .table th,
    #chartContainer .table td {
        padding: 0.2rem;
    }
    
    /* 日期选择器进一步优化 */
    .date-selector {
        margin-top: 5px;
    }
    
    .date-selector .form-control {
        max-width: 150px;
        font-size: 0.8rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    /* 增加触摸目标大小 */
    .nav-link {
        padding: 12px 16px;
    }
    
    /* 禁用悬停效果 */
    .card:hover {
        transform: none;
    }
    
    .table-hover tbody tr:hover {
        background-color: inherit;
    }
    
    /* 移动端表格触摸优化 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    .matches-table td:last-child {
        min-width: 130px;
    }
    
    .matches-table td:last-child .btn {
        min-height: 40px;
        padding: 8px 10px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .table {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-active {
    background-color: #28a745;
}

.status-inactive {
    background-color: #dc3545;
}

.status-pending {
    background-color: #ffc107;
}
