* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 25px 20px;
    background: #4a5568;
    color: white;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.settings {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 15px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item label {
    font-weight: 500;
    color: #4a5568;
}

.setting-item select, 
.setting-item input {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    outline: none;
}

.setting-item select:focus, 
.setting-item input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#clearBtn {
    padding: 8px 16px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

#clearBtn:hover {
    background: #c53030;
}

.translator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

@media (max-width: 768px) {
    .translator-container {
        grid-template-columns: 1fr;
    }
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #4a5568;
}

textarea {
    height: 300px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

#inputText {
    background: #f8fafc;
}

#outputText {
    background: #f1f5f9;
    color: #1a202c;
}

textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #718096;
}

#status {
    font-weight: 500;
}

#wordCount {
    font-weight: 500;
}

/* 加载动画 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .settings {
        flex-direction: column;
        align-items: stretch;
    }
    
    .setting-item {
        justify-content: space-between;
    }
    
    .translator-container {
        padding: 15px;
    }
    
    textarea {
        height: 200px;
    }
}
