* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; user-select: none; } .container { width: 100%; max-width: 400px; height: 90vh; max-height: 700px; background: white; border-radius: 20px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); overflow: hidden; position: relative; } /* 开始界面 */ .start-screen { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 30px; background: linear-gradient(135deg, #FFE5B4 0%, #FFA500 100%); } .title { font-size: 32px; font-weight: bold; color: #333; margin-bottom: 30px; text-align: center; } .mode-selection { text-align: center; margin-bottom: 40px; } .mode-title { font-size: 20px; font-weight: bold; color: #333; margin-bottom: 20px; display: block; } .mode-hint { font-size: 16px; color: #666; line-height: 1.6; display: block; max-width: 300px; } .start-btn { background: linear-gradient(45deg, #4CAF50, #45a049); color: white; border: none; padding: 15px 40px; font-size: 18px; border-radius: 25px; cursor: pointer; box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); transition: all 0.3s ease; } .start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4); } .start-btn:active { transform: translateY(0); } /* 游戏界面 */ .game-screen { height: 100%; display: flex; flex-direction: column; background: #f5f5f5; } .game-header { background: linear-gradient(45deg, #2196F3, #1976D2); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } .home-btn { font-size: 20px; cursor: pointer; padding: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); transition: background 0.3s; } .home-btn:hover { background: rgba(255, 255, 255, 0.3); } .level-info, .correct-info { text-align: center; } .label { font-size: 12px; opacity: 0.8; display: block; } .value { font-size: 20px; font-weight: bold; display: block; margin-top: 2px; } /* 输入显示区域 */ .input-display { flex: 1; display: flex; justify-content: center; align-items: center; padding: 30px 20px; } .input-box { width: 100%; max-width: 300px; min-height: 80px; background: white; border: 3px solid #ddd; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; color: #333; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: relative; } .input-placeholder { position: absolute; color: #999; font-size: 16px; font-weight: normal; } .input-text { color: #2196F3; letter-spacing: 5px; } /* 重听按钮 */ .replay-container { display: flex; justify-content: center; padding: 20px; } .replay-button { font-size: 40px; cursor: pointer; padding: 15px; border-radius: 50%; background: white; border: 3px solid #ddd; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; } .replay-button:hover { transform: scale(1.1); border-color: #2196F3; } .replay-button.replay-disabled { opacity: 0.5; cursor: not-allowed; } .replay-button.replay-disabled:hover { transform: none; border-color: #ddd; } /* 数字键盘 */ .keyboard { background: white; padding: 20px; border-top: 1px solid #eee; } .keyboard-row { display: flex; justify-content: space-between; margin-bottom: 10px; } .keyboard-row:last-child { margin-bottom: 0; } .key-btn { flex: 1; margin: 0 5px; height: 60px; background: #f8f8f8; border: 2px solid #ddd; border-radius: 15px; font-size: 20px; font-weight: bold; color: #333; cursor: pointer; transition: all 0.2s ease; } .key-btn:hover { background: #e3f2fd; border-color: #2196F3; transform: translateY(-2px); } .key-btn:active { transform: translateY(0); background: #bbdefb; } .key-btn.keyboard-disabled { opacity: 0.5; cursor: not-allowed; } .key-btn.keyboard-disabled:hover { background: #f8f8f8; border-color: #ddd; transform: none; } .key-btn.backspace-btn { background: #fff3e0; border-color: #ff9800; color: #ff9800; } .key-btn.backspace-btn:hover { background: #ffe0b2; border-color: #f57c00; } .key-btn.confirm-btn { background: #e8f5e8; border-color: #4CAF50; color: #4CAF50; } .key-btn.confirm-btn:hover { background: #c8e6c9; border-color: #45a049; } .key-btn.confirm-btn.disabled { background: #f5f5f5; border-color: #ccc; color: #999; cursor: not-allowed; } /* 结果弹窗 */ .result-popup { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; animation: popupShow 0.3s ease-out; } @keyframes popupShow { from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } } .popup-content { background: white; padding: 30px 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); text-align: center; min-width: 200px; } .popup-icon { font-size: 40px; margin-bottom: 10px; display: block; } .popup-text { font-size: 18px; font-weight: bold; display: block; } .success-popup .popup-icon { color: #4CAF50; } .success-popup .popup-text { color: #2e7d32; } .fail-popup .popup-icon { color: #f44336; } .fail-popup .popup-text { color: #c62828; } /* 升级动画 */ .level-up-animation { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 999; font-size: 60px; color: #4CAF50; font-weight: bold; animation: levelUp 2s ease-in-out; } @keyframes levelUp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); } } /* 加载状态 */ .loading { display: flex; justify-content: center; align-items: center; height: 200px; } .loading-text { font-size: 16px; color: #666; } /* 响应式设计 */ @media (max-width: 480px) { .container { height: 100vh; max-height: none; border-radius: 0; } .key-btn { height: 50px; font-size: 18px; } .title { font-size: 28px; } }