/* 翻译工具样式 */
.translator-container {
    padding: 20px;
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.language-group {
    flex: 1;
}

.language-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.language-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.language-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.swap-btn {
    width: 40px;
    height: 40px;
    margin: 0 15px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.translation-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.translation-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-group {
    flex: 1;
    padding: 15px;
}

.form-group textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
}

.panel-actions div {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-text {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: rgba(52, 152, 219, 0.1);
    text-decoration: underline;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.recent-translations {
    margin-top: 30px;
}

.recent-translations h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--secondary-bg);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.recent-item {
    padding: 12px;
    margin-bottom: 10px;
    background: var(--card-bg);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-item:hover {
    background: var(--hover-bg);
    transform: translateX(5px);
}

.recent-item:last-child {
    margin-bottom: 0;
}

.recent-item-source {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recent-item-target {
    color: var(--text-secondary);
    font-size: 13px;
}

.info-section {
    margin-top: 20px;
}

.info-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .language-selector {
        flex-direction: column;
        gap: 15px;
    }
    
    .language-group {
        width: 100%;
    }
    
    .swap-btn {
        margin: 0;
        transform: rotate(90deg);
    }
    
    .translation-container {
        flex-direction: column;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-primary,
    .btn-secondary {
        flex: 1 1 100%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.translation-panel {
    animation: fadeIn 0.3s ease;
}

/* 语音按钮动画 */
.btn-secondary.recording {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    animation: pulse 1.5s infinite;
}

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

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}