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

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

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    position: relative;
}

.sound-toggle {
    position: absolute;
    top: 20px;
    right: 140px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.sound-toggle.muted {
    background: linear-gradient(135deg, #999 0%, #666 100%);
}

.fullscreen-toggle {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    border: 3px solid white;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.5);
    animation: pulse-fullscreen 2s ease-in-out infinite;
}

@keyframes pulse-fullscreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 5px 15px rgba(255, 87, 34, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(255, 87, 34, 0.8);
    }
}

.fullscreen-toggle:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 30px rgba(255, 87, 34, 0.8);
    background: linear-gradient(135deg, #ff5722 0%, #ff3d00 100%);
}

/* 全屏模式样式 */
body.fullscreen-mode {
    overflow: hidden;
}

/* 确保退出全屏后正常显示 */
body:not(.fullscreen-mode) {
    overflow: auto;
}

body:not(.fullscreen-mode) .container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 30px;
}

body.fullscreen-mode .container {
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

body.fullscreen-mode .settings-panel {
    display: none;
}

body.fullscreen-mode .stage-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

body.fullscreen-mode .seat-map {
    flex: 1;
    max-height: none;
}

body.fullscreen-mode .controls {
    margin-bottom: 10px;
}

body.fullscreen-mode .statistics {
    margin-bottom: 10px;
}

body.fullscreen-mode .results-panel {
    position: fixed;
    bottom: 10px;
    right: 10px;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(248, 249, 250, 0.95);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.settings-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.settings-panel h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.setting-group {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 15px;
}

.setting-group label {
    color: #666;
    margin-right: 10px;
    font-weight: 500;
}

.setting-group input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.setting-group input[type="text"] {
    width: 200px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.setting-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

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

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

.btn-secondary {
    background: linear-gradient(135deg, #89a7e0 0%, #6c93d1 100%);
    color: white;
    margin: 0 5px;
}

.btn-secondary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(108, 147, 209, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #56c596 0%, #3ba77c 100%);
    color: white;
    margin-right: 10px;
}

.btn-success:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(86, 197, 150, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    color: white;
}

.btn-danger:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    color: white;
    margin-right: 15px;
}

.btn-warning:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 152, 0, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    margin-right: 10px;
}

.btn-info:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 188, 212, 0.4);
}

.stage-area {
    position: relative;
    margin-bottom: 30px;
}

.stage-label {
    text-align: center;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.3);
}

.seat-map {
    display: grid;
    gap: 6px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
    justify-content: center;
    align-content: start;
}

:root {
    --seat-size: 45px;
    --seat-font-size: 11px;
}

.seat {
    width: var(--seat-size);
    height: var(--seat-size);
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    border: 2px solid #999;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--seat-font-size);
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.seat:hover:not(.selected):not(.winner) {
    transform: scale(1.1);
    background: linear-gradient(135deg, #f0f0f0 0%, #ccc 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.seat.checking {
    animation: checking 0.5s ease-in-out;
    background: linear-gradient(135deg, #ffd93d 0%, #ffb300 100%);
    border-color: #ff9800;
}

@keyframes checking {
    0%, 100% { transform: scale(1) rotateY(0deg); }
    50% { transform: scale(1.2) rotateY(180deg); }
}

.seat.winner {
    animation: winner 1s ease-in-out;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    border-color: #ff3838;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
    z-index: 10;
}

.seat.new-winner {
    animation: newWinner 2s ease-in-out;
    background: linear-gradient(135deg, #ffeb3b 0%, #ff9800 100%);
    border: 3px solid #ff6b6b;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 30px rgba(255, 235, 59, 0.8);
    z-index: 20;
    transform: scale(1.2);
}

@keyframes newWinner {
    0% { 
        transform: scale(0) rotate(0deg);
        box-shadow: 0 0 0 rgba(255, 235, 59, 0);
    }
    25% { 
        transform: scale(1.5) rotate(180deg);
        box-shadow: 0 0 40px rgba(255, 235, 59, 1);
    }
    50% { 
        transform: scale(1.3) rotate(360deg);
        box-shadow: 0 0 50px rgba(255, 107, 107, 1);
    }
    75% { 
        transform: scale(1.4) rotate(540deg);
        box-shadow: 0 0 40px rgba(255, 235, 59, 1);
    }
    100% { 
        transform: scale(1.2) rotate(720deg);
        box-shadow: 0 0 30px rgba(255, 235, 59, 0.8);
    }
}

@keyframes winner {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(10deg); }
    50% { transform: scale(1.5) rotate(-10deg); }
    75% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1.2) rotate(0deg); }
}

.seat.selected {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border: 4px solid;
    border-image: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3) 1;
    color: white;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    transform: scale(1.1);
    animation: rainbow-border 2s linear infinite;
}

@keyframes rainbow-border {
    0% {
        border-image: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3) 1;
    }
    16.66% {
        border-image: linear-gradient(45deg, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000) 1;
    }
    33.33% {
        border-image: linear-gradient(45deg, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000, #ff7f00) 1;
    }
    50% {
        border-image: linear-gradient(45deg, #00ff00, #0000ff, #4b0082, #9400d3, #ff0000, #ff7f00, #ffff00) 1;
    }
    66.66% {
        border-image: linear-gradient(45deg, #0000ff, #4b0082, #9400d3, #ff0000, #ff7f00, #ffff00, #00ff00) 1;
    }
    83.33% {
        border-image: linear-gradient(45deg, #4b0082, #9400d3, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff) 1;
    }
    100% {
        border-image: linear-gradient(45deg, #9400d3, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082) 1;
    }
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.btn-draw {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    font-size: 18px;
    padding: 15px 40px;
    margin-right: 15px;
    position: relative;
    overflow: hidden;
}

.btn-fullscreen {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
    font-size: 18px;
    padding: 15px 30px;
    margin-right: 15px;
}

.btn-fullscreen:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 87, 34, 0.6);
    background: linear-gradient(135deg, #ff5722 0%, #ff3d00 100%);
}

.btn-draw:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 233, 123, 0.4);
}

.btn-draw:not(:disabled):active {
    transform: translateY(-1px);
}

.btn-reset {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.btn-reset:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(250, 112, 154, 0.4);
}

.results-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.results-panel.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-panel h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.winners-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.winner-item {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    animation: bounceIn 0.6s ease-out;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.firework {
    position: fixed;
    pointer-events: none;
    animation: firework 1s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(1);
        opacity: 0;
    }
}

.firework-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff6b6b, #ff3838);
}

/* 彩带效果 */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0);
    animation: confettiFall 3s ease-in-out forwards;
    z-index: 100;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-ribbon {
    position: fixed;
    width: 4px;
    height: 100px;
    background: linear-gradient(180deg, #ff6b6b, #ff9800, #ffeb3b);
    animation: ribbonFall 2.5s ease-in-out forwards;
    z-index: 100;
    transform-origin: top center;
}

@keyframes ribbonFall {
    0% {
        transform: translateY(-100vh) rotateZ(0deg) scaleY(1);
        opacity: 1;
    }
    50% {
        transform: translateY(20vh) rotateZ(180deg) scaleY(1.5);
    }
    100% {
        transform: translateY(100vh) rotateZ(360deg) scaleY(1);
        opacity: 0;
    }
}

/* 闪光效果 */
.sparkle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkle 1s ease-out forwards;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    z-index: 101;
}

@keyframes sparkle {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.venue-controls {
    margin-bottom: 20px;
}

.venue-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.venue-selector select {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    min-width: 200px;
}

.venue-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.statistics {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.statistics span {
    color: #666;
    font-size: 16px;
}

.statistics strong {
    color: #333;
    font-size: 18px;
    margin-left: 5px;
}

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

.history-round {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.history-round h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.history-round .round-winners {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-round .winner-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .title {
        font-size: 1.8em;
    }
    
    /* 移动端座位大小由JS自动计算 */
    
    .setting-group {
        display: block;
        margin-bottom: 10px;
    }
    
    .venue-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .statistics {
        flex-direction: column;
        gap: 10px;
    }
}

/* 悬浮中奖展示 */
.floating-winner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

.floating-winner-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.floating-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.floating-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff3838 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 1s ease-in-out infinite;
}

.floating-winner-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    min-height: 200px;
}

.floating-winner-item {
    background: linear-gradient(135deg, #ffeb3b 0%, #ff9800 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    animation: bounceIn 0.6s ease-out;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
    transform: scale(1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.floating-winner-item:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.6);
}

.floating-winner-item.selected {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border: 3px solid;
    border-image: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff) 1;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    transform: scale(1.15);
    animation: selected-pulse 1s ease-in-out infinite;
}

@keyframes selected-pulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 0, 1);
    }
}

.floating-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.floating-buttons button {
    padding: 15px 40px;
    font-size: 1.2em;
}