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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.game-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 15px;
}

/* 句子显示区域 */
.sentence-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

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

.sentence-text {
    font-size: 2.5em;
    font-weight: 600;
    line-height: 1.2;
    color: #2d3748;
    letter-spacing: 2px;
    word-spacing: 8px;
}

.sentence-text .letter {
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.sentence-text .letter.completed {
    background-color: #48bb78;
    color: white;
}

.sentence-text .letter.current {
    background-color: #4299e1;
    color: white;
    animation: pulse 1s infinite;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    color: #4a5568;
}

.new-sentence-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.new-sentence-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4);
}

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

/* 键盘区域 */
.keyboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 0 20px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.key {
    background: linear-gradient(145deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.8em;
    font-weight: 700;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    user-select: none;
    
    /* 标准按键尺寸 */
    width: 70px;
    height: 70px;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border-color: #cbd5e0;
}

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

/* 空格键特殊样式 */
.space-key {
    width: 300px;
    font-size: 1.4em;
}

/* 标点符号键 */
.punctuation-key {
    width: 70px;
}

/* 按键状态样式 */
.key.correct {
    background: linear-gradient(145deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-color: #2f855a;
    animation: correctKey 0.5s ease;
}

.key.incorrect {
    background: linear-gradient(145deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border-color: #c53030;
    animation: incorrectKey 0.5s ease;
}

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

@keyframes incorrectKey {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sentence-text {
        font-size: 2em;
    }
    
    .key {
        width: 60px;
        height: 60px;
        font-size: 1.6em;
    }
    
    .space-key {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 8px;
        gap: 10px;
    }
    
    .sentence-container {
        padding: 15px;
    }
    
    .sentence-text {
        font-size: 1.8em;
        letter-spacing: 1px;
        word-spacing: 6px;
    }
    
    .key {
        width: 50px;
        height: 50px;
        font-size: 1.4em;
    }
    
    .space-key {
        width: 200px;
        font-size: 1.2em;
    }
    
    .keyboard-row {
        gap: 6px;
    }
    
    .keyboard-container {
        gap: 8px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .sentence-text {
        font-size: 1.5em;
    }
    
    .key {
        width: 42px;
        height: 42px;
        font-size: 1.2em;
    }
    
    .space-key {
        width: 160px;
        font-size: 1em;
    }
    
    .keyboard-row {
        gap: 4px;
    }
}

/* 强制横屏提示 */
@media (orientation: portrait) and (max-width: 768px) {
    .game-container::before {
        content: "请将设备横置以获得最佳体验";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 20px;
        border-radius: 10px;
        font-size: 1.2em;
        text-align: center;
        z-index: 1000;
    }
    
    .game-container > * {
        opacity: 0.3;
        pointer-events: none;
    }
}
