:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --dark-color: #202124;
    --light-color: #f8f9fa;
    --border-color: #dadce0;
    --error-color: #ea4335;
}
 
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}
 
.container {
    width: 100%;
    max-width: 1000px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 30px;
    position: relative;
}
 
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    text-align: center;
}
 
h1 {
    font-weight: 500;
    font-size: 2rem;
    margin-bottom: 10px;
}
 
.subtitle {
    font-weight: 300;
    opacity: 0.9;
}
 
.translation-area {
    display: flex;
    flex-direction: column;
    padding: 20px;
}
 
@media (min-width: 768px) {
    .translation-area {
        flex-direction: row;
    }
}
 
.text-box-container {
    flex: 1;
    padding: 15px;
    position: relative;
}
 
.text-box-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-color);
}
 
.text-box {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    resize: none;
    transition: border 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
}
 
.text-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}
 
.char-count {
    position: absolute;
    right: 25px;
    bottom: 25px;
    font-size: 12px;
    color: #70757a;
}
 
.btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}
 
@media (min-width: 768px) {
    .btn-container {
        flex-direction: column;
        padding: 0 15px;
    }
}
 
.translate-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
 
.translate-btn:hover {
    background-color: #3367d6;
    transform: scale(1.05);
}
 
.swap-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 24px;
    margin: 10px 0;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s;
}
 
.swap-btn:hover {
    background-color: rgba(66, 133, 244, 0.1);
    transform: rotate(180deg);
}
 
.footer {
    margin-top: 30px;
    text-align: center;
    color: #70757a;
    font-size: 14px;
}
 
.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
}
 
.spinner {
    border: 3px solid rgba(66, 133, 244, 0.2);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}
 
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
 
.api-settings {
    position: absolute;
    top: 20px;
    right: 20px;
}
 
#settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
 
.settings-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 30px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 300px;
    z-index: 10;
}
 
.settings-panel h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}
 
.form-group {
    margin-bottom: 15px;
}
 
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}
 
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
 
#save-settings {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
 
.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 10px;
    display: none;
}