/* AI 对话应用主样式 */

:root {
    --border-color: #e0e0e0;
    --input-bg: #f9f9f9;
    --user-bg: #e1f5fe;
    --ai-bg: #ffffff;
    --icon-color: #666;
    --text-color: #333;
    --bg-color: #f0f2f5;
    --primary-color: #007bff;
    --backdrop-color: rgba(0, 0, 0, 0.4);
    --header-height: 60px;
    --input-area-height: 85px;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100%;
    overflow: hidden;
    position: relative;
}

#app-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background-color: #fdfdfd;
    box-shadow: none;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    height: var(--header-height);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    color: white;
}

.header-icon i {
    font-size: 1.2em;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.header h1 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.subtitle {
    margin: 0;
    font-size: 0.75em;
    color: #666;
    line-height: 1.3;
}

#clear-chat {
    background: none;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    white-space: nowrap;
    min-width: 80px;
}

#clear-chat:hover {
    background: #ff4d4d;
    color: white;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.chat-message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 18px;
    margin-bottom: 12px;
    position: relative;
    font-size: 0.95em;
    line-height: 1.4;
}

.user-message {
    background-color: var(--user-bg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

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

.model-display {
    font-size: 0.7em;
    color: #888;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
}

.model-display i {
    margin-right: 5px;
}

.chat-message .content {
    white-space: pre-line;
    word-wrap: break-word;
    line-height: 1.3;
    overflow-x: auto;
    max-width: 100%;
}

.chat-message .content p:first-child,
.chat-message .content h1:first-child,
.chat-message .content h2:first-child,
.chat-message .content h3:first-child {
    margin-top: 0;
}

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

/* 优化段落样式 */
.chat-message .content p {
    margin: 0.1em 0;
    line-height: 1.4;
}

/* 优化标题样式 - 更小巧 */
.chat-message .content h1 {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.4em 0 0.2em 0;
    color: #2c3e50;
    border-bottom: 2px solid #e8f4f8;
    padding-bottom: 0.3em;
}

.chat-message .content h2 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0.5em 0 0.25em 0;
    color: #34495e;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.2em;
}

.chat-message .content h3 {
    font-size: 1em;
    font-weight: 600;
    margin: 0.4em 0 0.2em 0;
    color: #34495e;
}

.chat-message .content h4, 
.chat-message .content h5, 
.chat-message .content h6 {
    font-size: 0.95em;
    font-weight: 600;
    margin: 0.5em 0 0.2em 0;
    color: #34495e;
}

/* 优化列表样式 */
.chat-message .content ul, 
.chat-message .content ol {
    margin: 0.1em 0;
    padding-left: 1.2em;
}

.chat-message .content li {
    margin: 0.1em 0;
    line-height: 1.4;
}

.chat-message .content ul li {
    list-style-type: disc;
}

.chat-message .content ol li {
    list-style-type: decimal;
}

/* 优化链接样式 */
.chat-message .content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.chat-message .content a:hover {
    border-bottom-color: #3498db;
}

/* 优化引用样式 */
.chat-message .content blockquote {
    margin: 0.1em 0;
    padding: 0.3em 0.8em;
    border-left: 3px solid #3498db;
    background-color: #f8f9fa;
    color: #555;
    font-style: italic;
}

/* 优化代码块样式 */
.chat-message .content pre {
    position: relative;
    background-color: #282c34;
    color: #abb2bf;
    padding: 0.8em;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82em;
    margin: 0.6em 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-message .content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.88em;
    padding: 0.2em 0.3em;
    margin: 0;
    border-radius: 3px;
    background-color: rgba(27,31,35,0.08);
    color: #24292e;
}

.chat-message .content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.copy-code-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #4b5563;
    color: #e5e7eb;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    font-size: 0.75em;
}

.chat-message .content pre:hover .copy-code-button {
    opacity: 1;
}

.copy-code-button:hover {
    background-color: #6b7280;
}

.chat-message .content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.9em;
    padding: 0.15em 0.3em;
    margin: 0;
    border-radius: 3px;
    background-color: rgba(27,31,35,0.05);
}

.chat-message .content pre code {
    background-color: transparent;
    padding: 0;
}

.chat-message .content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.6em 0;
    font-size: 0.85em;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-message .content th,
.chat-message .content td {
    border: 1px solid #e1e4e8;
    padding: 5px 8px;
    text-align: left;
}

.chat-message .content th {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

.chat-message .content tr:nth-child(even) {
    background-color: #f8f9fa;
}

.chat-message .content tr:hover {
    background-color: #f1f3f4;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.7em;
    color: #999;
}

.tokens-count {
    padding: 2px 5px;
    background-color: #eee;
    border-radius: 4px;
    font-size: 0.85em;
}

.message-actions {
    display: flex;
    gap: 4px;
}

.message-actions i {
    cursor: pointer;
    color: var(--icon-color);
    transition: color 0.2s;
    padding: 6px;
    border-radius: 50%;
    font-size: 1em;
}

.message-actions i:hover {
    background-color: #e0e0e0;
    color: #000;
}

.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 3px;
    background-color: #a0a0a0;
    border-radius: 50%;
    display: inline-block;
    animation: ellipsis-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

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

/* 简约彩色思考指示器样式 */
.typing-indicator {
    color: #666;
    font-style: italic;
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    display: inline-block;
}

.typing-indicator .typing-dots {
    animation: typing-dots 1.5s infinite;
}

@keyframes typing-dots {
    0%, 60%, 100% { opacity: 1; }
    30% { opacity: 0.3; }
}

/* 简约彩色思考指示器 */
.thinking-indicator-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0;
    padding: 4px 8px;
    font-size: 0.9em;
    font-weight: 500;
    line-height: 1.4;
}

.thinking-indicator-simple .thinking-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-right: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 0.8;
    animation: thinking-pulse 1.4s infinite ease-in-out;
}

.thinking-indicator-simple .thinking-dots {
    display: flex;
    gap: 2px;
}

.thinking-indicator-simple .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #6366f1;
    animation: dot-pulse 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.thinking-indicator-simple .dot:nth-child(1) {
    animation-delay: -0.32s;
    background: #6366f1;
}

.thinking-indicator-simple .dot:nth-child(2) {
    animation-delay: -0.16s;
    background: #8b5cf6;
}

.thinking-indicator-simple .dot:nth-child(3) {
    animation-delay: 0s;
    background: #a78bfa;
}

@keyframes dot-pulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes thinking-pulse {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}


.chat-input-area {
    display: flex;
    padding: 2px 6px;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    align-items: center;
    flex-shrink: 0;
    gap: 3px;
    height: var(--input-area-height);
    max-width: 700px;
    margin: 0 auto;
    width: 85%;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.model-selector {
    position: relative;
    flex-shrink: 0;
    display: flex;
}

.current-model-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    cursor: pointer;
    width: 36px;
    height: 36px;
}

.current-model-icon i {
    font-size: 1em;
    color: var(--primary-color);
}

#current-model-name {
    display: none;
}

.model-options-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--backdrop-color);
    z-index: 999;
}

.model-options-backdrop.show {
    display: block;
}

.model-options {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 250px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
}

.model-options.show {
    display: block;
}


.model-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1em;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.model-option i {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

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

.model-option:hover {
    background-color: var(--bg-color);
}

.model-option.selected {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

#message-input {
    flex-grow: 1;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: none;
    font-size: 0.95em;
    line-height: 1.4;
    background-color: var(--input-bg);
    box-sizing: border-box;
    min-height: 46px;
    max-height: 120px;
    overflow: hidden;
}

#send-button {
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button:hover {
    background-color: #0056b3;
}

#send-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 2000;
    font-size: 0.9em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

/* 思考块样式优化 */
.thinking-block {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-left: 4px solid #4f46e5;
    padding: 16px 18px;
    border-radius: 12px;
    margin: 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    transition: all 0.3s ease;
}

.thinking-block:hover {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.thinking-title {
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.thinking-title i {
    font-size: 1em;
    animation: pulse 2s infinite;
}

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

.thinking-content {
    color: #374151;
    line-height: 1.6;
    white-space: pre-line;
    word-wrap: break-word;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.thinking-copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75em;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.thinking-copy-button:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}


/* DeepSeek-R1 特殊样式 */
.thinking-block.deepseek-r1 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
}

.thinking-block.deepseek-r1 .thinking-title {
    color: #d97706;
}

.thinking-block.deepseek-r1 .thinking-content {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(245, 158, 11, 0.2);
}

/* 通用思考内容格式化 */
.thinking-content .step {
    margin: 8px 0;
    padding-left: 16px;
    border-left: 2px solid #e5e7eb;
}

.thinking-content .reasoning {
    color: #6b7280;
    font-style: italic;
    margin: 6px 0;
}

.thinking-content .conclusion {
    font-weight: 500;
    color: #374151;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}


/* 自定义确认对话框样式 */
.confirm-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.confirm-dialog.show {
    display: flex;
}

.confirm-dialog-content {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

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

.confirm-dialog-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.confirm-dialog-message {
    font-size: 0.95em;
    margin-bottom: 20px;
    text-align: center;
    color: #666;
    line-height: 1.4;
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.confirm-dialog-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.confirm-dialog-button.cancel {
    background-color: #f0f0f0;
    color: #333;
}

.confirm-dialog-button.cancel:hover {
    background-color: #e0e0e0;
}

.confirm-dialog-button.confirm {
    background-color: #ff4d4d;
    color: white;
}

.confirm-dialog-button.confirm:hover {
    background-color: #e60000;
}

/* 平板设备优化 */
@media (max-width: 1024px) {
    .chat-input-area {
        max-width: 90%;
        padding: 2px 6px;
        gap: 2px;
        margin-bottom: 1px;
    }
}

/* 手机端特定优化 */
@media (max-width: 768px) {
    :root {
        --header-height: 55px;
        --input-area-height: 75px;
    }
    html {
        font-size: 14px;
    }
    .header {
        padding: 8px 12px;
    }
    .header-icon {
        width: 32px;
        height: 32px;
    }
    .header-icon i {
        font-size: 1em;
    }
    .header-title {
        gap: 8px;
    }
    .header h1 {
        font-size: 1em;
        margin-bottom: 2px;
    }
    .subtitle {
        font-size: 0.65em;
        line-height: 1.2;
    }
    #clear-chat {
        padding: 8px 14px;
        font-size: 0.85em;
        min-width: 70px;
    }
    .chat-container {
        padding: 10px 8px;
    }
    .chat-message {
        max-width: 90%;
        padding: 10px 12px;
        margin-bottom: 10px;
        font-size: 0.9em;
    }
    .chat-message .content pre {
        font-size: 0.8em;
        padding: 0.8em;
    }
    .chat-message .content code {
        font-size: 0.85em;
    }
    .chat-message .content table {
        font-size: 0.85em;
    }
    .chat-message .content th,
    .chat-message .content td {
        padding: 4px;
    }
    .message-footer {
        margin-top: 6px;
        font-size: 0.65em;
    }
    .message-actions i {
        padding: 5px;
        font-size: 0.9em;
    }
    .chat-input-area {
        padding: 2px 6px;
        gap: 8px;
        width: 95%;
        margin-bottom: 1px;
    }
    .current-model-icon {
        width: 32px;
        height: 32px;
        padding: 4px;
        border-radius: 6px;
    }
    .current-model-icon i {
        font-size: 0.9em;
    }
    #message-input {
        font-size: 0.9em;
        min-height: 36px;
        padding: 8px 8px;
        line-height: 1.2;
    }
    #send-button {
        width: 32px;
        height: 32px;
        padding: 4px;
        font-size: 1em;
        border-radius: 6px;
    }
    .model-options {
        width: 80%;
        max-width: 220px;
        bottom: 15px;
    }
    .model-option {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    /* 确认对话框手机端优化 */
    .confirm-dialog-content {
        width: 90%;
        padding: 18px;
    }
    .confirm-dialog-title {
        font-size: 1em;
    }
    .confirm-dialog-message {
        font-size: 0.9em;
    }
    .confirm-dialog-button {
        padding: 8px 14px;
        font-size: 0.85em;
        min-width: 70px;
    }
    
    /* 思考块手机端优化 */
    .thinking-block {
        padding: 10px 12px;
        margin: 8px 0;
    }
    .thinking-title {
        font-size: 0.85em;
        margin-bottom: 6px;
    }
    .thinking-content {
        font-size: 0.85em;
    }
    .thinking-copy-button {
        padding: 3px 6px;
        font-size: 0.7em;
    }
    
    /* 简单输入指示器手机端优化 */
    .typing-indicator {
        font-size: 0.8em;
        margin: 8px 0;
    }
}

/* 超小屏幕（如iPhone SE） */
@media (max-width: 380px) {
    :root {
        --header-height: 50px;
    }
    html {
        font-size: 13px;
    }
    .header {
        padding: 6px 10px;
    }
    .header-icon {
        width: 28px;
        height: 28px;
    }
    .header-icon i {
        font-size: 0.9em;
    }
    .header-title {
        gap: 6px;
    }
    .header h1 {
        font-size: 0.95em;
        margin-bottom: 1px;
    }
    .subtitle {
        font-size: 0.6em;
        line-height: 1.1;
    }
    #clear-chat {
        padding: 8px 14px;
        font-size: 0.85em;
        min-width: 70px;
    }
    .chat-message {
        max-width: 95%;
    }
    .chat-input-area {
        gap: 6px;
        margin-bottom: 5px;
    }
    .current-model-icon {
        width: 28px;
        height: 28px;
        padding: 3px;
        border-radius: 6px;
    }
    #message-input {
        min-height: 38px;
        padding: 9px 6px;
        border-radius: 6px;
        line-height: 1.1;
    }
    #send-button {
        width: 28px;
        height: 28px;
        padding: 3px;
        border-radius: 6px;
    }
    
    /* 确认对话框超小屏幕优化 */
    .confirm-dialog-content {
        width: 95%;
        padding: 15px;
    }
    .confirm-dialog-title {
        font-size: 0.95em;
    }
    .confirm-dialog-message {
        font-size: 0.85em;
    }
    
    /* 思考块超小屏幕优化 */
    .thinking-block {
        padding: 8px 10px;
    }
    .thinking-title {
        font-size: 0.8em;
        margin-bottom: 4px;
    }
    .thinking-content {
        font-size: 0.8em;
    }
    .thinking-copy-button {
        padding: 2px 5px;
        font-size: 0.65em;
    }
    
    /* 简单输入指示器超小屏幕优化 */
    .typing-indicator {
        font-size: 0.75em;
        margin: 6px 0;
    }
}
/* 重新生成菜单样式 */
.regenerate-menu {
    position: absolute;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 1000;
    min-width: 140px;
    font-size: 13px;
    padding: 3px 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.regenerate-menu-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    margin: 1px 3px;
    border-radius: 4px;
}

.regenerate-menu-item:last-child {
    margin-bottom: 1px;
}

.regenerate-menu-item:hover {
    background-color: #f8f9fa;
    transform: translateX(1px);
}

.menu-item-icon {
    margin-right: 5px;
    width: 12px;
    text-align: center;
    color: #666;
    font-size: 10px;
}
.menu-item-content {
    flex: 1;
}

.menu-item-title {
    font-weight: 500;
    color: #333;
    font-size: 11px;
}

/* 数学公式样式优化 */
.chat-message .content .katex {
    max-width: 100%;
    word-break: break-all;
    word-wrap: break-word;
}

.chat-message .content .katex-display {
    max-width: 100%;
    word-break: break-all;
    word-wrap: break-word;
    margin: 0.5em 0;
}

.chat-message .content .katex-mathml {
    max-width: 100%;
    word-break: break-all;
    word-wrap: break-word;
}

/* 确保长公式在小屏幕上自动换行 */
@media (max-width: 768px) {
    .chat-message .content .katex,
    .chat-message .content .katex-display,
    .chat-message .content .katex-mathml {
        max-width: 100%;
        word-break: break-all;
        word-wrap: break-word;
    }
}