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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景渐变动画 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 烟花背景装饰 */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0;
}

#firework1 {
    background: radial-gradient(circle, #ff0080 0%, transparent 70%);
    top: 20%;
    left: 20%;
    animation: fireworkExplosion 4s ease-in-out infinite;
}

#firework2 {
    background: radial-gradient(circle, #00ff88 0%, transparent 70%);
    top: 30%;
    right: 20%;
    animation: fireworkExplosion 5s ease-in-out infinite 1s;
}

#firework3 {
    background: radial-gradient(circle, #0080ff 0%, transparent 70%);
    bottom: 20%;
    left: 30%;
    animation: fireworkExplosion 6s ease-in-out infinite 2s;
}

#firework4 {
    background: radial-gradient(circle, #ffff00 0%, transparent 70%);
    bottom: 30%;
    right: 30%;
    animation: fireworkExplosion 7s ease-in-out infinite 3s;
}

@keyframes fireworkExplosion {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    10% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(10);
        opacity: 0;
    }
}

/* 页面标题 */
.header {
    text-align: center;
    padding: 20px;
    z-index: 2;
    position: relative;
}

.title {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    animation: bounce 2s ease-in-out infinite;
}

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

/* 倒计时 */
.countdown-container {
    text-align: center;
    padding: 20px;
    z-index: 2;
    position: relative;
}

.countdown-container h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.countdown-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 100px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
    to { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.6); }
}

.countdown-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff6b6b;
}

.countdown-label {
    display: block;
    font-size: 1rem;
    color: #333;
    margin-top: 5px;
}

/* 主体内容 */
.main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    z-index: 2;
    position: relative;
}

/* 显示区域 */
.display-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 60px 20px;
    margin-bottom: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    backdrop-filter: blur(15px);
}

.display {
    font-size: 3rem;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: displayPulse 1s ease-in-out infinite;
}

/* 5秒倒计时样式 */
.roll-countdown {
    font-size: 1.5rem;
    color: #ff8e53;
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.roll-countdown.show {
    opacity: 1;
}

.countdown-number-large {
    font-size: 2.5rem;
    color: #ff6b6b;
    animation: countdownPulse 1s ease-in-out infinite;
}

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

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



/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    min-width: 150px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

.btn-start {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    color: white;
}



.btn-reset {
    background: linear-gradient(45deg, #96ceb4, #ffeead);
    color: #333;
}

/* 历史记录 */
.history-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.history-container h3 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.history {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.history li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 1.1rem;
    animation: slideIn 0.5s ease-out;
}

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

.history li::before {
    content: "🎊 ";
    margin-right: 10px;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    z-index: 2;
    position: relative;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .countdown {
        gap: 10px;
    }
    
    .countdown-item {
        min-width: 80px;
        padding: 15px;
    }
    
    .countdown-number {
        font-size: 2rem;
    }
    
    .display {
        font-size: 2.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
}

/* 新年特效 */
.new-year-effect {
    animation: newYearCelebration 3s ease-in-out;
}

@keyframes newYearCelebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.5) rotate(360deg); }
    100% { transform: scale(1); }
}

/* 雪花效果 */
.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        top: -10%;
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}