/* 智聊模块公共样式 */

/* 消息容器 */
.message-container {
    display: none;
}

.message-container.active {
    display: flex;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* 用户消息 */
.user-message {
    background-color: #e8f0ff;
    border-radius: 12px;
    word-wrap: break-word;
    margin-left: auto;
}

/* 系统消息 */
.system-message {
    display: flex;
    max-width: 100%;
}

.system-avatar {
    flex-shrink: 0;
    border: 1px solid rgba(209, 213, 219, 0.6);
    border-radius: 50%;
    padding: 2px;
    background-color: white;
}

/* 系统文本样式 */
.system-text {
    flex: 1;
    word-wrap: break-word;
}

.system-text p {
    margin: 0 0 8px 0;
}

.system-text p:last-child {
    margin-bottom: 0;
}

.system-text code {
    background-color: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.system-text pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.system-text pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.system-text ul, .system-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.system-text li {
    margin: 4px 0;
}

.system-text strong {
    font-weight: 600;
}

.system-text em {
    font-style: italic;
}

/* 思维链样式 */
.thinking-block {
    margin-bottom: 12px;
}

.thinking-header {
    display: inline-flex;
    align-items: center;
    padding: 2px 0;
    cursor: pointer;
    color: #7eb0f7;
    transition: opacity 0.2s;
    user-select: none;
}

@media (hover: hover) and (pointer: fine) {
    .thinking-header:hover {
        opacity: 0.8;
    }
}

.thinking-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.thinking-header .spinner {
    border: 1.5px solid #a8d0ff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.thinking-header .header-dot {
    background-color: #c0c0c0;
    border-radius: 50%;
}

.thinking-header-text {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thinking-arrow {
    transition: transform 0.2s;
}

.thinking-content {
    position: relative;
    margin-left: 3px;
    border-left: 1px solid #d0d0d0;
    color: #666;
    line-height: 1.6;
}

.thinking-content p {
    color: #666;
    margin: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 操作按钮 */
.message-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .action-btn:hover {
        color: #666;
        background-color: #f0f0f0;
    }
}

.action-btn.copied {
    color: #10b981;
}

/* 底部按钮 */
.footer-btn {
    background-color: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

/* 仅在支持hover且使用精确指针(鼠标)的设备上显示悬浮效果 */
@media (hover: hover) and (pointer: fine) {
    .footer-btn:hover {
        background-color: #eff6ff;
        border-color: #dbeafe;
        color: #3d6dff;
    }
}

.footer-btn.active {
    background-color: #eff6ff;
    border-color: #dbeafe;
    color: #3d6dff;
}

/* 文件标签容器 */
.file-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin-bottom: 6px;
}

/* 文件标签 */
.file-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 12px;
    color: #374151;
    max-width: 180px;
}

.file-tag i {
    color: #6b7280;
    font-size: 12px;
    flex-shrink: 0;
}

.file-tag span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 10px;
}

@media (hover: hover) and (pointer: fine) {
    .file-tag-remove:hover {
        background-color: #e5e7eb;
        color: #374151;
    }
}

/* 消息中的文件显示 */
.message-file {
    margin-bottom: 8px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.message-file i {
    color: #6b7280;
}

/* Toast 提示样式 */
#zhiliao-toast-container {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.zhiliao-toast {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.25s ease;
}

.zhiliao-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.zhiliao-toast.hide {
    transform: translateY(20px);
    opacity: 0;
}

.zhiliao-toast i {
    font-size: 12px;
    flex-shrink: 0;
}

/* 拖拽文件样式 */
.zhiliao-page.drag-over {
    background: rgba(59, 130, 246, 0.05);
    border: 2px dashed #3b82f6;
    border-radius: 12px;
}
