* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.language-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

select {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

select option {
    background: white;
    color: #333;
}

.swap-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.swap-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg);
}

main {
    padding: 30px;
}

.translation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    height: 400px;
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e1e5e9;
}

.section-header span {
    font-weight: 600;
    color: #333;
}

.translate-btn {
    padding: 8px 16px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.translate-btn:hover {
    background: #3a9df5;
    transform: translateY(-2px);
}

textarea {
    flex: 1;
    border: none;
    padding: 20px;
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    background: white;
}

textarea:focus {
    outline: none;
}

#outputText {
    background: #f8f9fa;
    color: #666;
}

footer {
    padding: 20px 30px;
    text-align: center;
}

.loading {
    color: #4facfe;
    font-weight: 600;
}

.error {
    color: #e74c3c;
    background: #ffeaea;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

/* 手机端响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .translation-area {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        height: 600px;
        gap: 20px;
    }

    .language-selector {
        flex-direction: column;
        gap: 10px;
    }

    select {
        width: 100%;
        max-width: 200px;
    }

    .section-header {
        padding: 10px 15px;
    }

    textarea {
        padding: 15px;
    }
}

/* 平板端响应式设计 */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        margin: 20px;
    }

    .translation-area {
        height: 500px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: fadeIn 0.5s ease-out;
}

textarea {
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #4facfe;
}