/**
 * AI聊天界面样式 - QQ风格
 */

/* 聊天按钮 */
.zibll-ai-chat-button {
    position: fixed;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    z-index: 9998;
    transition: all 0.3s ease;
    border: none;
    animation: float 3s ease-in-out infinite;
}

.zibll-ai-chat-button:hover {
    background: transparent;
    transform: scale(1.1);
    animation: pulse 1s ease-in-out infinite;
}

.zibll-ai-chat-button:active {
    transform: scale(0.9);
    animation: none;
}

.zibll-ai-chat-button-icon {
    width: 40px;
    height: 40px;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(33, 204, 124, 0.3));
}

.zibll-ai-chat-button:hover .zibll-ai-chat-button-icon {
    transform: rotate(5deg) scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(33, 204, 124, 0.5));
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* 呼吸动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

.zibll-ai-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.zibll-ai-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* 聊天窗口 */
.zibll-ai-chat-widget {
    position: fixed;
    width: 400px;
    height: 600px;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.zibll-ai-chat-widget.zibll-ai-position-bottom-right {
    bottom: 50px;
    right: 20px;
}

.zibll-ai-chat-widget.zibll-ai-position-bottom-left {
    bottom: 50px;
    left: 20px;
}

/* 响应式 */
@media (max-width: 600px) {
    .zibll-ai-chat-widget {
        width: calc(100% - 40px);
        height: calc(100vh - 120px);
        bottom: 50px !important;
        left: 20px !important;
        right: 20px !important;
    }
}

/* 头部 */
.zibll-ai-chat-header {
    background: #12B7F5;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.zibll-ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.zibll-ai-chat-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.zibll-ai-chat-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.zibll-ai-chat-title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zibll-ai-chat-title-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.zibll-ai-chat-status {
    font-size: 11px;
    opacity: 0.9;
    line-height: 1;
}

.zibll-ai-chat-header-actions {
    display: flex;
    gap: 4px;
}

.zibll-ai-chat-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.zibll-ai-chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 容器布局 */
.zibll-ai-chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.zibll-ai-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.zibll-ai-chat-sidebar {
    display: none; /* 隐藏侧边栏，更简洁 */
}

.zibll-ai-chat-sidebar-avatar {
    text-align: center;
}

.zibll-ai-chat-sidebar-info {
    margin-top: 12px;
}

.zibll-ai-chat-sidebar-info h3 {
    font-size: 14px;
    color: #333;
    margin: 0 0 4px 0;
    font-weight: 600;
}

.zibll-ai-chat-sidebar-info p {
    font-size: 12px;
    color: #999;
    margin: 0;
}

/* 头像 */
.zibll-ai-chat-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #12B7F5 0%, #0D8BD9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.zibll-ai-chat-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.zibll-ai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.zibll-ai-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 消息区域 */
.zibll-ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f5f5f5;
}

.zibll-ai-chat-welcome {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* 快速导航 */
.zibll-ai-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    max-width: 100%;
}

/* 对话框内显示的导航 */
.zibll-ai-chat-nav-display .zibll-ai-quick-nav {
    justify-content: flex-start;
    margin-top: 8px;
}

.zibll-ai-quick-nav-item {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.zibll-ai-quick-nav-item:hover {
    background: #12B7F5;
    color: #fff;
    border-color: #12B7F5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(18, 183, 245, 0.3);
}

.zibll-ai-chat-message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.zibll-ai-chat-message.user {
    flex-direction: row-reverse;
}

.zibll-ai-chat-message.assistant {
    flex-direction: row;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zibll-ai-chat-message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 50px);
    gap: 2px;
}

.zibll-ai-chat-message.user .zibll-ai-chat-message-wrapper {
    align-items: flex-end;
}

.zibll-ai-chat-message.assistant .zibll-ai-chat-message-wrapper {
    align-items: flex-start;
}

.zibll-ai-chat-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 8px;
    margin-bottom: 4px;
    display: none; /* 隐藏时间戳，更简洁 */
}

.zibll-ai-chat-message-content {
    position: relative;
    padding: 8px 12px;
    border-radius: 8px;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.6;
    font-size: 14px;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 简洁风格消息气泡（无尾巴） */
.zibll-ai-chat-message.user .zibll-ai-chat-message-content {
    background: #12B7F5;
    color: #fff;
    border-radius: 8px;
}

.zibll-ai-chat-message.assistant .zibll-ai-chat-message-content {
    background: #fff;
    color: #333;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.zibll-ai-chat-message-loading {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.zibll-ai-chat-message-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #12B7F5;
    animation: bounce 1.4s infinite ease-in-out both;
}

.zibll-ai-chat-message-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.zibll-ai-chat-message-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 输入区域 */
.zibll-ai-chat-footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 10px;
}

/* 导航按钮区域 */
.zibll-ai-chat-nav-button-wrapper {
    margin-bottom: 8px;
    display: flex;
    justify-content: flex-start;
}

.zibll-ai-chat-nav-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 24px;
    height: 24px;
    min-width: 24px;
}

.zibll-ai-chat-nav-btn:hover {
    background: #12B7F5;
    border-color: #12B7F5;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(18, 183, 245, 0.3);
}

.zibll-ai-chat-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(18, 183, 245, 0.2);
}

.zibll-ai-chat-nav-icon {
    width: 14px;
    height: 14px;
    display: block;
    transition: all 0.2s ease;
}

.zibll-ai-chat-nav-btn:hover .zibll-ai-chat-nav-icon {
    filter: brightness(0) invert(1); /* 悬停时图标变白色 */
}

.zibll-ai-chat-toolbar {
    display: none; /* 隐藏工具栏，更简洁 */
}

.zibll-ai-chat-tool-btn {
    background: transparent;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.zibll-ai-chat-tool-btn:hover {
    background: #f0f0f0;
    color: #12B7F5;
}

.zibll-ai-chat-input-wrapper {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.zibll-ai-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    min-height: 36px;
    font-family: inherit;
    transition: border-color 0.2s;
    color: #333;
    background: #fff;
    box-sizing: border-box;
}

.zibll-ai-chat-input:focus {
    outline: none;
    border-color: #12B7F5;
}

.zibll-ai-chat-send-area {
    display: none; /* 发送按钮移到输入框旁边 */
}

.zibll-ai-chat-send-btn {
    background: #12B7F5;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 0 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 36px;
    min-width: 60px;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(18, 183, 245, 0.2);
}

.zibll-ai-chat-send-btn:hover:not(:disabled) {
    background: #0D8BD9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(18, 183, 245, 0.4);
}

.zibll-ai-chat-send-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(18, 183, 245, 0.2);
}

.zibll-ai-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
    box-shadow: none;
}

/* 滚动条样式 */
.zibll-ai-chat-body::-webkit-scrollbar {
    width: 6px;
}

.zibll-ai-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.zibll-ai-chat-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.zibll-ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}
