/* 号码走势图页面样式 */

/* 设置及选择器样式 */
.trends-settings {
    margin: 15px 0;
    padding: 0 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.period-selector,
.number-range-selector {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 140px;
}

.period-selector label,
.number-range-selector label {
    margin-right: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.period-select,
.number-range {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-size: 14px;
    flex: 1;
    min-width: 100px;
}

/* 走势图模式切换器 */
.trends-mode-switcher-wrapper {
    margin: 10px 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
}

.trends-mode-switcher {
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
    min-width: max-content;
}

.trend-mode-switch {
    padding: 8px 15px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.trend-mode-switch:hover {
    background-color: #e0e0e0;
}

.trend-mode-switch.active {
    background-color: #2196f3;
    color: #fff;
    border-color: #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

/* 走势图容器 */
.trends-container {
    margin: 0 0 20px;
    position: relative;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.9), rgba(255,255,255,0.9)), url('../images/bg-pattern.png');
    background-attachment: fixed;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 加载中动画 */
.trends-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    width: 100%;
}

.trends-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 横向滚动提示 */
.scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0;
    background-color: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    margin: 0 15px 10px;
    color: #2196f3;
}

.scroll-hint svg {
    animation: scrollHint 1.5s ease-in-out infinite;
}

@keyframes scrollHint {
    0%, 100% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}

/* 走势图表格容器 */
.trends-table-container {
    overflow-x: auto;
    padding: 0 15px;
    margin-bottom: 15px;
    width: 100%;
    -webkit-overflow-scrolling: touch; /* 平滑滚动在iOS上 */
}

.trends-table-container.scrollable {
    position: relative;
}

.trends-table-container.scrollable::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 20px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.8));
    pointer-events: none;
    z-index: 2;
}

/* 走势图表格样式 */
.trends-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed; /* 固定布局，更好的移动端性能 */
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
}

.trends-table th,
.trends-table td {
    border: 1px solid #eee;
    padding: 5px 3px;
    text-align: center;
    position: relative;
    vertical-align: middle;
}

.trends-table th {
    background-color: #f5f5f5;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 10;
}

.trends-table .period-header {
    width: 70px;
    min-width: 70px;
    background-color: #e0e0e0;
}

.trends-table .period-cell {
    background-color: #f9f9f9;
    font-weight: 500;
    width: 70px;
    min-width: 70px;
}

/* 号码单元格样式 */
.trends-table .number-cell {
    width: 36px;
    height: 36px;
    position: relative;
    padding: 0;
}

/* 球样式 - 全新设计 */
.trends-table .number-cell.has-number {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* 球样式应用到表格单元格和内部球元素 */
.trends-table .number-cell.has-number::before,
.history-lottery-item-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: linear-gradient(to bottom, #ff7043, #ff5722);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 -2px 0 rgba(0,0,0,0.1), inset 0 2px 0 rgba(255,255,255,0.3);
    color: #fff;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    position: relative;
}

.trends-table .number-cell.special.has-number::before,
.history-lottery-item-ball.special {
    background: linear-gradient(to bottom, #42a5f5, #2196f3);
}

/* 走势线样式 */
.trend-line {
    position: absolute;
    background-color: #ff5722;
    z-index: 1;
    pointer-events: none;
    opacity: 0.8;
}

.trend-line.horizontal {
    height: 2px;
}

.trend-line.vertical {
    width: 2px;
}

.trend-line.special {
    background-color: #2196f3;
}

/* 号码高亮 */
.number-cell.highlight {
    background-color: rgba(255, 87, 34, 0.1);
}

.number-cell.highlight.special {
    background-color: rgba(33, 150, 243, 0.1);
}

/* 模式样式 - 应用到单元格和球元素 */
.number-cell.odd::before,
.history-lottery-item-ball.odd {
    background: linear-gradient(to bottom, #66bb6a, #4caf50) !important;
}

.number-cell.even::before,
.history-lottery-item-ball.even {
    background: linear-gradient(to bottom, #ab47bc, #9c27b0) !important;
}

.number-cell.big::before,
.history-lottery-item-ball.big {
    background: linear-gradient(to bottom, #ef5350, #f44336) !important;
}

.number-cell.small::before,
.history-lottery-item-ball.small {
    background: linear-gradient(to bottom, #29b6f6, #03a9f4) !important;
}

.number-cell.prime::before,
.history-lottery-item-ball.prime {
    background: linear-gradient(to bottom, #ffa726, #ff9800) !important;
}

.number-cell.composite::before,
.history-lottery-item-ball.composite {
    background: linear-gradient(to bottom, #78909c, #607d8b) !important;
}

/* 图例样式 */
.trends-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin: 0 15px 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.legend-ball {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #ff7043, #ff5722);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-right: 5px;
}

.legend-ball.special {
    background: linear-gradient(to bottom, #42a5f5, #2196f3);
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
    background-color: #ff5722;
    margin-right: 5px;
    opacity: 0.8;
}

/* 错误消息 */
.error-message {
    padding: 20px;
    text-align: center;
    color: #e53935;
    background-color: #ffebee;
    border-radius: 4px;
    margin: 15px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .trends-settings {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .period-selector,
    .number-range-selector {
        width: 100%;
    }
    
    .trends-table th,
    .trends-table td {
        padding: 4px 2px;
    }
    
    .trends-table .number-cell {
        width: 32px;
        height: 32px;
    }
    
    .trends-table .number-cell.has-number::before,
    .history-lottery-item-ball {
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 13px;
    }
    
    .trends-legend {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .trends-table .number-cell {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .trends-table .number-cell.has-number::before,
    .history-lottery-item-ball {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
    }
    
    .trends-table .period-header,
    .trends-table .period-cell {
        width: 60px;
        min-width: 60px;
        font-size: 12px;
    }
    
    .trends-table th {
        font-size: 12px;
    }
    
    .trend-mode-switch {
        padding: 6px 10px;
        font-size: 13px;
    }
} 