/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(to right, #c62828, #d32f2f);
    color: white;
    padding: 25px 0 15px;
    border-bottom: 5px solid #ffd700;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    margin-right: 15px;
    color: #ffd700;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.subtitle p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 500;
}

.header-decoration {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.decoration-center {
    display: flex;
    gap: 20px;
}

.decoration-center i {
    color: #ffd700;
    font-size: 1.2rem;
}

/* 导航样式 */
.main-nav {
    display: flex;
    justify-content: center;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.nav-item {
    padding: 18px 30px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-item i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.nav-item:hover {
    background-color: #f8f9fa;
    color: #c62828;
}

.nav-item.active {
    color: #c62828;
    border-bottom-color: #c62828;
    background-color: #fff5f5;
}

/* 主内容区域 */
.main-content {
    padding-bottom: 40px;
}

/* 首页样式 */
.welcome-page {
    animation: fadeIn 0.8s ease;
}

.welcome-banner {
    background: linear-gradient(to right, #1976d2, #2196f3);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 16px rgba(25, 118, 210, 0.2);
}

.banner-content h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

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

.banner-decoration i {
    font-size: 5rem;
    opacity: 0.8;
}

.system-intro {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #4caf50;
}

.system-intro h3 {
    color: #2e7d32;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.system-intro h3 i {
    margin-right: 10px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.feature-card {
    background-color: white;
    border-radius: 10px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #c62828;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 3rem;
    color: #c62828;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.feature-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.7;
}

.feature-btn {
    background: linear-gradient(to right, #c62828, #d32f2f);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.feature-btn:hover {
    background: linear-gradient(to right, #b71c1c, #c62828);
    transform: scale(1.05);
}

.instructions {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #ff9800;
}

.instructions h3 {
    color: #f57c00;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.instructions h3 i {
    margin-right: 10px;
}

.instructions ol {
    padding-left: 25px;
}

.instructions li {
    margin-bottom: 10px;
    padding-left: 10px;
}

/* 抽奖页面样式 */
.draw-page {
    animation: fadeIn 0.8s ease;
}

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

.page-header h2 {
    font-size: 2rem;
    color: #c62828;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-header h2 i {
    margin-right: 15px;
}

.page-subtitle {
    font-size: 1.2rem;
    color: #666;
}

.draw-container {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.draw-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.control-panel {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn i {
    margin-right: 8px;
}

.draw-button {
    background: linear-gradient(to right, #c62828, #d32f2f);
    color: white;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.draw-button:hover {
    background: linear-gradient(to right, #b71c1c, #c62828);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.4);
}

.reset-button {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.reset-button:hover {
    background-color: #e0e0e0;
    color: #333;
}

.stats-panel {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    min-width: 120px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #c62828;
}

/* 结果显示区域 */
.result-display {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px dashed #ddd;
}

.result-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.result-content {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #aaa;
}

.result-placeholder i {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.result-placeholder p {
    font-size: 1.2rem;
}

.result-details {
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.result-header h3 {
    font-size: 2.2rem;
    color: #c62828;
    font-weight: 700;
}

.result-badge {
    background: linear-gradient(to right, #ff9800, #ff5722);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

.prize-badge {
    background: linear-gradient(to right, #4caf50, #2e7d32);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.3);
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-item {
    background-color: white;
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
}

.info-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

/* 待抽人员/奖品列表 */
.candidates-section, .prizes-section {
    margin-bottom: 30px;
}

.candidates-section h3, .prizes-section h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.candidates-section h3 i, .prizes-section h3 i {
    margin-right: 10px;
    color: #c62828;
}

.candidates-list, .prizes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.candidate-item, .prize-item {
    background-color: white;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #2196f3;
    transition: transform 0.2s ease;
}

.prize-item {
    border-left-color: #4caf50;
}

.candidate-item:hover, .prize-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.08);
}

.candidate-info, .prize-info {
    flex-grow: 1;
}

.candidate-name, .prize-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.candidate-department {
    font-size: 0.9rem;
    color: #666;
}

.prize-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.prize-stats .stat {
    font-size: 0.9rem;
    color: #666;
}

.progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, #4caf50, #2e7d32);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.candidate-status, .prize-status {
    font-weight: 600;
    color: #4caf50;
    padding: 5px 12px;
    background-color: #e8f5e9;
    border-radius: 50px;
    font-size: 0.9rem;
}

.empty-list {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

/* 代码审计部分 */
.code-audit-section {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
    border-left: 5px solid #673ab7;
}

.code-audit-section h3 {
    color: #673ab7;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.code-audit-section h3 i {
    margin-right: 10px;
}

.code-explanation {
    line-height: 1.7;
}

.code-explanation p {
    margin-bottom: 15px;
}

.audit-btn {
    background: linear-gradient(to right, #673ab7, #512da8);
    color: white;
    margin-top: 15px;
}

.audit-btn:hover {
    background: linear-gradient(to right, #5e35b1, #4527a0);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(to right, #333, #555);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ffd700;
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.code-section {
    border-bottom: 1px solid #eee;
    padding: 25px 30px;
}

.code-section:last-child {
    border-bottom: none;
}

.code-section h3 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.code-section h3 i {
    margin-right: 10px;
    color: #c62828;
}

pre {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 4px solid #c62828;
}

code {
    color: #333;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 25px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

.footer p {
    margin-bottom: 5px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes highlight {
    0% { background-color: transparent; }
    50% { background-color: rgba(255, 215, 0, 0.2); }
    100% { background-color: transparent; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .subtitle p {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .draw-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-panel {
        justify-content: center;
    }
    
    .stats-panel {
        justify-content: center;
    }
    
    .info-item {
        grid-column: 1 / -1;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* 新增动效样式 */
@keyframes jump {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-15px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-8px); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

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

@keyframes shake {
    0% { transform: translateX(0); }
    10% { transform: translateX(-5px); }
    20% { transform: translateX(5px); }
    30% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    90% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(198, 40, 40, 0.5); }
    50% { box-shadow: 0 0 20px rgba(198, 40, 40, 0.8), 0 0 30px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 5px rgba(198, 40, 40, 0.5); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 抽奖中动画效果 */
.drawing-animation {
    animation: jump 0.5s infinite, pulse 1s infinite, glow 1.5s infinite;
}

.drawing-animation-fast {
    animation: jump 0.3s infinite, shake 0.5s infinite, blink 0.4s infinite;
}

/* 中奖结果展示动画 */
.winner-reveal {
    animation: bounce 0.8s ease, glow 1s ease 0.5s;
}

.prize-reveal {
    animation: bounce 0.8s ease, rotate 0.5s ease, glow 1s ease 0.5s;
}

/* 候选项目悬停效果 */
.candidate-item:hover, .prize-item:hover {
    animation: float 0.6s ease;
}

/* 抽奖按钮动画 */
.draw-button.pulsing {
    animation: pulse 0.8s infinite, glow 1.2s infinite;
}

/* 数字变化动画 */
.number-change {
    animation: pulse 0.3s ease;
}

/* 抽奖过程中的闪烁效果 */
.blinking {
    animation: blink 0.6s infinite;
}

/* 快速切换容器 */
.quick-switch-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.quick-switch-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.5s ease, opacity 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quick-switch-item.hidden {
    opacity: 0;
    transform: translateY(20px);
}

.quick-switch-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.quick-switch-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 10px;
    text-align: center;
}

.quick-switch-department {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 15px;
}

.quick-switch-label {
    font-size: 1.1rem;
    color: #888;
    font-style: italic;
}

.quick-switch-prize {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
}

/* 加载动画 */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading-dots div {
    position: absolute;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #c62828;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading-dots3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes loading-dots2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* 抽奖过程中的特效 */
.drawing-effect {
    position: relative;
}

.drawing-effect::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #c62828, #ffd700, #c62828);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    animation: drawing-glow 1s infinite alternate;
}

@keyframes drawing-glow {
    from { opacity: 0.3; filter: blur(5px); }
    to { opacity: 0.7; filter: blur(8px); }
}

/* 数字计数器动画 */
.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: #c62828;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

/* 烟花特效容器 */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: firework-explode 1s ease-out forwards;
}

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

/* 音效控制 */
.sound-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    background: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sound-control:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.sound-control i {
    font-size: 1.5rem;
    color: #c62828;
}

/* 动效说明 */
.animation-explanation {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #2196f3;
}

.animation-explanation h4 {
    color: #1976d2;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.animation-explanation h4 i {
    margin-right: 8px;
}

.animation-explanation p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}