/* 可爱倒计时器样式 - 专为小学生设计 */

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

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* 添加可爱的背景装饰 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2) 2px, transparent 2px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 2px, transparent 2px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.1) 3px, transparent 3px);
    background-size: 100px 100px, 150px 150px, 80px 80px;
    animation: sparkle 10s linear infinite;
}

@keyframes sparkle {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 10;
}

.header h1 {
    color: #ff6b9d;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s ease-in-out infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.header p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.timer-section {
    margin: 30px 0;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    color: #555;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: bold;
}

#timeInput {
    padding: 15px;
    font-size: 1.3em;
    border: 3px solid #ff6b9d;
    border-radius: 15px;
    width: 200px;
    text-align: center;
    background: linear-gradient(145deg, #fff 0%, #f8f9ff 100%);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#timeInput:focus {
    outline: none;
    border-color: #ff4757;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
    transform: scale(1.05);
}

.display-group {
    margin: 30px 0;
}

.time-display {
    font-size: 4em;
    font-weight: bold;
    color: #2c3e50;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 100%;
    border-radius: 10px;
    width: 100%;
    transition: width 1s ease;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.start-btn, .stop-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.start-btn {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.3);
}

.start-btn:active {
    transform: translateY(0);
}

.stop-btn {
    background: linear-gradient(135deg, #e17055, #fd79a8);
    color: white;
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 112, 85, 0.3);
}

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

.status-message {
    color: #636e72;
    font-size: 1.1em;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #a8e6cf, #dcedc1);
    border-radius: 15px;
    border-left: 5px solid #00b894;
    font-weight: 500;
}

/* 全屏闪烁效果 */
.flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ff4757;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.2s ease;
}

.flash-overlay.flash {
    opacity: 0.8;
}

/* 倒计时结束时的特殊样式 */
.time-display.finished {
    color: #ff4757 !important;
    background: linear-gradient(135deg, #ff4757, #ff3838);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1s ease-in-out infinite;
}

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

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .time-display {
        font-size: 3em;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .start-btn, .stop-btn {
        width: 200px;
        margin: 5px 0;
    }
}