/* 我来考考你 - 卡通风格样式 */

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

:root {
    --primary-color: #FF85A2;
    --secondary-color: #FFB6C1;
    --accent-color: #FFEAA7;
    --success-color: #81C784;
    --error-color: #FF8A80;
    --bg-gradient: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 50%, #FFE4E1 100%);
    --card-shadow: 0 10px 30px rgba(255,182,193,0.4);
    --text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');

body {
    font-family: 'ZCOOL KuaiLe', 'Comic Sans MS', 'Chalkboard', cursive, sans-serif;
    background-color: #FFE4E1;
    /* background-image: url('images/bg.jpg'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: repeat;
    min-height: 100vh;
    color: #333;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 标题样式 */
.title-container {
    text-align: center;
    margin-bottom: 30px;
}

.game-title {
    font-size: 4rem;
    color: #fff;
    /* text-shadow: 3px 3px 0 var(--primary-color),  */
                 /* 6px 6px 0 rgba(0,0,0,0.2); */
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-top: 10px;
}

/* 关卡网格 */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.level-card {
    aspect-ratio: 1;
    background: #fff;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.level-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--accent-color);
}

.level-card:active {
    transform: scale(0.95);
}

.level-card .level-num {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.level-card.completed {
    background: linear-gradient(135deg, #81C784, #66BB6A);
}

.level-card.completed .level-num {
    color: #fff;
}

.level-card.completed::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 1.2rem;
    color: #fff;
}

/* 游戏界面 */
.game-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.btn-back {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-back:hover {
    background: #fff;
    transform: scale(1.05);
}

.level-title {
    color: #fff;
    font-size: 1.5rem;
    text-shadow: var(--text-shadow);
}

.game-content {
    width: 100%;
    max-width: 600px;
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

/* 提示图片 */
.puzzle-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
}

.puzzle-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

/* 提示区域 */
.tips-container {
    background: linear-gradient(135deg, var(--accent-color), #FFD93D);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
}

.tips-container h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

#tips-list {
    list-style: none;
    padding-left: 10px;
}

#tips-list li {
    padding: 8px 0;
    font-size: 1.1rem;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
}

#tips-list li:last-child {
    border-bottom: none;
}

#tips-list li::before {
    content: '🔹 ';
}

/* 答案填空区域 */
.answer-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.slot {
    width: 60px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 15px;
    transition: all 0.3s ease;
    animation: pop 0.3s ease;
}

.slot.input-slot {
    background: #f0f0f0;
    border: 3px dashed var(--secondary-color);
}

.slot.input-slot input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: inherit;
    outline: none;
    color: var(--primary-color);
}

.slot.input-slot:focus-within {
    border-style: solid;
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
}

.slot.fixed-slot {
    background: linear-gradient(135deg, #FF85A2, #FF6B8A);
    color: #fff;
    border: 3px solid #FF85A2;
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    padding: 18px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), #EE5A5A);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 5px 20px rgba(255,107,107,0.4);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,107,107,0.5);
}

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

/* 结果界面 */
.result-content {
    text-align: center;
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    max-width: 500px;
    width: 100%;
}

.result-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

.result-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.result-content.success h2 {
    color: var(--success-color);
}

.result-content.fail h2 {
    color: var(--error-color);
}

#result-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.result-image {
    margin: 20px 0;
    border-radius: 15px;
    overflow: hidden;
}

.result-image img {
    max-width: 100%;
    max-height: 200px;
}

.correct-answer {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.correct-answer strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.result-buttons button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-retry {
    background: linear-gradient(135deg, var(--error-color), #EE5A5A);
    color: #fff;
}

.btn-next {
    background: linear-gradient(135deg, #81C784, #66BB6A);
    color: #fff;
}

.btn-back-levels {
    background: linear-gradient(135deg, #868E96, #6C757D);
    color: #fff;
}

.result-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 音频按钮 */
.audio-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .level-card {
        border-radius: 15px;
    }
    
    .level-card .level-num {
        font-size: 1.5rem;
    }
    
    .slot {
        width: 50px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .slot.input-slot input {
        font-size: 1.4rem;
    }
    
    .game-content {
        padding: 20px;
        border-radius: 20px;
    }
    
    .tips-container {
        padding: 15px;
    }
    
    #tips-list li {
        font-size: 1rem;
    }
    
    .btn-submit {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .result-content {
        padding: 25px;
    }
    
    .result-icon {
        font-size: 4rem;
    }
}

@media (max-width: 400px) {
    #app {
        padding: 10px;
    }
    
    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .slot {
        width: 45px;
        height: 55px;
    }
    
    .answer-slots {
        gap: 6px;
    }
}
