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

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; 
    background: #0a0a0a; 
    color: #ffffff; 
    min-height: 100vh; 
}

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

/* ===== 头部 ===== */
.header { 
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%); 
    padding: 15px 25px; 
    border-radius: 12px; 
    margin-bottom: 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.5); 
    min-height: 60px;
}

.logo { 
    font-size: 22px; 
    font-weight: bold; 
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    white-space: nowrap;
}

.nav { 
    display: flex; 
    gap: 15px; 
}

.nav-item { 
    color: #888; 
    text-decoration: none; 
    padding: 8px 16px; 
    border-radius: 6px; 
    transition: all 0.3s; 
}

.nav-item:hover, .nav-item.active { 
    color: #fff; 
    background: rgba(255,255,255,0.1); 
}

.latest-draw { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    background: #1a1a1a; 
    padding: 6px 15px; 
    border-radius: 8px; 
}

.latest-label { 
    font-size: 14px; 
    color: #888; 
}

.latest-period { 
    font-size: 18px; 
    font-weight: bold; 
    color: #4ecdc4; 
    padding: 4px 12px; 
    background: rgba(78,205,196,0.1); 
    border-radius: 6px; 
}

/* ===== 标题 ===== */
.section-title { 
    font-size: 20px; 
    margin-bottom: 15px; 
    padding-left: 15px; 
    border-left: 4px solid #4ecdc4; 
}

/* ===== 算法卡片 ===== */
.algorithm-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    grid-auto-rows: 160px;
    gap: 15px; 
    margin-bottom: 25px; 
}

.algo-card { 
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a); 
    padding: 25px;
    text-align: center; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.3s; 
    border: 2px solid transparent; 
}

.algo-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 30px rgba(78,205,196,0.2); 
    border-color: #4ecdc4; 
}

.algo-card.selected { 
    border-color: #ff6b6b; 
    box-shadow: 0 10px 30px rgba(255,107,107,0.3); 
}

.algo-icon { 
    font-size: 40px;
    display: block; 
    margin-bottom: 15px; 
}

.algo-card h3 { 
    font-size: 18px;
    text-align: center; 
    margin-bottom: 8px; 
}

.algo-card p { 
    color: #888;
    text-align: center; 
    font-size: 14px; 
}

/* ===== 控制面板 ===== */
.control-panel { 
    background: #1a1a1a; 
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 30px; 
    display: flex; 
    gap: 20px; 
    align-items: center; 
    flex-wrap: wrap; 
}

.control-group { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.control-group label { 
    color: #888; 
}

select { 
    background: #2a2a2a; 
    color: #fff; 
    border: 1px solid #444; 
    padding: 8px 15px; 
    border-radius: 6px; 
    cursor: pointer; 
}

.btn-primary, .btn-secondary { 
    padding: 12px 30px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: bold; 
    transition: all 0.3s; 
}

.btn-primary { 
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f); 
    color: #fff; 
}

.btn-primary:hover { 
    transform: scale(1.05); 
    box-shadow: 0 5px 20px rgba(255,107,107,0.4); 
}

.btn-secondary { 
    background: linear-gradient(135deg, #4ecdc4, #44a08d); 
    color: #fff; 
}

.btn-secondary:hover { 
    transform: scale(1.05); 
    box-shadow: 0 5px 20px rgba(78,205,196,0.4); 
}

/* ===== 预测结果 ===== */
.results-container { 
    background: #1a1a1a; 
    padding: 25px; 
    border-radius: 12px; 
    min-height: 200px; 
}

.placeholder { 
    text-align: center; 
    color: #666; 
    padding: 60px 20px; 
}

.prediction-result { 
    background: #2a2a2a; 
    padding: 20px; 
    border-radius: 10px; 
    margin-bottom: 15px; 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

.result-number { 
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f); 
    color: #fff; 
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 18px; 
}

.result-info { 
    flex: 1; 
}

.confidence { 
    color: #4ecdc4; 
    font-size: 14px; 
    margin-top: 8px; 
}

/* ===== 历史开奖 ===== */
.history-section { 
    margin-top: 40px; 
}

.history-table { 
    background: #1a1a1a; 
    border-radius: 12px; 
    overflow: hidden; 
}

.table-header, .table-row { 
    display: grid; 
    grid-template-columns: 1fr 2fr 1fr 1fr; 
    padding: 15px 20px; 
    gap: 10px; 
    align-items: center; 
}

.table-header { 
    background: #2a2a2a; 
    font-weight: bold; 
    color: #4ecdc4; 
}

.table-row { 
    border-bottom: 1px solid #333; 
}

.table-row:hover { 
    background: rgba(78,205,196,0.05); 
}

.balls { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.ball { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 14px; 
    font-weight: bold; 
}

.ball.red { 
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f); 
    color: #fff; 
}

.ball.blue { 
    background: linear-gradient(135deg, #4ecdc4, #44a08d); 
    color: #fff; 
}

/* ===== 分页 ===== */
.pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
    margin-top: 20px; 
}

.pagination button { 
    background: #2a2a2a; 
    color: #fff; 
    border: 1px solid #444; 
    padding: 8px 20px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.3s; 
}

.pagination button:hover { 
    background: #4ecdc4; 
    border-color: #4ecdc4; 
}

/* ===== 手机端响应式 ===== */
@media (max-width: 768px) { 
    .app-container { padding: 10px; }
    
    .header { 
        padding: 15px; 
        flex-direction: column; 
        gap: 15px; 
    }
    
    .logo { font-size: 20px; }
    
    .nav { 
        width: 100%; 
        justify-content: center; 
        flex-wrap: wrap; 
        gap: 10px; 
    }
    
    .nav-item { 
        padding: 6px 12px; 
        font-size: 13px; 
    }
    
    .latest-draw { 
        width: 100%; 
        justify-content: center; 
        flex-wrap: wrap; 
    }
    
    .section-title { 
        font-size: 18px; 
        margin-bottom: 15px; 
    }
    
    .algorithm-grid { 
        grid-template-columns: 1fr; 
        gap: 12px; 
        margin-bottom: 20px; 
    }
    
    .algo-card { 
        padding: 18px; 
        min-height: 140px;
    }
    
    .algo-icon { 
        font-size: 36px; 
        margin-bottom: 12px; 
    }
    
    .algo-card h3 { 
        font-size: 16px; 
        margin-bottom: 6px; 
    }
    
    .algo-card p { 
        font-size: 13px; 
    }
    
    .control-panel { 
        flex-direction: column; 
        gap: 15px; 
        padding: 15px; 
    }
    
    .control-group { 
        width: 100%; 
        justify-content: space-between; 
    }
    
    select { 
        width: 60%; 
    }
    
    .btn-primary, .btn-secondary { 
        width: 100%; 
    }
    
    .results-container { 
        padding: 15px; 
    }
    
    .prediction-result { 
        flex-direction: column; 
        padding: 15px; 
        gap: 12px; 
        text-align: center; 
    }
    
    .result-number { 
        width: 40px; 
        height: 40px; 
        font-size: 16px; 
    }
    
    .table-header { display: none; }
    
    .table-row { 
        display: flex; 
        flex-direction: column; 
        gap: 8px; 
        padding: 15px; 
    }
    
    .period-cell { display: none; }
    
    .table-row::before {
        content: "期号: " attr(data-period);
        font-weight: bold;
        color: #4ecdc4;
        font-size: 15px;
        margin-bottom: 5px;
    }
    
    .date-cell { 
        font-size: 13px; 
        color: #888; 
    }
    
    .balls { 
        justify-content: center; 
        gap: 6px; 
    }
    
    .ball { 
        width: 30px; 
        height: 30px; 
        font-size: 13px; 
    }
    
    .latest-draw { 
        padding: 10px 15px; 
    }
    
    .latest-label { 
        font-size: 13px; 
    }
    
    .latest-period { 
        font-size: 16px; 
    }
    
    .latest-draw .ball { 
        width: 28px; 
        height: 28px; 
        font-size: 12px; 
    }
    
    .pagination { 
        gap: 15px; 
    }
    
    .pagination button { 
        padding: 8px 15px; 
        font-size: 13px; 
    }
}

/* 胆拖选号模块样式 */
.dantuo-balls-red .ball, .dantuo-balls-blue .ball {
    width: 45px; height: 45px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-weight: bold;
    font-size: 16px; cursor: pointer; transition: all 0.3s; user-select: none;
}
.dantuo-balls-red .ball { background: #2a2a2a; color: #fff; border: 2px solid #444; }
.dantuo-balls-red .ball:hover { border-color: #ff6b6b; transform: scale(1.1); }
.dantuo-balls-red .ball.selected { background: linear-gradient(135deg, #ff6b6b, #c0392b); border-color: #ff6b6b; box-shadow: 0 0 15px rgba(255, 107, 107, 0.5); }
.dantuo-balls-blue .ball { background: #2a2a2a; color: #fff; border: 2px solid #444; }
.dantuo-balls-blue .ball:hover { border-color: #4ecdc4; transform: scale(1.1); }

/* 蓝球胆码选中样式（确保优先级） */
#blueDanBalls .ball.selected {
    background: linear-gradient(135deg, #4ecdc4, #1f6da8) !important;
    border-color: #4ecdc4 !important;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.5) !important;
    color: #fff !important;
}

.dantuo-balls-blue .ball.selected { background: linear-gradient(135deg, #4ecdc4, #1f6da8); border-color: #4ecdc4; box-shadow: 0 0 15px rgba(78, 205, 196, 0.5); }
.btn-secondary { background: #2a2a2a; color: #fff; border: 2px solid #4ecdc4; padding: 10px 25px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.3s; }
.btn-secondary:hover { background: #4ecdc4; color: #1a1a2e; }
