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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    transition: background 0.3s ease;
}

body.dark-mode .container {
    background: #2d2d44;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
    transition: color 0.3s ease;
}

body.dark-mode h1 {
    color: #fff;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
    transition: color 0.3s ease;
}

body.dark-mode .subtitle {
    color: #aaa;
}

.lottery-area {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    transition: background 0.3s ease;
}

body.dark-mode .lottery-area {
    background: linear-gradient(135deg, #4a4a6a 0%, #5a5a7a 100%);
}

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

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

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

.red-ball {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.blue-ball {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.separator {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0 10px;
}

.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 15px 40px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.clear-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.4);
}

.clear-btn:active {
    transform: translateY(0);
}

.history-section {
    margin-top: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    transition: background 0.3s ease;
}

body.dark-mode .history-section {
    background: #3a3a5a;
}

.history-title {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
    transition: color 0.3s ease;
}

body.dark-mode .history-title {
    color: #fff;
}

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

.history-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

body.dark-mode .history-item {
    background: #4a4a6a;
}

.history-balls {
    display: flex;
    gap: 5px;
    align-items: center;
}

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

.history-time {
    color: #999;
    font-size: 12px;
    transition: color 0.3s ease;
}

body.dark-mode .history-time {
    color: #bbb;
}

@keyframes pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ball-animate {
    animation: pop 0.5s ease forwards;
}

.stats {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
    transition: color 0.3s ease;
}

body.dark-mode .stats {
    color: #aaa;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

body.dark-mode .theme-toggle {
    background: #2d2d44;
}

.theme-toggle:hover {
    transform: scale(1.1);
}
