/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content>div:first-child {
    flex: 1;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.user-info span {
    font-size: 1.1em;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

#userName {
    color: white !important;
    font-weight: 500;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-buttons a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

.auth-buttons a:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 标签页导航 */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-btn i {
    margin-right: 8px;
}

/* 标签页内容 */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片 */
.card {
    background: white;
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.8em;
}

.card h2 i {
    margin-right: 10px;
    color: #667eea;
}

/* 语言选择器 */
.lang-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lang-group {
    flex: 1;
    min-width: 200px;
}

.lang-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.lang-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.lang-select:focus {
    outline: none;
    border-color: #667eea;
}

/* 引擎选择器 */
.engine-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    flex-wrap: wrap;
}

.engine-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ai-engine-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
}

/* 输入/输出区域 */
.input-area,
.output-area {
    margin-bottom: 20px;
}

.input-area label,
.output-header {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* RTL文本样式 */
.rtl-text {
    direction: rtl;
    text-align: right;
}

.ltr-text {
    direction: ltr;
    text-align: left;
}

/* RTL语言下的textarea样式 */
textarea[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Arial', 'Tahoma', 'Arabic Typesetting', 'Simplified Arabic', sans-serif;
}

textarea[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.text-input,
.text-output {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.text-input:focus {
    outline: none;
    border-color: #667eea;
}

.text-output {
    background: #f9f9f9;
    cursor: default;
}

.text-output.large {
    min-height: 300px;
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-icon {
    padding: 8px 12px;
    background: #667eea;
    color: white;
}

.btn-icon:hover {
    background: #5568d3;
}

.btn-large {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 18px;
    margin-top: 20px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 上传区域 */
.upload-area {
    margin-bottom: 20px;
}

.upload-box {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9f9f9;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.upload-box i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.upload-box p {
    margin: 10px 0;
    color: #666;
}

.upload-hint {
    font-size: 14px;
    color: #999;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
    position: relative;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-preview button {
    margin-top: 10px;
}

/* 结果区域 */
.results-area {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.result-section {
    margin-bottom: 20px;
}

.result-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.result-section .output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-section .output-header h3 {
    margin-bottom: 0;
}

/* AI聊天容器 */
.ai-engine-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chat-container {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f9;
}

.chat-messages {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.message {
    margin-bottom: 20px;
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 85%;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.ai {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    margin-right: auto;
}

.message.system {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    max-width: 100%;
    text-align: center;
}

.message-content {
    margin-bottom: 8px;
}

.message-content p {
    margin: 8px 0;
    line-height: 1.8;
}

.message-content pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 10px 0;
    border-left: 4px solid #667eea;
}

.message-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content pre code {
    background: transparent;
    padding: 0;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content .code-block {
    background: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.message-content .inline-code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.message-content ul,
.message-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.message-content li {
    margin: 5px 0;
    line-height: 1.6;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 15px 0 10px 0;
    font-weight: 600;
    color: #667eea;
}

.message-content h1 {
    font-size: 1.5em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
}

.message-content h2 {
    font-size: 1.3em;
}

.message-content h3 {
    font-size: 1.1em;
}

.message-content strong {
    font-weight: 600;
    color: #667eea;
}

.message-content em {
    font-style: italic;
}

.message-content a {
    color: #667eea;
    text-decoration: underline;
}

.message-content a:hover {
    color: #764ba2;
}

.message-content img.markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-image {
    max-width: 300px;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.ai {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message.ai.deepseek {
    border-left: 4px solid #10b981;
    background: linear-gradient(to right, #f0fdf4 0%, white 5%);
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
    justify-content: flex-end;
}

.engine-badge {
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
}

.message.user .engine-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.message-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-actions {
    opacity: 1;
}

.btn-copy-message,
.btn-translate-message {
    padding: 6px 10px;
    font-size: 12px;
    background: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.btn-copy-message:hover,
.btn-translate-message:hover {
    background: #c82333;
    border-color: #bd2130;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.message.user .btn-copy-message,
.message.user .btn-translate-message {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(220, 53, 69, 0.9);
    color: white;
}

.message.user .btn-copy-message:hover,
.message.user .btn-translate-message:hover {
    background: rgba(200, 35, 51, 0.95);
    border-color: rgba(200, 35, 51, 0.95);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.translated-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #e0e0e0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.translated-text-content {
    line-height: 1.8;
    color: #555;
    padding: 10px;
    background: #fafafa;
    border-radius: 6px;
    margin-top: 8px;
}

.translated-text-content p {
    margin: 8px 0;
}

.translated-text-content pre {
    background: #282c34;
    color: #abb2bf;
}

.translate-loading {
    text-align: center;
    padding: 15px;
    color: #667eea;
    font-size: 14px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.dialog-overlay {
    animation: fadeIn 0.3s ease;
}

.translate-dialog {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-toggle-translation {
    font-size: 12px;
    padding: 4px 8px;
    background: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.btn-toggle-translation:hover {
    background: #c82333;
    color: white;
    border-color: #bd2130;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.ai-engine-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.web-url-input {
    animation: slideDown 0.3s ease;
}

.web-url-input input[type="url"] {
    font-family: inherit;
}

.web-url-input input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
}

#web-content-preview {
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.mode-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.image-gen-params {
    animation: slideDown 0.3s ease;
}

.generated-image-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.generated-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.btn-download-image,
.btn-copy-image-url {
    font-size: 12px;
    padding: 6px 12px;
}

.message.ai .generated-image-container {
    background: white;
    border: 2px solid #e0e0e0;
}

/* 文档翻译进度条 */
.translation-progress {
    animation: slideDown 0.3s ease;
}

.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar>div {
    transition: width 0.3s ease;
}

.email-option {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.email-option label {
    -webkit-user-select: none;
    user-select: none;
}

.email-option input[type="email"] {
    font-family: inherit;
}

.email-option input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
}

/* 语言选择器样式 */
.language-selector-container {
    position: relative;
    width: 100%;
}

.language-search-input {
    width: 100%;
    padding: 8px 35px 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    cursor: text;
    background: white;
}

.language-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.language-search-input::placeholder {
    color: #999;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.2s ease;
}

.language-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
    position: relative;
}

.language-option:hover {
    background: #f5f5f5;
}

.language-option.highlighted {
    background: #e8f0fe;
    color: #667eea;
    font-weight: 600;
}

.language-option.highlighted::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
}

.language-option:last-child {
    border-bottom: none;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 滚动条样式 */
.language-dropdown::-webkit-scrollbar {
    width: 8px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.font-size-control label {
    font-size: 14px;
    color: #666;
}

.font-size-control input[type="range"] {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.font-size-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

#font-size-display {
    min-width: 40px;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 2px solid #e0e0e0;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    resize: none;
    min-height: 60px;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 历史记录 */
.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.filter-select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.3s;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-item-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.history-item-type.text {
    background: #e3f2fd;
    color: #1976d2;
}

.history-item-type.image {
    background: #f3e5f5;
    color: #7b1fa2;
}

.history-item-type.audio {
    background: #e8f5e9;
    color: #388e3c;
}

.history-item-type.document {
    background: #fff3e0;
    color: #f57c00;
}

.history-item-time {
    font-size: 12px;
    color: #999;
}

.history-item-content {
    margin-top: 10px;
}

.history-item-content p {
    margin: 5px 0;
    word-break: break-word;
}

.history-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.history-item input[type="checkbox"] {
    margin-right: 10px;
}

/* 加载覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 18px;
}

/* 消息提示 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 10000;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

/* 录音动画 */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.recording-indicator {
    animation: pulse 1.5s infinite;
}

/* RTL (Right-to-Left) Support for Arabic */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .container {
    direction: rtl;
}

body.rtl .header-content {
    flex-direction: row-reverse;
}

body.rtl .tabs {
    flex-direction: row-reverse;
}

body.rtl .lang-group {
    flex-direction: row-reverse;
}

body.rtl .upload-box {
    text-align: right;
}

body.rtl .results-area {
    text-align: right;
}

body.rtl .btn {
    direction: rtl;
}

body.rtl .recording-controls {
    direction: rtl;
}

body.rtl .recording-controls>div {
    flex-direction: row-reverse;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .tab-content {
        padding: 20px;
    }

    .lang-selector {
        flex-direction: column;
    }

    .lang-group {
        width: 100%;
    }

    .message {
        max-width: 90%;
    }
}

/* 界面语言选择器样式 */
.language-selector-container {
    position: relative;
}

.language-dropdown {
    animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-option:hover {
    background: #f8f9fa !important;
}

.language-option.active {
    background: #f0f4ff !important;
}

.language-option.active .fa-check {
    display: block !important;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .language-selector-container {
        width: 100%;
        margin-bottom: 10px;
    }

    #ui-language-btn {
        width: 100%;
        justify-content: center;
    }

    .language-dropdown {
        width: 100%;
        right: 0;
        left: 0;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-content>div:last-child {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
}