* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.translation-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section, .output-section {
    position: relative;
    width: 100%;
}

.input-controls {
    position: relative;
    width: 100%;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

#targetText {
    background-color: #f9f9f9;
}

select {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
}

.target-lang {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: #e8f4ff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #4a90e2;
}

button {
    padding: 12px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    align-self: center;
}

button:hover {
    background-color: #3a7bc8;
}

button:active {
    transform: scale(0.98);
}

.voice-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid #ddd;
    padding: 0;
    transition: all 0.3s;
}

.voice-btn svg {
    fill: #555;
    transition: fill 0.3s;
}

.voice-btn:hover {
    background-color: #e0e0e0;
}

.voice-btn.recording {
    background-color: #ff4a4a;
    animation: pulse 1.5s infinite;
}

.voice-btn.recording svg {
    fill: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 74, 74, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 74, 74, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 74, 74, 0);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    textarea {
        height: 120px;
        font-size: 14px;
    }
}