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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 出题区域 */
.question-section {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.progress {
    background: #e9ecef;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.question-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.question-text {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-input {
    width: 100%;
    max-width: 300px;
}

.answer-input input {
    width: 100%;
    padding: 20px;
    font-size: 32px;
    text-align: center;
    border: 3px solid #dee2e6;
    border-radius: 15px;
    background: white;
    color: #333;
    font-weight: 600;
    transition: all 0.3s ease;
}

.answer-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.result-message {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    min-height: 30px;
    margin-top: 20px;
}

.result-message.correct {
    color: #28a745;
}

.result-message.incorrect {
    color: #dc3545;
}

/* 键盘区域 */
.keypad-section {
    background: #f8f9fa;
    padding: 20px;
    border-top: 1px solid #dee2e6;
}

.keypad {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.keypad-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.key {
    padding: 20px;
    font-size: 24px;
    font-weight: 600;
    border: none;
    border-radius: 15px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.key:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.key:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delete-btn {
    background: #ff6b6b;
    color: white;
}

.delete-btn:hover {
    background: #ff5252;
}

.function-keys {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.function-btn {
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.function-btn:first-child {
    background: #6c757d;
    color: white;
}

.function-btn:first-child:hover {
    background: #5a6268;
}

.ok-btn {
    background: #28a745;
    color: white;
}

.ok-btn:hover {
    background: #218838;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.type-btn {
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.type-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.type-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.close-btn {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: #6c757d;
    color: white;
    cursor: pointer;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: #5a6268;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .question-text {
        font-size: 36px;
    }
    
    .answer-input input {
        font-size: 28px;
        padding: 15px;
    }
    
    .key {
        padding: 15px;
        font-size: 20px;
    }
    
    .function-btn {
        padding: 12px;
        font-size: 16px;
    }
    
    .type-options {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-display {
    animation: fadeIn 0.5s ease;
}

/* 触摸反馈 */
@media (hover: none) {
    .key:hover,
    .function-btn:hover,
    .type-btn:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
} 