/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
    background: #0a0a0a;
    color: #ffffff;
}

/* 背景效果 */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* 粒子效果 */
.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-50px) translateX(20px);
        opacity: 0.8;
    }
}

/* 渐变背景层 */
#background-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    opacity: 0.9;
}

/* 网格线效果 */
#background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 音乐控制按钮 */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    transition: all 0.3s ease;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
}

.music-toggle.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 60px;
}

.title {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    margin-bottom: 10px;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
    to {
        text-shadow: 0 0 40px rgba(102, 126, 234, 0.9), 0 0 20px rgba(118, 75, 162, 0.8);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 20px;
}

/* 导入区域 */
.import-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.import-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.import-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#fileInput {
    display: none;
}

.participants-count {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}

/* 导入信息提示 */
.import-info {
    font-size: 0.9rem;
    color: #667eea;
    font-style: italic;
    text-align: center;
    margin-bottom: 15px;
    background: rgba(102, 126, 234, 0.1);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.participants-list-container {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px;
}

.participants-list-container h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #ffffff;
}

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

.participant-tag {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.9rem;
    color: #ffffff;
    display: inline-block;
    backdrop-filter: blur(5px);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

/* 按钮内部发光效果 */
.btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    animation: shine 6s linear infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-lottery {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: #ffffff;
    font-size: 1.2rem;
    padding: 15px 40px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-lottery:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.btn-stop {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: #ffffff;
    font-size: 1.2rem;
    padding: 15px 40px;
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.4);
}

.btn-stop:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(254, 202, 87, 0.6);
}

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

/* 抽奖区域 */
.lottery-section {
    text-align: center;
    margin-bottom: 40px;
}

.prize-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.prize-display h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.lottery-display {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
}

.prize-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
    min-width: 300px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.prize-item.特等奖 {
    border: 2px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.prize-item.一等奖 {
    border: 2px solid #c0c0c0;
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.3);
}

.prize-item h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.prize-item.特等奖 h3 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.prize-item.一等奖 h3 {
    color: #c0c0c0;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.winner-display {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #b0b0b0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.winner-display.won {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: #ffffff;
    font-weight: bold;
    animation: winnerGlow 2s infinite alternate;
}

@keyframes winnerGlow {
    from {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 30px rgba(118, 75, 162, 0.6);
    }
}

.lottery-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* 自动停止时间设置样式 */
.auto-stop-settings {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.auto-stop-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.auto-stop-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.auto-stop-select option {
    background: #1a1a2e;
    color: #ffffff;
}

/* 抽奖动画区域 */
.lottery-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 300px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 100px rgba(102, 126, 234, 0.5);
}

.rolling-names {
    font-size: 3rem;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
    animation: modalAppear 0.5s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-result {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #ffffff;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 20px;
    }
    
    .import-controls {
        flex-direction: column;
    }
    
    .lottery-display {
        flex-direction: column;
        align-items: center;
    }
    
    .prize-item {
        min-width: 100%;
    }
    
    .lottery-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-lottery,
    .btn-stop {
        width: 100%;
        max-width: 300px;
    }
    
    .lottery-animation {
        width: 90%;
        height: 200px;
    }
    
    .rolling-names {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin: 2px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 20px;
    }
}

/* 加载状态样式 */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.loading-state {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    .participant-tag:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}