/* 自定义滚动条 - 适配深色模式 */
#chatWindow::-webkit-scrollbar {
    width: 6px;
}
#chatWindow::-webkit-scrollbar-track {
    background: transparent;
}
#chatWindow::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
#chatWindow::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* 模型选择栏下拉选项样式 */
#modelSelect option {
    background-color: #1e293b;
    color: white;
}

#modelSelect {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 消息动画 */
.message-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 玻璃拟态通用样式 */
.glass-effect {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Markdown 样式修饰 - 适配深色背景 --- */
.markdown-body {
    color: #e2e8f0 !important;
    line-height: 1.6;
    font-size: 0.95rem;
}
.markdown-body pre {
    background-color: rgba(0, 0, 0, 0.4) !important;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.markdown-body code {
    font-family: 'Fira Code', monospace;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
}
.markdown-body a {
    color: #818cf8;
    text-decoration: none;
}
.markdown-body a:hover {
    text-decoration: underline;
}
.markdown-body ul, .markdown-body ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}
.markdown-body blockquote {
    border-left: 4px solid rgba(99, 102, 241, 0.5);
    padding-left: 1rem;
    color: #94a3b8;
}
/* 修改 Markdown 分割线颜色 */
.markdown-body hr {
    height: 1px;
    border: none;
    margin: 1.5rem 0;
    /* 使用紫色调的径向渐变，中间 20% 透明度，向两边淡出 */
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, rgba(99, 102, 241, 0) 100%);
    /* 如果想要更细长一点，可以用这个： */
    /* background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.4), transparent); */
}


/* 对话气泡特定微调 */
.user-bubble {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.6), rgba(67, 56, 202, 0.7)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


/* ========== 图片上传相关样式 ========== */

/* 图片上传按钮 hover 效果 */
#imgUploadBtn:not(.opacity-30):hover {
    background: rgba(255, 255, 255, 0.08);
}

/* 图片预览条 */
#imgPreviewStrip {
    scrollbar-width: none;
}
#imgPreviewStrip::-webkit-scrollbar {
    display: none;
}

/* 图片预览条内的图片 hover */
#imgPreviewStrip img {
    transition: transform 0.2s, box-shadow 0.2s;
}
#imgPreviewStrip img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 聊天气泡内的图片 */
.user-bubble img {
    transition: transform 0.2s;
    cursor: pointer;
}
.user-bubble img:hover {
    transform: scale(1.03);
}

/* 禁用状态下图片按钮的提示动画 */
#imgUploadBtn.cursor-not-allowed:active {
    animation: shake 0.3s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* 视觉提示文字 */
#visionHint {
    opacity: 0.6;
    transition: opacity 0.3s;
}
#visionHint:hover {
    opacity: 1;
}



/* ========== 图片上传相关样式 ========== */

#imgUploadBtn:not(.opacity-30):hover {
    background: rgba(255, 255, 255, 0.08);
}

#imgPreviewStrip {
    scrollbar-width: none;
}
#imgPreviewStrip::-webkit-scrollbar {
    display: none;
}

#imgPreviewStrip img {
    transition: transform 0.2s, box-shadow 0.2s;
}
#imgPreviewStrip img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.user-bubble img {
    transition: transform 0.2s;
    cursor: pointer;
}
.user-bubble img:hover {
    transform: scale(1.03);
}

#imgUploadBtn.cursor-not-allowed:active {
    animation: shake 0.3s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

#visionHint {
    opacity: 0.6;
    transition: opacity 0.3s;
}
#visionHint:hover {
    opacity: 1;
}

/* 上传中旋转动画 */
.upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #818cf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
