/**
 * 走势图弹窗样式 - 专业彩票风格
 */

/* 走势图容器 */
.trend-chart-container {
    padding: 4px 6px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    height: 100%;
    min-height: 0;
    color: #333;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trend-chart-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 8px;
}

.trend-chart-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trend-summary-card {
    min-width: 124px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.summary-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* 图例 */
.trend-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    font-size: 14px;
    flex-wrap: wrap;
}

.trend-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
}

.trend-legend .ball {
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.trend-legend .ball-red {
    background: linear-gradient(180deg, #ff6b6b, #ef4444);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14);
}

.trend-legend .ball-blue {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14);
}

/* 走势图Tab切换 */
.trend-chart-tabs {
    display: flex;
    gap: 8px;
    padding: 4px 0 6px;
    border-bottom: 1px solid #dbe3ea;
    flex-wrap: wrap;
}

.trend-tab {
    padding: 7px 18px;
    border: none;
    background: rgba(0,0,0,0.05);
    color: #666;
    cursor: pointer;
    border-radius: 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.trend-tab:hover {
    background: rgba(0,0,0,0.1);
    color: #333;
}

.trend-tab.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

/* 统计信息 */
.summary-value .period-count,
.summary-value .total-count {
    color: #e74c3c;
    font-weight: bold;
    font-size: 17px;
}

/* 走势图表格容器 */
.trend-chart-table-wrap {
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #dee2e6;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* 走势图画布容器 */
.trend-chart-canvas {
    position: relative;
    width: max-content;
    min-width: 100%;
}

.trend-chart-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

/* 走势图表格 */
.trend-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    border: 1px solid #dee2e6;
    table-layout: auto;
}

/* 表头 */
.trend-table thead th {
    background: #f8f9fa;
    font-weight: bold;
    padding: 9px 8px;
    font-size: 14px;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
}

.trend-table thead th.col-period {
    width: 88px;
    min-width: 88px;
    background: #f8fafc;
    color: #374151;
}

.trend-table thead th.col-front {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(192, 57, 43, 0.15) 100%);
    color: #c0392b;
}

.trend-table thead th.col-back {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(41, 128, 185, 0.15) 100%);
    color: #2980b9;
}

.trend-table thead th.col-num {
    width: 40px;
    min-width: 40px;
    padding: 6px 2px;
    font-size: 13px;
    color: #666;
}

.trend-table thead th.col-sums,
.trend-table thead th.col-range {
    background: #f8f9fa;
    color: #555;
    font-size: 12px;
}

.trend-table thead th.col-ratio,
.trend-table thead th.col-total {
    background: #f8f9fa;
    color: #555;
    font-size: 12px;
}

/* 表格内容单元格 */
.trend-table tbody td {
    height: 34px;
    background: #fff;
    padding: 5px 7px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    box-sizing: border-box;
    font-size: 14px;
}

.trend-table tbody td.col-period {
    font-weight: bold;
    background: inherit;
    color: #111827;
    font-size: 14px;
}

.trend-table tbody td.col-front,
.trend-table tbody td.col-sums,
.trend-table tbody td.col-ratio,
.trend-table tbody td.col-total {
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
}

/* 号码球样式 */
.trend-table .ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 13px;
    flex: 0 0 24px;
}

.trend-table .ball-red {
    background: linear-gradient(180deg, #ff6b6b, #ef4444);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14);
}

.trend-table .ball-blue {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.14);
}

.trend-table .front-num,
.trend-table .back-num {
    text-align: center;
    width: 40px;
    min-width: 40px;
}

.trend-table .ball-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

/* 统计行 */
.trend-table .stat-row td {
    background: #f8f9fa;
    font-weight: bold;
    color: #555;
    padding: 6px 4px;
    font-size: 13px;
    border-top: 2px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.trend-table .stat-row:first-child td {
    background: #fff3e0;
    color: #e65100;
}

.trend-table .sums-value,
.trend-table .ratio-value {
    font-weight: bold;
    font-size: 16px;
    color: #e74c3c;
}

.trend-table-basic th.col-front,
.trend-table-basic td.col-front {
    min-width: 220px;
}

.trend-table-basic th.col-back,
.trend-table-basic td.col-back {
    min-width: 120px;
}

.trend-table-sums th.col-front,
.trend-table-sums td.col-front {
    min-width: 250px;
}

.trend-table-sums th.col-sums,
.trend-table-sums td.col-sums {
    min-width: 72px;
}

.trend-table-sums th.col-range,
.trend-table-sums td.col-range,
.trend-table-sums td.highlight {
    min-width: 96px;
}

.trend-table-ratio th.col-front,
.trend-table-ratio td.col-front {
    min-width: 250px;
}

.trend-table-ratio th.col-ratio,
.trend-table-ratio td.col-ratio,
.trend-table-ratio th.col-total,
.trend-table-ratio td.col-total {
    min-width: 72px;
}

/* 分区高亮 */
.trend-table td.highlight {
    background: rgba(231, 76, 60, 0.25) !important;
    border-color: #e74c3c;
}

/* 加载中 */
.trend-chart-content .loading {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 14px;
}

.trend-chart-content .loading img {
    width: 30px;
    vertical-align: middle;
    margin-right: 10px;
}

/* 错误提示 */
.trend-chart-content .error {
    text-align: center;
    padding: 50px;
    color: #e74c3c;
    font-size: 14px;
}

/* 底部按钮 */
.trend-chart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0;
    padding-top: 6px;
    border-top: 1px solid #dee2e6;
}

.trend-footer-tip {
    font-size: 12px;
    color: #6b7280;
}

/* 响应式 */
@media (max-width: 1024px) {
    .trend-chart-header {
        flex-direction: column;
    }

    .trend-legend {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .trend-chart-container {
        padding: 4px 6px;
    }

    .trend-summary-card {
        min-width: 108px;
        padding: 6px 10px;
    }

    .summary-label {
        font-size: 11px;
    }

    .summary-value {
        font-size: 14px;
    }

    .trend-tab {
        padding: 5px 12px;
        font-size: 13px;
    }

    .trend-table {
        font-size: 12px;
    }

    .trend-table .ball {
        width: 22px;
        height: 22px;
        font-size: 11px;
        flex-basis: 22px;
    }

    .trend-chart-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .trend-footer-tip {
        text-align: center;
    }
}
