/* TranOptim - 智能翻译与润色工具 样式表 */

/* 全局变量 */
:root {
    --primary-color: #3e6ae1;
    --secondary-color: #6c7dd0;
    --bg-color: #f4f7fc;
    --text-color: #333;
    --light-gray: #f0f2f5;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #fff;
    --success-color: #28a745;
    --sidebar-width: 280px;
    --header-height: 60px;
    --footer-height: 40px;
    --border-radius: 8px;
    --animate-duration: 0.3s;
    --muted-text-color: #777;
}

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

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

.main-content {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.new-chat-btn, .clear-chats-btn {
    background-color: var(--light-gray);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color var(--animate-duration);
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-chat-btn {
    background-color: var(--primary-color);
    color: white;
}

.new-chat-btn:hover {
    background-color: #3257c5;
}

.clear-chats-btn:hover {
    background-color: #e6e8eb;
}

/* 对话列表 */
.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--animate-duration);
    margin-bottom: 8px;
    position: relative;
}

.conversation-item:hover {
    background-color: var(--light-gray);
}

.conversation-item.active {
    background-color: rgba(62, 106, 225, 0.1);
    border-left: 3px solid var(--primary-color);
}

.conversation-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.conversation-content {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.conversation-time {
    font-size: 0.8rem;
    color: var(--muted-text-color);
    white-space: nowrap;
}

.conversation-actions {
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.conversation-item:hover .conversation-actions {
    visibility: visible;
    opacity: 1;
}

.conversation-delete {
    background: none;
    border: none;
    color: #777;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.conversation-delete:hover {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}

.conversation-action-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.conversation-action-btn:hover {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}

/* 聊天容器 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 聊天头部 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.app-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
}

.global-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: var(--border-radius);
    animation: fadeIn var(--animate-duration) ease;
    position: relative;
}

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

.message-content {
    padding: 10px 15px;
    border-radius: var(--border-radius);
}

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

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 8px 0;
}

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

.message.user {
    align-self: flex-end;
    background-color: var(--light-gray);
}

.message.ai {
    align-self: flex-start;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.message.error {
    background-color: #fff8f8;
    border: 1px solid #fdd;
    color: #d00;
}

.message.system {
    background-color: #f5f9ff;
    border: 1px solid #e5f1ff;
    color: #3e6ae1;
}

/* 翻译和润色结果样式 */
.service-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--muted-text-color);
}

.lang-info {
    font-style: italic;
}

.translation-result, .polishing-result {
    position: relative;
}

.reveal-content p, .reveal-content pre {
    font-size: 1.02rem;
    line-height: 1.7;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.message-action-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--muted-text-color);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

/* 聊天输入 */
.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.input-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.textarea-wrapper {
    padding: 12px 16px;
}

.chat-input {
    width: 100%;
    border: none;
    resize: none;
    padding: 12px 15px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    background-color: var(--light-gray);
    transition: background-color var(--animate-duration);
    min-height: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.chat-input:focus {
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(62, 106, 225, 0.2);
}

.buttons-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color var(--animate-duration);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: #3257c5;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
}

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

.upload-btn {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.upload-btn:hover {
    background-color: #e6e8eb;
}

.image-upload {
    display: none;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #777;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.settings-btn:hover {
    background-color: var(--light-gray);
}

/* 设置面板 */
.settings-panel {
    position: absolute;
    bottom: 100px;
    right: 16px;
    width: 320px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    animation: slideUp 0.2s ease-out;
    overflow: hidden;
}

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

.settings-panel.active {
    display: block;
}

.settings-panel h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 600;
}

.close-settings-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-group {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-group:last-child {
    border-bottom: none;
}

.settings-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 4px;
}

.radio-option label {
    font-size: 0.9rem;
}

select, input[type="text"], textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(62, 106, 225, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    font-size: 1rem;
    color: var(--text-color);
}

/* 本地加载指示器 */
.local-loading {
    display: flex;
    align-items: center;
    background-color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: absolute;
    z-index: 10;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(62, 106, 225, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* 通知 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #f8f9fa;
    color: #333;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
    max-width: 80%;
}

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

/* 成功通知样式 */
.notification-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

/* 警告通知样式 */
.notification-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* 错误通知样式 */
.notification-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* 结果中的错误样式 */
.error-result {
    border: 1px solid #f8d7da;
    background-color: #fff8f8;
}

.error-result .translated-text,
.error-result p {
    color: #721c24;
}

/* 响应式通知 */
@media (max-width: 768px) {
    .notification {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 500px;
    max-width: 90%;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--text-color);
    text-decoration: none;
}

/* 代理设置相关样式 */
.description {
    color: #666;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.form-group input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(62, 106, 225, 0.2);
}

.help-text {
    color: #777;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(21px);
}

/* 测试结果样式 */
#testResultSpan {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9rem;
}

#testResultSpan .success {
    color: var(--success-color);
}

#testResultSpan .error {
    color: #dc3545;
}

#testResultSpan .testing {
    color: #ffc107;
}

/* API设置相关样式 */
.service-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.service-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    transition: all 0.2s;
}

.service-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 500;
}

.service-tab:hover:not(.active) {
    color: var(--text-color);
    background-color: var(--light-gray);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }

    .chat-container {
        width: 100%;
    }

    .message {
        max-width: 90%;
    }

    .settings-panel {
        width: 90%;
        left: 5%;
        right: 5%;
    }
}

/* 添加粘贴提示 */
.paste-hint {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 0.8rem;
    color: var(--muted-text-color);
    pointer-events: none;
}

/* 图片预览容器样式 */
.image-preview-container {
    width: 100%;
    margin-bottom: 10px;
    background-color: rgba(240, 240, 240, 0.3);
    border-radius: 10px;
    padding: 10px;
    position: relative;
}

.preview-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.preview-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #f44336;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    transition: background-color 0.2s;
}

.remove-image-btn:hover {
    background-color: #d32f2f;
}

/* 用户图片样式 */
.user-image-container {
    margin-bottom: 10px;
}

.user-image {
    max-width: 250px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.user-text.image-caption {
    color: #888;
    font-style: italic;
    margin-top: 5px;
}

/* OCR和翻译结果样式 */
.ocr-result {
    margin-bottom: 8px;
    padding: 12px;
    background-color: #fff9e6;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.result-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    display: flex;
    align-items: center;
}

.result-title i {
    margin-right: 5px;
}

.ocr-text {
    white-space: pre-wrap;
    font-family: monospace;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 5px;
    border-left: 3px solid #ddd;
}

.result-divider {
    height: 1px;
    background-color: #eee;
    margin: 15px 0;
}

.translation-result {
    margin-bottom: 8px;
    padding: 12px;
    background-color: #f0fff4;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.translation-text {
    white-space: pre-wrap;
    line-height: 1.5;
}

/* 拖放样式 */
.chat-input.dragover {
    background-color: #f0f8ff !important;
    border-color: var(--primary-color) !important;
}

.chat-input.has-image {
    border-color: var(--success-color);
    background-color: #f8fff8;
}

.paste-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(62, 106, 225, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.image-paste-hint {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px 4px 0 0;
    font-size: 0.8rem;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.image-paste-hint.hidden {
    transform: translateY(-100%);
}

/* 消息操作按钮 */
.message-actions {
    display: flex;
    margin-top: 8px;
    justify-content: flex-end;
    gap: 6px;
}

.action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 12px;
    margin-left: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: #495057;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn i {
    margin-right: 4px;
}

/* 复制按钮特殊样式 */
.action-btn.copy-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
    font-weight: 600;
}

.action-btn.copy-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    border-color: #1e7e34;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* 添加加载超时提示样式 */
.loading-timeout-hint {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: fadeInDelay 8s forwards; /* 延迟8秒后才显示 */
}

.loading-timeout-hint a {
    color: #3a86ff;
    text-decoration: underline;
    cursor: pointer;
}

.loading-timeout-hint a:hover {
    color: #2a76ef;
}

@keyframes fadeInDelay {
    0%, 50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* 添加润色风格和角色描述样式 */
.style-description, .role-description, .polish-description {
    margin-top: 10px;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #555;
    border-left: 3px solid #3e6ae1;
}

.style-description p, .role-description p, .polish-description p {
    margin: 5px 0;
    line-height: 1.4;
}

.role-description {
    border-left-color: #6c7dd0;
    background-color: #f5f7ff;
}

.polish-description {
    border-left-color: #8e44ad;
    background-color: #f8f5ff;
}

/* 添加双重润色结果样式 */
.original-content, .result-group {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #eaeaea;
}

.original-content {
    background-color: #f5f5f5;
    border-left: 3px solid #3e6ae1;
}

.content-header {
    font-weight: 600;
    margin-bottom: 10px;
    color: #444;
    font-size: 1rem;
}

.content-body {
    white-space: pre-wrap;
    line-height: 1.5;
    color: #333;
    font-size: 0.95rem;
}

.polish-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-group:nth-child(1) {
    border-left: 3px solid #28a745;
    background-color: #f8fff8;
}

.result-group:nth-child(2) {
    border-left: 3px solid #8e44ad;
    background-color: #f8f5ff;
}

@media (min-width: 768px) {
    .polish-results {
        flex-direction: row;
    }
    
    .result-group {
        flex: 1;
    }
}

/* 添加按钮点击效果 */
.button-clicked {
    transform: scale(0.95);
    opacity: 0.8;
    transition: transform 0.1s, opacity 0.1s;
}

/* 用户信息和登录相关样式 */
.user-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.user-avatar {
    margin-right: 10px;
    font-size: 24px;
    color: #555;
}

.user-name {
    flex-grow: 1;
    font-weight: 500;
    font-size: 14px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: #d32f2f;
}

.logout-btn i {
    margin-right: 5px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .user-info {
        padding: 10px;
    }
    
    .user-avatar {
        font-size: 20px;
    }
    
    .user-name {
        font-size: 12px;
    }
    
    .logout-btn {
        padding: 3px 6px;
        font-size: 12px;
    }
}

/* 图片翻译结果区域样式 */
.ocr-result-section, .translation-result-section {
    margin: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    overflow: hidden;
}

.ocr-result-section {
    margin-bottom: 8px;
}

.translation-result-section {
    margin-top: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
}

.section-title {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.section-title i {
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    gap: 8px;
}

.section-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-btn:hover {
    background: #3257c5;
    transform: translateY(-1px);
}

.section-content {
    padding: 16px;
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.ocr-result-section .section-content {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.translation-result-section .section-content {
    background: #f0fff4;
    border-left: 4px solid #28a745;
    font-size: 1rem;
}



/* 操作按钮样式增强 */
.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 8px rgba(62, 106, 225, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(62, 106, 225, 0.4);
}

.action-btn.copy-all-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.action-btn.copy-all-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
    transform: translateY(-2px);
}

/* 图片翻译专用样式 */
.ocr-result-section .section-title i {
    color: #ffc107;
}

.translation-result-section .section-title i {
    color: #28a745;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .result-separator {
        margin: 15px 0;
        gap: 10px;
    }
    
    .separator-text {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}