* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab {
    padding: 20px 30px;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    color: #6c757d;
    font-weight: 500;
}

.tab:hover {
    background: #e9ecef;
    color: #495057;
}

.tab.active {
    color: #667eea;
    background: white;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    min-height: 500px;
}

.tab-content.active {
    display: block;}

/* 确保尾码详情区域可见 */
#tail-detail-section {
    display: block !important;
}

/* 修复标签页样式 */
#tail-tab-nav .nav-link {
    cursor: pointer;
    transition: all 0.3s ease;
}

#tail-tab-nav .nav-link.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* 查看按钮样式 */
.view-tail-btn {
    transition: all 0.3s ease;
}

.view-tail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tail-distribution-chart .row {
        margin-bottom: 10px;
    }

    .tail-distribution-chart .col-2 {
        flex: 0 0 auto;
        width: 20%;
    }

    .tail-distribution-chart .col-8 {
        flex: 0 0 auto;
        width: 60%;
    }

    .tail-distribution-chart .col-2 {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* 确保所有容器正确显示 */
#tail-detail-section .tab-content {
    min-height: 500px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 5px 5px;
    border: 1px solid #dee2e6;
    border-top: none;
}

#tail-detail-section .nav-tabs {
    border-bottom: 1px solid #dee2e6;
}

#tail-detail-section .nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    margin-bottom: -1px;
    padding: 8px 16px;
    font-weight: 500;
}

#tail-detail-section .nav-tabs .nav-link.active {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

#tail-recommend-content .card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

#tail-recommend-content .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 表格样式优化 */
#tail-detail-section .table th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

#tail-detail-section .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

#tail-detail-section .table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.1);
}

/* 尾码查看按钮样式 */
.view-tail-btn {
    transition: all 0.3s ease;
    min-width: 60px;
}

.view-tail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 标签页样式 */
#tail-tab-nav .nav-link {
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    border: 1px solid #dee2e6;
    border-bottom: none;
    background-color: #f8f9fa;
}

#tail-tab-nav .nav-link.active {
    background-color: #fff;
    border-bottom-color: #fff;
    color: #0d6efd;
    font-weight: 600;
}

/* 表格样式 */
.tail-detail-container .table th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

.tail-detail-container .table td {
    vertical-align: middle;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tail-detail-container .table-responsive {
        font-size: 12px;
    }

    .tail-detail-container .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* 尾码分布统计样式 */
.tail-distribution-chart {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.tail-distribution-item {
    transition: all 0.3s ease;
    padding: 8px 0;
}

.tail-distribution-item:hover {
    background-color: #e9ecef;
    border-radius: 5px;
    transform: translateX(5px);
}

.progress-bar {
    position: relative;
    overflow: visible;
}

.progress-text {
    position: absolute;
    left: 10px;
    font-weight: 600;
    font-size: 12px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 标签页样式 */
.nav-tabs .nav-link {
    color: #495057;
    border: 1px solid transparent;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    margin-right: 5px;
    padding: 8px 15px;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

.tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 5px 5px;
    padding: 20px;
    background-color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tail-distribution-item .col-7 {
        width: 60%;
    }

    .tail-distribution-item .col-4 {
        width: 40%;
    }

    .progress-text {
        font-size: 10px;
    }
}

/* 基础样式优化 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.tab {
    padding: 18px 25px;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.tab:hover {
    background: #e9ecef;
    color: #495057;
}

.tab.active {
    color: var(--primary-color);
    background: white;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
    padding: 30px;
    min-height: 500px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

/* 统计卡片样式优化 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.stat-card.primary { border-left-color: var(--primary-color); }
.stat-card.success { border-left-color: var(--secondary-color); }
.stat-card.warning { border-left-color: #f39c12; }
.stat-card.danger { border-left-color: var(--accent-color); }

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: auto;
}

/* 按钮样式优化 */
.btn {
    border-radius: var(--border-radius);
    padding: 10px 20px;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-outline {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.btn-outline:hover {
    background: #f8f9fa;
    color: var(--dark-color);
}

/* 表格样式优化 */
.data-table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 1px solid #dee2e6;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
    border: none;
}

.card-body {
    padding: 20px;
}

/* 表单控件优化 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    padding: 20px;
    gap: 5px;
}

.page-btn {
    padding: 8px 15px;
    border: 1px solid #dee2e6;
    background: white;
    color: var(--dark-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    background: #f8f9fa;
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
        margin: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab {
        min-width: 100%;
        justify-content: flex-start;
        padding: 15px 20px;
    }

    .tab-content {
        padding: 20px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .data-table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }
}

/* 尾码分析特定样式 */
.tail-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.pattern-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 2px;
}

/* 预测结果样式 */
.prediction-result {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    box-shadow: var(--box-shadow);
}

.prediction-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.prediction-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 工具提示样式 */
.tooltip-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    text-align: center;
    font-size: 0.7rem;
    line-height: 18px;
    margin-left: 5px;
    cursor: help;
}

/* 进度条样式 */
.progress {
    height: 10px;
    border-radius: 5px;
    background: #f1f1f1;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* 标签和徽章 */
.badge {
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 20px;
}

/* 模态框样式优化 */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-footer {
    border-top: 1px solid #f1f1f1;
    padding: 15px 20px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 高级功能区域 */
.advanced-options {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid var(--secondary-color);
}

/* 数据可视化图表容器 */
.chart-container {
    height: 300px;
    margin: 20px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* 尾码分析特定样式 */
.tail-distribution-chart {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.tail-distribution-item {
    transition: all 0.3s ease;
    padding: 8px 0;
}

.tail-distribution-item:hover {
    background-color: #e9ecef;
    border-radius: 5px;
    transform: translateX(5px);
}

/* 响应式表格容器 */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* 区比分析页面特定样式 */
#analysis .card {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
    transition: all 0.3s ease;
}

#analysis .card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#analysis .card-header {
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
}

#analysis .card-body {
    padding: 20px;
}

/* 按钮样式优化 */
#analysis .btn-group .btn {
    border-radius: 4px;
    margin-left: 5px;
    transition: all 0.2s ease;
}

#analysis .btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 进度条样式 */
#analysis .progress {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

#analysis .progress-bar {
    position: relative;
    overflow: visible;
    transition: width 0.6s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #analysis .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    #analysis .card-header .btn-group {
        margin-top: 10px;
        align-self: flex-end;
    }

    #analysis .progress-text {
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#ratio-distribution-content {
    animation: slideDown 0.3s ease;
}

/* 确保模态框正确显示 */
.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

/* 尾码详情表格样式 */
.tail-detail-content .table {
    font-size: 0.9rem;
}

.tail-detail-content .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* 加载状态样式 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}
/* 加载遮罩层样式 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 5px;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 淡出动画 */
.fade-out-content {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 淡入动画 */
.fade-in-content {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 平滑过渡效果 */
#tailDetailContent {
    position: relative;
    min-height: 300px;
    transition: all 0.3s ease;
}

/* 分页按钮加载状态 */
.page-link.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* 加载动画样式 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}
/* 尾码详情过渡效果 */
#tailDetailContent {
    transition: opacity 0.3s ease;
}

/* 加载动画 */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* 表格行悬停效果 */
.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.075);
    transform: translateX(2px);
}

/* 分页按钮效果 */
.page-link {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    margin: 0 2px;
    border-radius: 4px;
}

.page-link:hover:not(.disabled) {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

/* 卡片悬停效果 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}