* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    color: white;
}

.subtitle {
    opacity: 0.9;
    font-size: 0.95em;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 200px;
    font-size: 14px;
}

.search-box button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.search-box button:hover {
    background: #5a6fd6;
}

.filter-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-box select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

th, td {
    padding: 10px 12px;
    text-align: center;
}

th {
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f8f9fa;
}

.num-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-weight: bold;
    margin: 0 2px;
}

.num-ball:nth-child(2) { background: #f093fb; }
.num-ball:nth-child(3) { background: #4facfe; }
.num-ball:nth-child(4) { background: #43e97b; }
.num-ball:nth-child(5) { background: #fa709a; }

/* 排列五外框 */
.pl5-cell {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(200, 230, 255, 0.03));
    border: 2px solid rgba(52, 152, 219, 0.35);
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.12);
}

.pl5-header {
    color: #3498db;
    font-weight: bold;
}

.pl5-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

/* 排列3内框（嵌套在排列5内） */
.pl3-cell {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(255, 200, 200, 0.03));
    border: 2px solid rgba(231, 76, 60, 0.35);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.1);
}

.pl3-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.pl3-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 13px;
    transition: transform 0.2s;
}

.pl3-ball:hover {
    transform: scale(1.1);
}

/* 排列五后两位 */
.pl5-only {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pl5-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 13px;
    transition: transform 0.2s;
}

.pl5-ball:hover {
    transform: scale(1.1);
}

/* 数字配色：每个数字固定一种颜色，与位置无关 */
.pl3-ball.n0, .pl5-ball.n0 { background: linear-gradient(135deg, #667eea, #5a6fd6); box-shadow: 0 2px 6px rgba(90, 111, 214, 0.4); }
.pl3-ball.n1, .pl5-ball.n1 { background: linear-gradient(135deg, #f093fb, #d97ee8); box-shadow: 0 2px 6px rgba(217, 126, 232, 0.4); }
.pl3-ball.n2, .pl5-ball.n2 { background: linear-gradient(135deg, #4facfe, #3d97e8); box-shadow: 0 2px 6px rgba(61, 151, 232, 0.4); }
.pl3-ball.n3, .pl5-ball.n3 { background: linear-gradient(135deg, #43e97b, #35c765); box-shadow: 0 2px 6px rgba(53, 199, 101, 0.4); }
.pl3-ball.n4, .pl5-ball.n4 { background: linear-gradient(135deg, #fa709a, #e85a85); box-shadow: 0 2px 6px rgba(232, 90, 133, 0.4); }
.pl3-ball.n5, .pl5-ball.n5 { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); box-shadow: 0 2px 6px rgba(238, 90, 90, 0.4); }
.pl3-ball.n6, .pl5-ball.n6 { background: linear-gradient(135deg, #f39c12, #d68910); box-shadow: 0 2px 6px rgba(214, 137, 16, 0.4); }
.pl3-ball.n7, .pl5-ball.n7 { background: linear-gradient(135deg, #9b59b6, #884ea0); box-shadow: 0 2px 6px rgba(136, 78, 160, 0.4); }
.pl3-ball.n8, .pl5-ball.n8 { background: linear-gradient(135deg, #3498db, #2e86c1); box-shadow: 0 2px 6px rgba(46, 134, 193, 0.4); }
.pl3-ball.n9, .pl5-ball.n9 { background: linear-gradient(135deg, #00cec9, #00b894); box-shadow: 0 2px 6px rgba(0, 184, 148, 0.4); }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.pagination button {
    padding: 8px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover {
    background: #f0f0f0;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.charts-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.charts-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.chart-box h3 {
    margin-bottom: 15px;
    font-size: 1em;
    color: #555;
}

.omit-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.omit-section h2 {
    margin-bottom: 15px;
}

.omit-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.omit-position {
    text-align: center;
}

.omit-position h4 {
    margin-bottom: 10px;
    color: #555;
}

.omit-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.omit-ball {
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.omit-ball.hot { background: #ff6b6b; color: white; }
.omit-ball.warm { background: #ffd93d; color: #333; }
.omit-ball.cold { background: #6bcf7f; color: white; }

/* 彩种切换（页面最顶部） */
.lottery-switch {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0 0 20px;
}

.switch-btn {
    padding: 14px 44px;
    background: white;
    border: 2px solid #e0e4ee;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.switch-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.switch-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}

/* 大乐透：前区红球 / 后区蓝球 */
.dlt-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dlt-front-ball,
.dlt-back-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 12px;
    transition: transform 0.2s;
}

.dlt-front-ball:hover,
.dlt-back-ball:hover {
    transform: scale(1.1);
}

.dlt-front-ball {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    box-shadow: 0 2px 6px rgba(238, 90, 36, 0.4);
}

.dlt-back-ball {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 2px 6px rgba(41, 128, 185, 0.4);
}

.dlt-front-cell {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.06), rgba(255, 200, 200, 0.03));
    border-radius: 20px;
}

.dlt-back-cell {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(200, 230, 255, 0.03));
    border-radius: 20px;
}

.dlt-front-header {
    color: #e74c3c;
    font-weight: bold;
}

.dlt-back-header {
    color: #3498db;
    font-weight: bold;
}

/* 大乐透遗漏值：前区/后区各占一行 */
.omit-grid.wide {
    grid-template-columns: 1fr;
}

/* 7星彩：6位号码球 + 特别号 */
.qxc-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.qxc-ball {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 13px;
    transition: transform 0.2s;
}

.qxc-ball:hover {
    transform: scale(1.1);
}

.qxc-ball.n0 { background: linear-gradient(135deg, #667eea, #5a6fd6); box-shadow: 0 2px 6px rgba(90, 111, 214, 0.4); }
.qxc-ball.n1 { background: linear-gradient(135deg, #f093fb, #d97ee8); box-shadow: 0 2px 6px rgba(217, 126, 232, 0.4); }
.qxc-ball.n2 { background: linear-gradient(135deg, #4facfe, #3d97e8); box-shadow: 0 2px 6px rgba(61, 151, 232, 0.4); }
.qxc-ball.n3 { background: linear-gradient(135deg, #43e97b, #35c765); box-shadow: 0 2px 6px rgba(53, 199, 101, 0.4); }
.qxc-ball.n4 { background: linear-gradient(135deg, #fa709a, #e85a85); box-shadow: 0 2px 6px rgba(232, 90, 133, 0.4); }
.qxc-ball.n5 { background: linear-gradient(135deg, #ff6b6b, #ee5a5a); box-shadow: 0 2px 6px rgba(238, 90, 90, 0.4); }
.qxc-ball.n6 { background: linear-gradient(135deg, #f39c12, #d68910); box-shadow: 0 2px 6px rgba(214, 137, 16, 0.4); }
.qxc-ball.n7 { background: linear-gradient(135deg, #9b59b6, #884ea0); box-shadow: 0 2px 6px rgba(136, 78, 160, 0.4); }
.qxc-ball.n8 { background: linear-gradient(135deg, #3498db, #2e86c1); box-shadow: 0 2px 6px rgba(46, 134, 193, 0.4); }
.qxc-ball.n9 { background: linear-gradient(135deg, #00cec9, #00b894); box-shadow: 0 2px 6px rgba(0, 184, 148, 0.4); }

/* 特别号（0-14，可两位数，略宽） */
.qxc-special-ball {
    display: inline-block;
    min-width: 32px;
    height: 28px;
    line-height: 28px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f39c12, #d68910);
    box-shadow: 0 2px 6px rgba(214, 137, 16, 0.4);
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 0 4px;
    transition: transform 0.2s;
}

.qxc-special-ball:hover {
    transform: scale(1.1);
}

.qxc-plus {
    color: #999;
    font-weight: bold;
    font-size: 16px;
    margin: 0 2px;
}

.qxc-front-cell {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08), rgba(200, 230, 255, 0.03));
    border: 2px solid rgba(52, 152, 219, 0.35);
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.12);
}

.qxc-special-cell {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.08), rgba(255, 220, 150, 0.03));
    border: 2px solid rgba(243, 156, 18, 0.35);
    border-radius: 20px;
}

.qxc-front-header {
    color: #3498db;
    font-weight: bold;
}

.qxc-special-header {
    color: #f39c12;
    font-weight: bold;
}

@media (max-width: 768px) {
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .omit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }

    .switch-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}
