* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --border-color: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #2980b9;
    --secondary-color: #27ae60;
    --background-color: #1a1a1a;
    --card-background: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    text-align: center;
    color: var(--text-color);
    font-size: 2.5rem;
    margin: 0;
}

h2 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.theme-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.3s;
}

.theme-button:hover {
    transform: rotate(360deg);
}

.input-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 2rem;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-size: 1rem;
    margin-bottom: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.draw-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

input[type="number"],
select {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-background);
    color: var(--text-color);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.secondary-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.secondary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.lottery-display {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.animation-container {
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.winner-display {
    text-align: center;
}

.winner-name {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.winner-number {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.winners-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.winner-card {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-align: center;
    min-width: 150px;
}

.summary-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 2rem;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: var(--background-color);
}

.summary-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.summary-label {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.history-section {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
}

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

.history-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.history-item:hover {
    transform: translateX(10px);
}

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

.history-item .timestamp {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
}

.history-item .winners {
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}