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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f8ff;
    color: #333;
    line-height: 1.6;
}

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

.top-message {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.top-message h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.heart-gif {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: heartbeat 2s ease-in-out infinite;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

header p {
    font-size: 1.2rem;
    color: #fff;
}

main {
    background-color: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.level-selector {
    margin-bottom: 30px;
    text-align: center;
}

.level-selector h2 {
    margin-bottom: 15px;
    color: #ff6b6b;
}

.levels {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.level-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f0f0f0;
    color: #333;
}

.level-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.level-btn.active {
    background-color: #4ecdc4;
    color: #fff;
}

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

.text-display h2 {
    margin-bottom: 15px;
    color: #45b7d1;
}

#target-text {
    font-size: 1.5rem;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 15px;
    border: 2px dashed #4ecdc4;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #333;
}

.input-section {
    margin-bottom: 30px;
    text-align: center;
}

#user-input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.hint {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

#user-input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

#user-input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#start-btn {
    background-color: #4ecdc4;
    color: #fff;
}

#start-btn:hover:not(:disabled) {
    background-color: #45b7d1;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#next-btn {
    background-color: #45b7d1;
    color: #fff;
}

#next-btn:hover:not(:disabled) {
    background-color: #3a9cb0;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#reset-btn {
    background-color: #ff6b6b;
    color: #fff;
}

#reset-btn:hover:not(:disabled) {
    background-color: #ee5a52;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    background-color: #f9f9f9;
    padding: 15px 25px;
    border-radius: 15px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.stat-item span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ecdc4;
}

.feedback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback.show {
    opacity: 1;
    visibility: visible;
}

.feedback-content {
    background-color: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    transform: translateY(-50px);
    transition: all 0.3s ease;
}

.feedback.show .feedback-content {
    transform: translateY(0);
}

.feedback-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #4ecdc4;
}

.feedback-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
    white-space: pre-line; /* 保留换行符 */
    line-height: 1.5;
}

#feedback-btn {
    background-color: #ff6b6b;
    color: #fff;
    padding: 15px 30px;
    font-size: 1.1rem;
}

#feedback-btn:hover {
    background-color: #ee5a52;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #4ecdc4;
    color: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

footer p {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    #target-text {
        font-size: 1.2rem;
        padding: 15px;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-item {
        width: 100%;
        max-width: 200px;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 100%;
        max-width: 200px;
    }
}

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

.celebrate {
    animation: celebrate 0.5s ease-in-out;
}
