.app-loading {
    display: none;
}

[x-cloak] {
    display: none !important;
}

html.loading * {
    visibility: hidden;
}

html.loading .app-loading {
    visibility: visible;
    display: flex;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 9999;
}
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(135deg, #fdf8f9 0%, #fceef1 100%);
}
.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.message-appear {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.markdown-body pre {
    background-color: #1e1e1e;
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 1rem 0;
    position: relative;
}

/* 代码块复制按钮样式 */
.markdown-body pre .code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    color: #e6e6e6;
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.markdown-body pre:hover .code-copy-btn {
    opacity: 1;
}

.markdown-body pre .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.markdown-body pre .code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}
.markdown-body code {
    color: #e6e6e6;
    border-radius: 0.5rem;
}
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #aa6677;
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: #884455;
}
.chat-gradient {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.message-user {
    background: linear-gradient(135deg, #440022 0%, #660033 100%);
    box-shadow: 0 4px 6px -1px rgba(68, 0, 34, 0.1), 0 2px 4px -1px rgba(68, 0, 34, 0.06);
}
.message-assistant {
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.new-chat-button {
    background: linear-gradient(to right, #440022, #660033);
    transition: all 0.2s;
}
.new-chat-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(68, 0, 34, 0.2);
}
.input-container {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
    transition: all 0.2s;
}

.input-container:focus-within {
    background: white;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.action-button {
    padding: 0.5rem;
    color: #9ca3af;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.action-button:hover {
    color: #440022;
    background-color: rgba(68, 0, 34, 0.1);
}

.send-button {
    color: #9ca3af;
    transition: all 0.2s ease;
}

.send-button:hover {
    color: #440022;
}

.image-preview {
    max-width: 300px;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item:hover {
    background: rgba(68, 0, 34, 0.05);
}

.chat-item.active {
    background: rgba(68, 0, 34, 0.1);
}

.delete-button {
    opacity: 0;
    transition: all 0.2s;
}

.chat-item:hover .delete-button {
    opacity: 1;
}

.character-selector {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 16rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.character-button {
    width: 100%;
    text-align: left;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.character-button:hover {
    background: #f3f4f6;
    color: #660033;
}

.character-button.active {
    background: #fff5f7;
    color: #440022;
}

.copy-button {
    display: none;
}

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

.message-actions button {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.message-actions button:hover {
    background: rgba(68, 0, 34, 0.05);
}

.message-actions button:hover .fa-sync-alt {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.role-play-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    color: #4b5563;
    border-top: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.role-play-button:hover {
    background: #f3f4f6;
    color: #440022;
}

.role-play-button i {
    font-size: 1.25rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.tab-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab-button.active {
    background: #fff5f7;
    color: #440022;
}

.input-field {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: #440022;
    box-shadow: 0 0 0 2px rgba(68, 0, 34, 0.1);
    outline: none;
}

@media (max-width: 768px) {
    .input-container {
        margin-bottom: env(safe-area-inset-bottom);
    }
    
    .chat-gradient {
        min-height: 100vh;
    }
    
    .chat-item {
        padding: 0.75rem;
    }
    
    .input-container textarea {
        font-size: 16px;
    }
}

/* 修改图标颜色 */
.fas.fa-comments {
    color: #440022;
}

/* 修改链接和交互元素的颜色 */
a:hover, button:focus {
    color: #660033;
}

/* 修改选中文本的颜色 */
/* 用户消息（深色背景）的选中样式 */
.message-user ::selection {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* 助手消息（浅色背景）的选中样式 */
.message-assistant ::selection {
    background: rgba(68, 0, 34, 0.1);
    color: #000000;
}

/* 代码块的选中样式 */
.markdown-body pre code ::selection {
    background: rgba(255, 255, 255, 0.2);
    color: #e6e6e6 !important;
}

/* 默认选中样式 */
::selection {
    background: rgba(68, 0, 34, 0.1);
    color: #000000;
}

/* Firefox 的选中样式 */
.message-user ::-moz-selection {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.message-assistant ::-moz-selection {
    background: rgba(68, 0, 34, 0.1);
    color: #000000;
}

.markdown-body pre code ::-moz-selection {
    background: rgba(255, 255, 255, 0.2);
    color: #e6e6e6 !important;
}

::-moz-selection {
    background: rgba(68, 0, 34, 0.1);
    color: #000000;
}

.character-button.active {
    background: #fff5f7;
    color: #440022;
}

.character-button:hover {
    background: #fff5f7;
    color: #440022;
}

.tab-button.active {
    background: #fff5f7;
    color: #440022;
}

.tab-button:hover {
    color: #440022;
}

.btn-primary {
    background: linear-gradient(to right, #440022, #660033);
}

.btn-primary:hover {
    background: linear-gradient(to right, #660033, #880044);
}

.refresh-button {
    opacity: 0;
    transition: all 0.2s ease;
}

.message-container:hover .refresh-button {
    opacity: 1;
}

.refresh-button:hover {
    transform: rotate(180deg);
}

/* 修改编辑按钮样式 */
.chat-item .edit-button {
    opacity: 0;
    transition: all 0.2s ease;
}

.chat-item:hover .edit-button {
    opacity: 1;
}

/* 修改编辑按钮悬停样式 */
.chat-item button.hover\:bg-blue-50:hover {
    background-color: rgba(68, 0, 34, 0.05);
}

.chat-item button.hover\:text-blue-500:hover {
    color: #440022;
}

/* 编辑标题输入框样式 */
.title-edit-input {
    background: transparent;
    border: 1px solid rgba(68, 0, 34, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem;
    width: 100%;
    transition: all 0.2s ease;
}

.title-edit-input:focus {
    border-color: #440022;
    box-shadow: 0 0 0 2px rgba(68, 0, 34, 0.1);
    outline: none;
}

/* 编辑标题按钮样式 */
.title-edit-button {
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    color: #9ca3af;
}

.title-edit-button:hover {
    background-color: rgba(68, 0, 34, 0.05);
    color: #440022;
}

/* 编辑和删除按钮的基础样式 */
.chat-item .action-button {
    transition: all 0.2s ease;
}

/* PC端悬浮显示 */
@media (min-width: 769px) {
    .chat-item .action-button {
        opacity: 0;
    }
    
    .chat-item:hover .action-button {
        opacity: 1;
    }
}

/* 移动端始终显示 */
@media (max-width: 768px) {
    .chat-item .action-button {
        opacity: 1;
    }
}

/* 编辑标题弹窗样式 */
.title-edit-modal {
    background: rgba(68, 0, 34, 0.1);
    backdrop-filter: blur(8px);
}

.title-edit-modal .modal-content {
    background: white;
    border: 1px solid rgba(68, 0, 34, 0.1);
    box-shadow: 0 4px 6px -1px rgba(68, 0, 34, 0.1), 0 2px 4px -1px rgba(68, 0, 34, 0.06);
}

.title-edit-modal .modal-header {
    color: #440022;
    border-bottom: 1px solid rgba(68, 0, 34, 0.1);
}

.title-edit-modal .modal-input {
    border: 1px solid rgba(68, 0, 34, 0.2);
    transition: all 0.2s ease;
}

.title-edit-modal .modal-input:focus {
    border-color: #440022;
    box-shadow: 0 0 0 2px rgba(68, 0, 34, 0.1);
}

.title-edit-modal .save-button {
    background: linear-gradient(to right, #440022, #660033);
    color: white;
    transition: all 0.2s ease;
}

.title-edit-modal .save-button:hover {
    background: linear-gradient(to right, #660033, #880044);
}

.title-edit-modal .cancel-button {
    color: #666;
    transition: all 0.2s ease;
}

.title-edit-modal .cancel-button:hover {
    background: rgba(68, 0, 34, 0.05);
    color: #440022;
}

/* 添加渐变文字样式 */
.gradient-text {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    transition: all 0.3s ease;
}

.gradient-text:hover {
    opacity: 0.8;
    text-decoration: none;
}