.trend-container {
    padding: 15px;
    max-width: 100%;
    overflow-x: auto;
}

/* 控制面板样式 */
.control-panel {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.control-panel label {
    margin-right: 10px;
    font-size: 14px;
}

.control-panel select,
.control-panel input {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* 表格基础样式 */
.trend-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 1200px;
    background: #fff;
    position: relative;
}

/* 基础单元格样式 */
.trend-table th,
.trend-table td {
    text-align: center;
    padding: 4px;
    min-width: 24px;
    height: 24px;
    font-size: 11px;
    border: 1px solid #ddd;
    position: relative;
}

/* 表头样式 */
.trend-table th {
    background-color: #f5f5f5;
    font-weight: normal;
}

/* 数据区域的红球分区线 */
.trend-table > tbody > tr > td:nth-child(12),
.trend-table > tbody > tr > td:nth-child(23) {
    border-right: 2px solid #ff4444;
}

/* 红蓝球分隔线 - 仅在thead和tbody中 */
.trend-table > thead > tr > td:nth-child(34),
.trend-table > thead > tr > th:nth-child(34),
.trend-table > tbody > tr > td:nth-child(34) {
    border-right: 2px solid #1976d2;
}

/* 统计区域样式 */
.trend-table > tfoot > tr > td {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

/* 统计区域的红蓝球分隔线 */
.trend-table > tfoot > tr > td:nth-child(34) {
    border-right: 2px solid #1976d2;
}

/* 统计区域的分区线重置 */
.trend-table > tfoot > tr > td:nth-child(12),
.trend-table > tfoot > tr > td:nth-child(23) {
    border-right: 1px solid #ddd;
}

/* 号码球样式 */
.trend-table td.red-ball,
.trend-table th.red-ball {
    background: #ff1744 !important;
    color: #ffffff !important;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.trend-table td.blue-ball,
.trend-table th.blue-ball {
    background: #1976d2 !important;
    color: #ffffff !important;
    font-weight: bold;
    position: relative;
    z-index: 2;
}

/* 红球分区线 - 只在tbody中显示 */
.trend-table > tbody > tr td:nth-child(12),
.trend-table > tbody > tr td:nth-child(23) {
    border-right: 2px solid #ff4444;
}

/* 红蓝球分隔线 - 贯穿整个表格 */
.trend-table td:nth-child(34),
.trend-table th:nth-child(34) {
    border-right: 2px solid #1976d2;
}

/* 固定列样式 */
.trend-table td.period-col,
.trend-table td.date-col,
.trend-table td.weekday-col,
.trend-table th.period-col,
.trend-table th.date-col,
.trend-table th.weekday-col {
    background-color: #ffffff !important;
    position: sticky;
    z-index: 4;
    border-right: 1px solid #ddd;
}

/* 期号列位置 */
.trend-table td.period-col,
.trend-table th.period-col {
    min-width: 60px;
    width: 60px;
    font-size: 11px;
}

/* 日期列位置 */
.trend-table td.date-col,
.trend-table th.date-col {
    min-width: 70px;
    width: 70px;
    font-size: 11px;
}

/* 星期列位置 */
.trend-table td.weekday-col,
.trend-table th.weekday-col {
    min-width: 30px;
    width: 30px;
    font-size: 11px;
}

/* 表格容器样式 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    position: relative;
}

/* 底部统计行样式 */
.stats-row {
    background-color: #f8f9fa;
    height: 30px;
    line-height: 30px;
}

.stats-label {
    position: sticky;
    left: 0;
    background-color: #f8f9fa;
    padding: 0 10px;
    font-weight: bold;
    z-index: 2;
    border-right: 1px solid #dee2e6;
    min-width: 100px;
    text-align: right;
}

.stats-value {
    text-align: center;
    font-family: monospace;
}

/* 选号操作域样式 */
.ball-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

/* 基础球样式 */
.ball-selector button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background-color: white;
    color: #666;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* 红球未选中状态 */
.ball-selector button.red-ball {
    border: 2px solid #ff4444;
    color: #ff4444;
    background-color: white !important;
}

/* 蓝球未选中状态 */
.ball-selector button.blue-ball {
    border: 2px solid #1976d2;
    color: #1976d2;
    background-color: white !important;
}

/* 红球选中状态 */
.ball-selector button.red-ball.selected {
    background-color: #ff4444 !important;
    color: white !important;
    border: none;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255,68,68,0.4);
}

/* 蓝球选中状态 */
.ball-selector button.blue-ball.selected {
    background-color: #1976d2 !important;
    color: white !important;
    border: none;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(25,118,210,0.4);
}

/* 投注信息样式 */
.betting-info {
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 8px;
    border: 1px solid #e9ecef;
}

.betting-info span {
    font-size: 13px;
}

.betting-info #betCount,
.betting-info #betAmount {
    font-weight: bold;
    color: #ff4444;
    font-size: 15px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .trend-table th,
    .trend-table td {
        padding: 2px;
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .period-col {
        min-width: 50px;
    }
    
    .date-col {
        min-width: 60px;
    }
    
    .weekday-col {
        min-width: 25px;
    }
}

/* 广告容器样式 */
.ad-container {
    margin: 0 auto;
    max-width: 1200px;
    padding-top: 0;
}

.ad-placeholder {
    margin: 0 auto;
    max-width: 1200px;
}

/* 容器样式 */
.container-fluid {
    padding: 0 15px;
}

/* 遗漏值样式 */
.trend-table td.missing-value {
    color: #666;
    font-size: 10px;
}

/* 走势线样式 */
.trend-line {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
    stroke-width: 2px !important;
    opacity: 0.5 !important;
}

.trend-line:hover {
    opacity: 0.8 !important;
}

/* 遗漏数样式 */
.missing-count {
    color: #666;
    font-size: 12px;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .trend-container {
        padding: 10px;
    }
    
    .trend-table th,
    .trend-table td {
        padding: 4px;
        min-width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .ball {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 工具提示样式 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading::after {
    content: "...";
    animation: dots 1s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

/* 显示/隐藏控制 */
.hide {
    display: none !important;
}

/* 固定列样式 */
.fixed-column {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
}

.fixed-column.header {
    z-index: 3;
}

/* 滚动条样式 */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 统计信息样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 5px;
    margin-top: 10px;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.stats-item .ball {
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 11px;
}

.stats-item .ball.red {
    color: #ff0000;
    border: 1px solid #ff0000;
}

.stats-item .ball.blue {
    color: #0000ff;
    border: 1px solid #0000ff;
}

.stats-item .count {
    font-size: 11px;
}

.stats-item .percent {
    font-size: 10px;
    color: #666;
}

/* 控制面板样式 */
.form-group {
    margin-bottom: 0;
}

.form-check-inline {
    margin-right: 1rem;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .trend-table th,
    .trend-table td {
        padding: 2px;
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .period-col {
        min-width: 50px;
    }
    
    .date-col {
        min-width: 60px;
    }
    
    .weekday-col {
        min-width: 25px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 3px;
    }
    
    .stats-item .ball {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 10px;
    }
    
    .stats-item .count {
        font-size: 10px;
    }
    
    .stats-item .percent {
        font-size: 9px;
    }
}

/* 期号导航样式 */
.period-nav {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.period-nav .nav-link {
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    margin: 0 5px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    font-size: 14px;
}

.period-nav .nav-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.period-nav .nav-link.active {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 删除旧的分隔线样式 */
.trend-table td.blue-zone-divider,
.trend-table th.blue-zone-divider {
    display: none;
}

/* 蓝球连线样式 */
.blue-ball-line {
    position: absolute;
    height: 2px;
    background-color: rgba(0, 123, 255, 0.5);
    transform-origin: 0 50%;
    pointer-events: none;
    z-index: 1;
}

/* 蓝球区域分隔样式 */
.trend-table .blue-zone1 {
    background-color: rgba(0, 123, 255, 0.05);
}

.trend-table .blue-zone2 {
    background-color: rgba(0, 123, 255, 0.1);
}

.trend-table .blue-divider {
    border-left: 2px solid #007bff;
}

/* 确保表格容器支持绝对定位的连线 */
.table-container {
    position: relative;
    overflow-x: auto;
}

.trend-table {
    position: relative;
}

/* 趋势线样式 */
.trend-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 数据区域样式 */
.trend-table > tbody > tr > td {
    border: 1px solid #ddd;
}

/* 数据区域的红球分区线 */
.trend-table > tbody > tr > td:nth-child(12),
.trend-table > tbody > tr > td:nth-child(23) {
    border-right: 2px solid #ff4444 !important;
}

/* 红蓝球分隔线 */
.trend-table td:nth-child(34),
.trend-table th:nth-child(34) {
    border-right: 2px solid #1976d2 !important;
}

/* 统计区域基础样式 */
.trend-table > tfoot > tr > td {
    background-color: #f8f9fa !important;
    border: 1px solid #ddd !important;
}

/* 统计区域特殊边框处理 */
.trend-table > tfoot > tr > td:not(:nth-child(34)) {
    border: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
}

/* 统计区域的红蓝球分隔线 */
.trend-table > tfoot > tr > td:nth-child(34) {
    border: 1px solid #ddd !important;
    border-right: 2px solid #1976d2 !important;
}

/* 确保统计区域的分区线不继承其他样式 */
.trend-table > tfoot > tr > td:nth-child(12),
.trend-table > tfoot > tr > td:nth-child(23) {
    border: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
}

/* 添加连出号码样式 */
.trend-table td.consecutive-occurrence {
    background-color: #ffff99; /* 浅黄色背景 */
    color: #333;
    font-weight: bold;
}

/* 添加连号球样式 */
.trend-table td.consecutive-number {
    background-color: #d4edda; /* 浅绿色背景 */
    color: #333;
}

/* 表格行交替背景色 */
.trend-table tbody tr:nth-child(even) {
    background-color: #e9ecef; /* 稍深的灰色背景 */
}

.trend-table tbody tr:nth-child(odd) {
    background-color: #ffffff; /* 白色背景 */
}

/* 确保开奖号码和遗漏值的默认背景色 */
.trend-table td:not(.red-ball):not(.blue-ball):not(.consecutive-occurrence):not(.consecutive-number):not(.period-col):not(.stats-value) {
    background-color: #ffffff; /* 白色背景 */
    color: #333; /* 深色字体 */
}

/* 确保开奖号码的背景色 */
.trend-table td.red-ball {
     background: #ff1744 !important;
     color: #ffffff !important;
 }

.trend-table td.blue-ball {
     background: #1976d2 !important;
     color: #ffffff !important;
 }

/* 移除旧的分区边框规则，只保留红蓝球分隔线 */
.trend-table td,
.trend-table th {
    border: 1px solid #ddd; /* 默认边框 */
}

/* 红蓝球分隔线 */
.trend-table td:nth-child(34),
.trend-table th:nth-child(34) {
    border-right: 2px solid #1976d2 !important;
}

/* 移除底部统计行的背景色，由行交替背景控制 */
.stats-row {
    background-color: transparent !important;
}

/* 调整固定列的背景色，确保其在交替背景之上 */
.trend-table td.period-col {
     background-color: inherit !important; /* 继承行的背景色 */
    position: sticky;
    z-index: 4;
    border-right: 1px solid #ddd;
}

/* 调整固定列的边框 */
.trend-table td.period-col {
    border-right: 1px solid #ddd;
}

/* 其他可能需要调整的样式 */
/* 确保表头没有旧的分区边框 */
.trend-table thead th {
     border: 1px solid #ddd;
}

/* 确保表头红蓝球分隔线正确 */
.trend-table thead th:nth-child(34) {
     border-right: 2px solid #1976d2;
}

/* 确保连出号码和连号球的背景色优先级高于行背景色，但低于开奖号码 */
.trend-table td.consecutive-occurrence:not(.red-ball):not(.blue-ball) {
    background-color: #ffff99; /* 连出浅黄色 */
}

.trend-table td.consecutive-number:not(.red-ball):not(.blue-ball) {
     background-color: #d4edda; /* 浅绿色 */
}

/* 确保开奖号码的背景色最高优先级 */
.trend-table td.red-ball,
.trend-table td.blue-ball {
    background-color: #ff1744 !important; /* 红色 */
    color: white !important;
}

.trend-table td.blue-ball {
    background-color: #1976d2 !important; /* 蓝色 */
}

/* 确保连出和连号的文本颜色 */
.trend-table td.consecutive-occurrence,
.trend-table td.consecutive-number {
     color: #333;
}

/* 确保遗漏值的文本颜色 */
.trend-table td:not(.red-ball):not(.blue-ball) {
     color: #666;
}

/* 调整默认单元格背景色，使其继承行背景色 */
.trend-table td {
    background-color: inherit !important;
    color: #333;
    font-weight: normal;
} 

/* 冷热温号样式 */
.trend-table td.hot-number {
    background-color: #ff9800 !important;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 10px;
}

.trend-table td.cold-number {
    background-color: #2196f3 !important;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 10px;
}

.trend-table td.warm-number {
    background-color: #ffffff !important;
    color: #333333 !important;
    font-weight: bold;
    font-size: 10px;
    border: 1px solid #ddd;
} 

/* 区间热度和断区预警样式 */
.trend-table .zone-heat {
    background-color: #ff9800 !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 16px;
}
.zone-heat {
    background-color: #ff9800 !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 16px;
}
.zone-warn {
    background-color: #2196f3 !important;
    color: #fff !important;
    font-weight: bold;
} 

.trend-table thead tr:first-child th,
.trend-table thead tr:nth-child(2) th {
    position: sticky;
    top: -2px;
    height: 24px;
    z-index: 10;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd !important;
}
.trend-table thead tr:nth-child(2) th {
    position: sticky;
    top: 21px;
    z-index: 9;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd !important;
}


