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

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

.container {
    max-width: 1280px;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

header h1 {
    color: #e74c3c;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.game-area {
    position: relative;
    margin-bottom: 20px;
}

#gameCanvas {
    border: 3px solid #3498db;
    border-radius: 10px;
    background: #ecf0f1;
    max-width: 100%;
    height: auto;
}

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

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#startBtn {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
}

#resetBtn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.score-board {
    font-size: 18px;
    font-weight: bold;
    color: #34495e;
    background: #ecf0f1;
    padding: 10px 20px;
    border-radius: 20px;
}

.input-area {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#烦恼输入 {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    width: 300px;
    max-width: 100%;
}

#烦恼输入:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#addBtn {
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
}

.instructions {
    margin-top: 30px;
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.instructions h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.instructions ul {
    list-style-type: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
}

.instructions li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
    }
    
    #gameCanvas {
        width: 100%;
    }
    
    .container {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes flush {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8) translateY(20px); opacity: 0.8; }
    100% { transform: scale(0) translateY(50px); opacity: 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}