* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 15px;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    padding: 15px 0;
    background: linear-gradient(135deg, #e53935, #c62828);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.2);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

.ball-section {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #444;
}

.section-title i {
    margin-right: 8px;
    color: #e53935;
}

.red-title i {
    color: #e53935;
}

.blue-title i {
    color: #2196f3;
}

.balls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
}

.ball {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.red-ball {
    background-color: #ffebee;
    color: #e53935;
    border: 2px solid #ffcdd2;
}

.blue-ball {
    background-color: #e3f2fd;
    color: #2196f3;
    border: 2px solid #bbdefb;
}

.selected {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.red-ball.selected {
    background-color: #e53935;
    color: white;
    border-color: #e53935;
}

.blue-ball.selected {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
}

.blinking {
    animation: blink 0.4s infinite alternate;
}

@keyframes blink {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 16px 10px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn:active {
    transform: translateY(2px);
}

.btn-start {
    background-color: #4caf50;
    color: white;
}

.btn-start:active {
    background-color: #388e3c;
}

.btn-confirm {
    background-color: #ff9800;
    color: white;
}

.btn-confirm:active {
    background-color: #f57c00;
}

.btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.selected-numbers {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.selected-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.selected-title h2 {
    font-size: 1.2rem;
    color: #444;
}

.counter {
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.current-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 10px;
    min-height: 70px;
}

.empty-selection {
    color: #999;
    font-style: italic;
}

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

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

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

.history-index {
    color: #999;
    font-size: 0.9rem;
    min-width: 30px;
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-style: italic;
}

.separator {
    color: #666;
    font-weight: bold;
    margin: 0 5px;
}

.instructions {
    background-color: #e8f5e9;
    border-radius: 12px;
    padding: 15px;
    font-size: 0.9rem;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.instructions h3 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

footer {
    text-align: center;
    padding: 15px;
    color: #777;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

/* 响应式调整 */
@media (max-width: 400px) {
    .ball {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    .selection-ball {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .btn {
        font-size: 1rem;
        padding: 14px 8px;
    }
}

@media (max-width: 360px) {
    .ball {
        width: 33px;
        height: 33px;
        font-size: 0.8rem;
    }
    
    .balls-container {
        gap: 5px;
    }
}