* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

/* DeepSeek Chat 样式作用域 */
#deepseek-app {
    font-family: 'Inter', sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#deepseek-app .app-container {
    flex: 1;
    display: flex;
    width: 100%;
    min-height: 0;
}

/* 侧边栏样式 */
#deepseek-app .sidebar {
    width: 260px;
    background-color: var(--sidebar-bg, #f9fafb);
    border-right: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    flex-shrink: 0;
}

#deepseek-app .sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

#deepseek-app .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 18px;
    color: #8B0000;
}

#deepseek-app .new-chat-btn {
    margin: 16px;
    padding: 10px 16px;
    background-color: var(--primary-color, #fd0042);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

#deepseek-app .new-chat-btn:hover { background-color: #1d4ed8; }

#deepseek-app .history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

#deepseek-app .history-item {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-secondary, #6b7280);
    position: relative;
}

#deepseek-app .history-item:hover { background-color: rgba(0, 0, 0, 0.05); }

#deepseek-app .history-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    max-width: 210px;
}

#deepseek-app .history-menu-btn {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 16px;
    color: #666;
    flex-shrink: 0;
    position: absolute;
    right: 2px;
    line-height: 1;
}

#deepseek-app .history-menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.history-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 120px;
    overflow: hidden;
}

.history-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-menu-item:hover {
    background: #f5f5f5;
}

.dark-mode #deepseek-app .history-menu-btn,
html.dark #deepseek-app .history-menu-btn,
body.dark #deepseek-app .history-menu-btn {
    color: #aaa;
}

.dark-mode .history-menu,
html.dark .history-menu,
body.dark .history-menu {
    background: #333;
    border-color: #444;
}

.dark-mode .history-menu-item,
html.dark .history-menu-item,
body.dark .history-menu-item {
    color: #fff;
}

.dark-mode .history-menu-item:hover,
html.dark .history-menu-item:hover,
body.dark .history-menu-item:hover {
    background: #444;
}

#deepseek-app .sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#deepseek-app .user-avatar-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

#deepseek-app .user-avatar-btn:hover {
    border-color: #4096ff;
    transform: scale(1.05);
}

#deepseek-app .user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dark-mode #deepseek-app .user-avatar-btn,
html.dark #deepseek-app .user-avatar-btn,
body.dark #deepseek-app .user-avatar-btn { border-color: #444; }
.dark-mode #deepseek-app .user-avatar-btn:hover,
html.dark #deepseek-app .user-avatar-btn:hover,
body.dark #deepseek-app .user-avatar-btn:hover { border-color: #69b1ff; }

#deepseek-app .user-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#deepseek-app .user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 160px;
    padding: 6px 0;
    z-index: 1000;
    margin-bottom: 8px;
}

.dark-mode #deepseek-app .user-dropdown {
    background: #2d2d2d;
    border-color: #444;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

html.dark #deepseek-app .user-dropdown,
body.dark #deepseek-app .user-dropdown,
.dark-mode #deepseek-app .user-dropdown {
    background: #2d2d2d;
    border-color: #444;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

#deepseek-app .user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    cursor: pointer;
}

html.dark #deepseek-app .user-dropdown .dropdown-item,
body.dark #deepseek-app .user-dropdown .dropdown-item,
.dark-mode #deepseek-app .user-dropdown .dropdown-item {
    color: #e0e0e0;
}

#deepseek-app .user-dropdown .dropdown-item:hover {
    background: #f5f5f5;
}

html.dark #deepseek-app .user-dropdown .dropdown-item:hover,
body.dark #deepseek-app .user-dropdown .dropdown-item:hover,
.dark-mode #deepseek-app .user-dropdown .dropdown-item:hover {
    background: #3a3a3a;
}

#deepseek-app .user-dropdown .um-icon {
    font-size: 16px;
}

#deepseek-app .user-dropdown .um-danger {
    color: #e74c3c;
}

.dark-mode #deepseek-app .user-dropdown .um-danger {
    color: #ff6b6b;
}

#deepseek-app .user-dropdown .dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

.dark-mode #deepseek-app .user-dropdown .dropdown-divider {
    background: #444;
}

#deepseek-app .username-display {
    color: #333;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

html.dark #deepseek-app .username-display,
body.dark #deepseek-app .username-display,
.dark-mode #deepseek-app .username-display { color: #fff; }

#deepseek-app .theme-toggle {
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #6b7280);
}

#deepseek-app .theme-toggle:hover { background-color: rgba(0, 0, 0, 0.05); }

html.dark #deepseek-app,
body.dark #deepseek-app,
#deepseek-app.dark-mode {
     --primary-color: #fd0042;
    --sidebar-bg: #5a5b5c;
    --chat-bg: #8a8e94;
    --text-primary: #070707;
    --text-secondary: #f9fbfe;
    --border-color: #545556;
    --user-msg-bg: #8a8e94;
    --bot-msg-bg: #8a8e94;
}

/* 主内容区域 */
#deepseek-app .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    position: relative;
}

/* 头部 */
#deepseek-app .chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--chat-bg, #ffffff);
    z-index: 10;
    flex-shrink: 0;
}

#deepseek-app .model-selector select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e5e7eb);
    background-color: var(--chat-bg, #ffffff);
    color: var(--text-primary, #1f2937);
    font-size: 14px;
    cursor: pointer;
}

#deepseek-app .chat-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

#deepseek-app .sidebar-toggle {
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--chat-bg, #fff);
    color: var(--text-primary, #1f2937);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    margin-left: -14px;
}

#deepseek-app.dark-mode .sidebar-toggle {
    background: #5a5b5c;
    color: #f9fafb;
    border-color: #374151;
}

/* 聊天容器 */
#deepseek-app .chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    background-color: var(--chat-bg, #ffffff);
    color: var(--text-primary, #1f2937);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* 消息气泡 */
#deepseek-app .message {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

#deepseek-app .avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-color, #fd0042);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 18px;
    min-height: 18px;
    line-height: 1;
    text-align: center;
    font-size: 9px;
}

#deepseek-app .user-avatar { background-color: #9ca3af; }

#deepseek-app .message-content { width: 100%; min-width: 0; }

#deepseek-app .message-text {
    padding: 16px;
    border-radius: 12px;
    background-color: var(--bot-msg-bg, #f8fafc);
    white-space: pre-wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    word-wrap: break-word;
    color: #000;
}

#deepseek-app .user-message { align-items: flex-end; }
#deepseek-app .user-message .avatar { align-self: flex-end; }
#deepseek-app .user-message .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

#deepseek-app .user-message .message-content img.message-image {
    max-width: 180px;
    max-height: 140px;
    border-radius: 8px;
    align-self: flex-end;
}

#deepseek-app .user-message .message-text {
    color: #000 !important;
    text-align: right;
    width: 100%;
}

#deepseek-app .bot-message { align-items: flex-start; }

#deepseek-app .bot-message .message-content {
    background-color: var(--bot-msg-bg, #f8fafc);
}

/* 消息操作按钮 */
#deepseek-app .message-actions {
    display: flex !important;
    gap: 7px !important;
    margin-top: 10px !important;
    padding-top: 8px !important;
    border-top: 1px solid #eee !important;
    align-items: center !important;
}

#deepseek-app .action-btn {
    font-size: 14px !important;
    cursor: pointer !important;
    padding: 6px 8px !important;
    border-radius: 6px !important;
    background-color: #fff !important;
    border: 1px solid #e0e0e0 !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

#deepseek-app .action-btn:hover {
    background-color: #f5f5f5 !important;
    border-color: #bbb !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#deepseek-app .action-btn:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
    background-color: #eee !important;
}

#deepseek-app .action-btn svg { pointer-events: none; }

#deepseek-app .action-btn.liked {
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    background-color: #fef2f2 !important;
}

#deepseek-app .action-btn.copied {
    border-color: #4CAF50 !important;
    color: #4CAF50 !important;
    background-color: #f0fdf4 !important;
}

.dark-mode #deepseek-app .message-actions { border-top-color: #444; }

.dark-mode #deepseek-app .action-btn {
    background-color: #333 !important;
    border-color: #555 !important;
    color: #fff !important;
}

.dark-mode #deepseek-app .action-btn:hover {
    background-color: #444 !important;
    border-color: #666 !important;
}

/* 加载动画 */
#deepseek-app .typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
}
#deepseek-app .typing-text {
    font-size: 13px;
    color: #999;
    margin-right: 4px;
}

#deepseek-app .typing-dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

#deepseek-app .typing-dot:nth-child(1) { animation-delay: -0.32s; }
#deepseek-app .typing-dot:nth-child(2) { animation-delay: -0.16s; }
#deepseek-app .typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 思考过程样式 */
#deepseek-app .think-content {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    border: 1px solid #dee2e6;
    position: relative;
}

.dark-mode #deepseek-app .think-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d3d 100%);
    border-color: #3d3d5c;
    color: #b8b8c8;
}

/* 思考过程标题和折叠按钮 */
#deepseek-app .think-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
}

#deepseek-app .think-title {
    font-weight: 600;
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
}

.dark-mode #deepseek-app .think-title {
    color: #888;
}

/* 折叠按钮 */
#deepseek-app .think-toggle {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-size: 12px;
    color: #666;
}

#deepseek-app .think-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-color: #bbb;
}

#deepseek-app .think-toggle:active {
    transform: translateY(0);
}

.dark-mode #deepseek-app .think-toggle {
    background: #2d2d3d;
    border-color: #444;
    color: #aaa;
}

.dark-mode #deepseek-app .think-toggle:hover {
    border-color: #666;
}

#deepseek-app .think-toggle svg {
    transition: transform 0.2s ease;
}

#deepseek-app .think-body {
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 折叠状态 */
#deepseek-app .think-content.collapsed .think-body {
    display: none;
}

/* 输入区域 */
#deepseek-app .input-container {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background-color: var(--chat-bg, #ffffff);
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

#deepseek-app .input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 auto;
    max-width: 800px;
    position: relative;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    padding: 10px 12px;
}

/* 预览区域样式 */
#deepseek-app .preview-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 12px;
    max-height: 120px;
    overflow-y: auto;
}

#deepseek-app .preview-area .thumbnail {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* 点赞徽标 - 右上角小数字 */
#deepseek-app .like-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    color: #ef4444;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}
.dark-mode #deepseek-app .like-badge {
    color: #f87171;
}

/* 输入框行 */
#deepseek-app .input-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

#deepseek-app .input-wrapper .message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 10px 12px;
    font-size: 15px;
    background: transparent;
    min-height: 36px;
    max-height: 120px;
    color: #1f2937;
}

/* 发送按钮 */
#deepseek-app .send-button#sendBtn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
}
#deepseek-app .send-button#sendBtn svg {
    width: 28px;
    height: 28px;
    color: #e70000;
}
#deepseek-app .send-button#sendBtn:hover {
    background: #e5e7eb;
}

/* 语音输入按钮 */
#deepseek-app .voice-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    color: #6b7280;
    transition: all 0.2s ease;
}
#deepseek-app .voice-btn:hover {
    background: #e5e7eb;
    color: #374151;
}
#deepseek-app .voice-btn.recording {
    background: #fee2e2;
    color: #ef4444;
    animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 功能按钮栏 */
#deepseek-app .func-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
    position: relative;
}

#deepseek-app .toggle-item {
    display: inline-block;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: #374151;
}

#deepseek-app .toggle-item.active {
    background: #10b981;
    color: #fff;
}

#deepseek-app .tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #374151;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    padding: 5px 10px;
    cursor: pointer;
    position: relative;
}

#deepseek-app .add-file-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: normal;
}

#deepseek-app .add-file-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

#deepseek-app .popup-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    display: none;
    z-index: 99;
    min-width: 110px;
}

#deepseek-app .popup-menu .menu-item {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#deepseek-app .popup-menu .menu-item:hover {
    background: #f5f5f5;
}

/* 深色模式适配输入区 */
.dark-mode #deepseek-app .input-wrapper {
    background: #333;
    border-color: #444;
}
.dark-mode #deepseek-app .input-wrapper .message-input {
    color: #fff;
    background: transparent;
}
.dark-mode #deepseek-app .send-button#sendBtn {
    background: #444;
}
.dark-mode #deepseek-app .send-button#sendBtn svg {
    color: #ff6b6b;
}
.dark-mode #deepseek-app .voice-btn {
    background: #444;
    color: #aaa;
}
.dark-mode #deepseek-app .voice-btn:hover {
    background: #555;
    color: #ddd;
}
.dark-mode #deepseek-app .voice-btn.recording {
    background: #7f1d1d;
    color: #fca5a5;
}
.dark-mode #deepseek-app .toggle-item {
    background: #444;
    color: #aaa;
}
.dark-mode #deepseek-app .toggle-item.active {
    background: #10b981;
    color: #fff;
}
.dark-mode #deepseek-app .tool-btn {
    background: #444;
    color: #aaa;
}
.dark-mode #deepseek-app .add-file-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #000;
}
.dark-mode #deepseek-app .add-file-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}
.dark-mode #deepseek-app .popup-menu {
    background: #fff;
    border-color: #ddd;
}
.dark-mode #deepseek-app .popup-menu .menu-item {
    color: #000;
}
.dark-mode #deepseek-app .popup-menu .menu-item:hover {
    background: #f5f5f5;
}

/* 头部右侧按钮 */
#deepseek-app .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

#deepseek-app .header-right button {
    position: relative;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--chat-bg, #fff);
    color: var(--text-primary, #1f2937);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

#deepseek-app .header-right #dot {
    position: absolute;
    right: 2px;
    top: 2px;
    width: 8px;
    height: 8px;
    background: #ff4d4f;
    border-radius: 50%;
    display: inline-block;
}

/* 代码块 */
#deepseek-app pre {
    background-color: rgba(0,0,0,0.05);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#deepseek-app.dark-mode pre { background-color: rgba(255,255,255,0.1); }

#deepseek-app code {
    font-family: 'Monaco','Menlo','Ubuntu Mono', monospace;
    font-size: 14px;
}

/* 欢迎状态 */
#deepseek-app .welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #6b7280);
    width: 100%;
}

#deepseek-app .welcome-icon {
    font-size: 60px;
    margin-bottom: 40px;
}

#deepseek-app .welcome-title {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary, #1f2937);
}

#deepseek-app .welcome-state p {
    font-size: 16px;
    margin-bottom: 40px;
    max-width: 600px;
}

#deepseek-app .suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin-top: 24px;
    width: 100%;
}

#deepseek-app .suggestion-card {
    padding: 16px;
    border-radius: 8px;
    background-color: var(--bot-msg-bg, #f8fafc);
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s;
    width: 100%;
}

#deepseek-app .suggestion-card:hover {
    transform: translateY(-2px);
    background-color: var(--user-msg-bg, #f3f4f6);
}

#deepseek-app .welcome-icon img {
    height: 80px;
    object-fit: contain;
    display: block;
}

/* 消息中的图片和文件 */
#deepseek-app .message-text img.thumbnail {
    max-width: 120px;
    max-height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

#deepseek-app .file-attachment {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
}

/* AI生成提示 */
#deepseek-app .AIcenter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 100%;
}
#deepseek-app .your-content {
    font-size: 6px;
    color: rgba(255, 255, 255, 0.4);
}

#deepseek-app .sidebar-footer {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.simple-refresh-btn {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: #666;
}

/* 移动端自适应 */
@media (max-width: 768px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    #deepseek-app {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    #deepseek-app .app-container,
    #deepseek-app .main-content,
    #deepseek-app .chat-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    #deepseek-app .main-content,
    #deepseek-app .chat-container {
        flex: 1 !important;
        min-width: 0 !important;
    }
    #deepseek-app .chat-container {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px !important;
    }
    #deepseek-app .chat-header {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }
    #deepseek-app .chat-header .header-left,
    #deepseek-app .chat-header .header-right {
        width: auto !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    #deepseek-app .input-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    #deepseek-app .sidebar {
        position: fixed !important;
        left: -260px !important;
        height: 100% !important;
        z-index: 100 !important;
        transition: left 0.3s;
    }
    #deepseek-app .sidebar.active { left: 0 !important; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
    #deepseek-app .sidebar-toggle {
        position: fixed !important;
        left: 16px !important;
        z-index: 200 !important;
        transition: left 0.3s;
    }
    #deepseek-app .sidebar.active ~ .main-content .sidebar-toggle {
        left: 244px !important;
    }
    #deepseek-app .menu-toggle { display: none !important; }
    #deepseek-app .overlay {
        display: none;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.5);
        z-index: 99 !important;
    }
    #deepseek-app .overlay.active { display: block; }
    #deepseek-app .message {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        gap: 6px;
        width: 100%;
    }
    #deepseek-app .message-content { width: 100%; }
    #deepseek-app .message-text { padding: 12px; }
    #deepseek-app .message .avatar {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
        font-size: 8px;
        line-height: 1;
        text-align: center;
    }
    #deepseek-app .input-container {
        padding: 8px 10px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        flex-shrink: 0;
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }
    #deepseek-app .input-wrapper { flex: 1; gap: 6px; }
    #deepseek-app .input-box { padding: 3px 5px; border-radius: 8px; }
    #deepseek-app .message-input {
        padding: 8px 6px;
        font-size: 14px;
        height: 40px;
        min-height: 40px;
    }
    #deepseek-app .control-row { gap: 6px; }
    #deepseek-app .control-btn { padding: 3px 8px; font-size: 11px; }
    #deepseek-app .control-btn .btn-text { display: none; }
    #deepseek-app .send-button {
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
    }
    #deepseek-app .send-button#addFileBtn {
        width: 32px;
        height: 32px;
        font-size: 18px;
        padding: 0;
    }
    #deepseek-app .voice-btn { width: 32px; height: 32px; }
    #deepseek-app .voice-btn svg { width: 18px; height: 18px; }
    #deepseek-app .welcome-state {
        flex: 1;
        padding: 10px;
        justify-content: flex-start;
        padding-top: 20px;
    }
    #deepseek-app .welcome-title { font-size: 24px; margin-bottom: 15px; }
    #deepseek-app .welcome-state p {
        font-size: 14px;
        margin-bottom: 30px;
        max-width: 100%;
    }
    #deepseek-app .suggestions {
        gap: 10px;
        margin-top: 20px;
        width: 100%;
        display: none;
    }
    #deepseek-app .suggestion-card { padding: 12px; }
    #deepseek-app .welcome-icon { font-size: 50px; margin-bottom: 30px; }
    #deepseek-app .welcome-icon img { height: 60px; }
    #deepseek-app .chat-header { padding: 12px; }
    #deepseek-app .model-selector select { padding: 4px 8px; font-size: 12px; }
    #deepseek-app .sidebar { width: 220px; }
    #deepseek-app .sidebar-header { padding: 12px; }
    #deepseek-app .new-chat-btn { margin: 12px; padding: 8px 12px; font-size: 14px; }
    #deepseek-app .history-list { padding: 6px; }
    #deepseek-app .history-item { padding: 8px 10px; font-size: 14px; }
    #deepseek-app .sidebar-footer { padding: 12px; }
    #deepseek-app .theme-toggle { padding: 6px; font-size: 14px; }
    #deepseek-app .user-message { align-items: flex-end; margin-right: 15px; }
    #deepseek-app .bot-message { align-items: flex-start; margin-left: 15px; }
    #deepseek-app .header-right button { padding: 5px 8px; font-size: 14px; }
    #deepseek-app .header-right #dot { width: 6px; height: 6px; right: 1px; top: 1px; }
}

@media (min-width: 769px) {
    #deepseek-app .menu-toggle,
    #deepseek-app .overlay { display: none; }
}

@media (max-width: 480px) {
    #deepseek-app .sidebar { width: 200px; }
    #deepseek-app .message { margin-bottom: 16px; gap: 8px; }
    #deepseek-app .message .avatar {
        width: 14px; height: 14px; min-width: 14px; min-height: 14px;
        font-size: 7px; line-height: 1; text-align: center;
    }
    #deepseek-app .message-text { padding: 10px; font-size: 14px; }
    #deepseek-app .input-container {
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
    #deepseek-app .input-box { padding: 2px; border-radius: 6px; }
    #deepseek-app .message-input { padding: 8px; font-size: 14px; height: 44px; min-height: 44px; }
    #deepseek-app .send-button { padding: 6px 10px; border-radius: 4px; margin: 2px; font-size: 13px; }
    #deepseek-app .voice-btn { width: 32px; height: 32px; }
    #deepseek-app .voice-btn svg { width: 18px; height: 18px; }
    #deepseek-app .chat-header { padding: 10px; }
    #deepseek-app .model-selector select { padding: 3px 6px; font-size: 11px; }
    #deepseek-app .sidebar-header { padding: 10px; }
    #deepseek-app .new-chat-btn { margin: 10px; padding: 6px 10px; font-size: 13px; }
    #deepseek-app .history-list { padding: 4px; }
    #deepseek-app .history-item { padding: 6px 8px; font-size: 13px; }
    #deepseek-app .sidebar-footer { padding: 10px; }
    #deepseek-app .theme-toggle { padding: 4px; font-size: 13px; }
    #deepseek-app .welcome-title { font-size: 18px; margin-bottom: 12px; }
    #deepseek-app .welcome-state p { font-size: 12px; margin-bottom: 15px; }
    #deepseek-app .suggestions { gap: 6px; margin-top: 10px; }
    #deepseek-app .suggestion-card { padding: 10px; }
    #deepseek-app .welcome-icon { font-size: 40px; margin-bottom: 20px; }
    #deepseek-app .welcome-icon img { height: 50px; }
}

/* 桌面端侧栏折叠 */
@media (min-width: 769px) {
    #deepseek-app.sidebar-collapsed .sidebar {
        width: 0;
        overflow: hidden;
        border-right: none;
    }
    #deepseek-app.sidebar-collapsed .main-content { width: 100%; }
}
