/* AI助手容器 */
#qc-aibot-container {
    position: fixed;
    z-index: 1000;
}

/* 按钮位置 - 右下角 */
#qc-aibot-container.qc-aibot-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* AI助手按钮 - 现代化设计 */
#qc-aibot-button {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

#qc-aibot-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 3px 20px rgba(0, 0, 0, 0.3);
}

#qc-aibot-button:active {
    transform: translateY(-1px);
}

#qc-aibot-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    transition: all 0.6s;
}

#qc-aibot-button:hover::before {
    transform: rotate(30deg) translate(20%, 20%);
}

.qc-aibot-icon {
    font-size: 26px;
    color: white;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 聊天窗口 */
#qc-aibot-chat-window {
    position: absolute;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#qc-aibot-container.qc-aibot-bottom-right #qc-aibot-chat-window {
    bottom: 80px;
    right: 50px; /* 从20px增加到50px，使对话框进一步向左移动 */
    transform-origin: bottom right;
}

#qc-aibot-container.qc-aibot-bottom-left #qc-aibot-chat-window {
    bottom: 80px;
    left: 0;
    transform-origin: bottom left;
}

#qc-aibot-container.qc-aibot-top-right #qc-aibot-chat-window {
    top: 80px;
    right: 0;
    transform-origin: top right;
}

#qc-aibot-container.qc-aibot-top-left #qc-aibot-chat-window {
    top: 80px;
    left: 0;
    transform-origin: top left;
}

#qc-aibot-chat-window.open {
    transform: scale(1);
}

/* 聊天窗口头部 */
.qc-aibot-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.qc-aibot-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.1) 50%, transparent 52%);
    background-size: 20px 20px;
    opacity: 0.4;
}

.qc-aibot-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.qc-aibot-chat-header h3::before {
    content: "🤖";
    margin-right: 10px;
}

.qc-aibot-chat-header-buttons {
    display: flex;
    gap: 10px;
}

/* 全屏控制按钮 */
/* 右下角图标位置调整 */
.qc-aibot-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* 全屏按钮样式 */
.qc-aibot-fullscreen-btn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.qc-aibot-fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* 全屏模式样式 */
#qc-aibot-chat-window.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    z-index: 9999;
    border-radius: 0;
    box-shadow: none;
}

/* 全屏模式下的消息区域 */
#qc-aibot-chat-window.fullscreen .qc-aibot-chat-messages {
    height: calc(100% - 120px); /* 调整为适合全屏的高度 */
}

/* 深色模式适配 */
[data-color-scheme="dark"] .qc-aibot-fullscreen-btn {
    color: #ccc;
}

[data-color-scheme="dark"] .qc-aibot-fullscreen-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 停止思考按钮优化 */
.qc-aibot-stop-thinking-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 18px;
    padding: 6px 12px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.qc-aibot-stop-thinking-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.qc-aibot-stop-thinking-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

/* 深色模式下的停止思考按钮 */
[data-color-scheme="dark"] .qc-aibot-stop-thinking-btn {
    background: linear-gradient(135deg, #5b67d8 0%, #805ad5 100%);
    box-shadow: 0 2px 5px rgba(91, 103, 216, 0.4);
}

[data-color-scheme="dark"] .qc-aibot-stop-thinking-btn:hover {
    background: linear-gradient(135deg, #805ad5 0%, #5b67d8 100%);
    box-shadow: 0 4px 8px rgba(91, 103, 216, 0.5);
}

#qc-aibot-container.qc-aibot-bottom-right #qc-aibot-chat-window.fullscreen,
#qc-aibot-container.qc-aibot-bottom-left #qc-aibot-chat-window.fullscreen,
#qc-aibot-container.qc-aibot-top-right #qc-aibot-chat-window.fullscreen,
#qc-aibot-container.qc-aibot-top-left #qc-aibot-chat-window.fullscreen {
    bottom: auto;
    right: auto;
    left: auto;
    top: auto;
    transform-origin: center;
}

/* 深色模式下的全屏按钮 */
#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-fullscreen-btn,
.io-black-mode .qc-aibot-fullscreen-btn {
    color: rgba(255, 255, 255, 0.8);
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-fullscreen-btn:hover,
.io-black-mode .qc-aibot-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.qc-aibot-chat-header-buttons {
    display: flex;
    gap: 10px;
}

.qc-aibot-header-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.qc-aibot-header-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 聊天消息区域 */
.qc-aibot-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
    list-style-type: none; /* 确保消息容器不显示列表样式 */
}

/* 消息样式 */
.qc-aibot-message {
    display: flex;
    animation: messageAppear 0.3s ease-out;
    list-style-type: none; /* 确保单个消息不显示列表样式 */
    counter-reset: none; /* 重置计数器 */
}

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

.qc-aibot-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.qc-aibot-bot {
    align-self: flex-start;
    justify-content: flex-start;
    list-style-type: none; /* 移除列表样式，防止额外序号显示 */
}

/* 确保卡片容器也没有列表样式 */
.qc-aibot-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    max-width: 80%;
    list-style-type: none; /* 确保内容区域不显示列表样式 */
    counter-reset: none; /* 重置计数器 */
    transition: all 0.2s ease;
}

.qc-aibot-user .qc-aibot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.qc-aibot-bot .qc-aibot-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 卡片样式优化 */
.qc-aibot-card {
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 12px 0;
    background-color: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    list-style-type: none; /* 确保卡片本身不显示列表样式 */
}

.qc-aibot-card:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
}

.qc-aibot-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    list-style-type: none; /* 确保卡片头部不显示列表样式 */
}

/* 防止任何可能的伪元素或计数器导致的额外序号 */
.qc-aibot-message-content::before,
.qc-aibot-message-content::after,
.qc-aibot-bot::before,
.qc-aibot-bot::after,
.qc-aibot-card::before,
.qc-aibot-card::after {
    content: none !important;
}

/* 确保卡片容器内的任何列表元素都不显示默认序号 */
.qc-aibot-message-content ul,
.qc-aibot-message-content ol,
.qc-aibot-message-content li {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.qc-aibot-card-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}

.qc-aibot-card h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.qc-aibot-card h4 a {
    color: #202020;
    text-decoration: none;
    display: block;
    width: 100%;
}

.qc-aibot-card h4 a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* 隐藏卡片内的摘要内容 */
.qc-aibot-card p {
    display: none;
}

/* 优化分类标签位置和样式 */
.qc-aibot-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    width: 100%;
    align-self: flex-end;
}

.qc-aibot-card-type {
    background-color: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.qc-aibot-card-category {
    background-color: #f0f0f0;
    color: #555;
    padding: 3px 8px;
    border-radius: 12px;
}


/* 悬浮提示样式已移除 */
/*
.qc-aibot-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    width: max-content;
    max-width: 300px;
    white-space: normal;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.qc-aibot-card:hover .qc-aibot-tooltip {
    opacity: 1;
    visibility: visible;
}

.qc-aibot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
*/

/* 输入区域 */
.qc-aibot-chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

#qc-aibot-user-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: white;
    color: #333;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
}

#qc-aibot-user-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

#qc-aibot-send-button {
    padding: 12px 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
}

#qc-aibot-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#qc-aibot-send-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

#qc-aibot-send-button::before {
    content: "发送";
}

/* 隐藏状态 */
.qc-aibot-hidden {
    display: none;
}

/* 加载动画 */
.qc-aibot-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

.qc-aibot-bot .qc-aibot-loading {
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
}

/* 停止思考按钮样式 - 美化版本 */
.qc-aibot-stop-thinking-btn {
    background: none;
    border: 1px solid #ddd;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    font-weight: 500;
}

.qc-aibot-stop-thinking-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.qc-aibot-stop-thinking-btn:active {
    transform: translateY(0);
}

/* 深色模式下的停止思考按钮样式 */
#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-stop-thinking-btn,
.io-black-mode .qc-aibot-stop-thinking-btn {
    border-color: #555;
    color: #667eea;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-stop-thinking-btn:hover,
.io-black-mode .qc-aibot-stop-thinking-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 深色模式 */
#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-chat-window,
.io-black-mode #qc-aibot-chat-window {
    background: #2d2d2d;
    color: #ffffff;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-header,
.io-black-mode .qc-aibot-chat-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-messages,
.io-black-mode .qc-aibot-chat-messages {
    background-color: #1e1e1e;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-bot .qc-aibot-message-content,
.io-black-mode .qc-aibot-bot .qc-aibot-message-content {
    background-color: #3d3d3d;
    color: #ffffff;
    border-color: #444;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-card,
.io-black-mode .qc-aibot-card {
    border-color: #555;
    background-color: #333;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-card h4 a,
.io-black-mode .qc-aibot-card h4 a {
    color: #ffffff;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-card h4 a:hover,
.io-black-mode .qc-aibot-card h4 a:hover {
    color: #667eea;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-card-category,
.io-black-mode .qc-aibot-card-category {
    background-color: #444;
    color: #fff;
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-input,
.io-black-mode .qc-aibot-chat-input {
    background: #2d2d2d;
    border-top: 1px solid #444;
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input,
.io-black-mode #qc-aibot-user-input {
    background-color: #3d3d3d;
    color: #ffffff;
    border-color: #555;
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input:focus,
.io-black-mode #qc-aibot-user-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-send-button,
.io-black-mode #qc-aibot-send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #qc-aibot-chat-window {
        width: 320px;
        height: 450px;
    }
    
    #qc-aibot-button {
        width: 55px;
        height: 55px;
    }
    
    .qc-aibot-icon {
        font-size: 24px;
    }
    
    #qc-aibot-container.qc-aibot-bottom-right #qc-aibot-chat-window,
    #qc-aibot-container.qc-aibot-bottom-left #qc-aibot-chat-window {
        bottom: 70px;
    }
    
    #qc-aibot-container.qc-aibot-top-right #qc-aibot-chat-window,
    #qc-aibot-container.qc-aibot-top-left #qc-aibot-chat-window {
        top: 70px;
    }
}

@media (max-width: 480px) {
    #qc-aibot-chat-window {
        width: 280px;
        height: 400px;
    }
    
    #qc-aibot-container.qc-aibot-bottom-right,
    #qc-aibot-container.qc-aibot-bottom-left {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
    
    #qc-aibot-container.qc-aibot-top-right,
    #qc-aibot-container.qc-aibot-top-left {
        top: 20px;
        right: 20px;
        left: auto;
    }
    
    #qc-aibot-button {
        width: 50px;
        height: 50px;
    }
    
    .qc-aibot-icon {
        font-size: 22px;
    }
}

/* 滚动条样式 */
.qc-aibot-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.qc-aibot-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.qc-aibot-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.qc-aibot-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 增强输入区域交互效果 */
#qc-aibot-user-input::-webkit-input-placeholder {
    color: #a0a0a0;
}

#qc-aibot-user-input:-moz-placeholder {
    color: #a0a0a0;
    opacity: 1;
}

#qc-aibot-user-input::-moz-placeholder {
    color: #a0a0a0;
    opacity: 1;
}

#qc-aibot-user-input:-ms-input-placeholder {
    color: #a0a0a0;
}

/* 优化深色模式下的输入框占位符 */
#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input::-webkit-input-placeholder,
.io-black-mode #qc-aibot-user-input::-webkit-input-placeholder {
    color: #777;
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input:-moz-placeholder,
.io-black-mode #qc-aibot-user-input:-moz-placeholder {
    color: #777;
    opacity: 1;
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input::-moz-placeholder,
.io-black-mode #qc-aibot-user-input::-moz-placeholder {
    color: #777;
    opacity: 1;
}

#qc-aibot-container[data-color-scheme="dark"] #qc-aibot-user-input:-ms-input-placeholder,
.io-black-mode #qc-aibot-user-input:-ms-input-placeholder {
    color: #777;
}

/* 增强深色模式下的视觉反馈 */
#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-chat-input,
.io-black-mode .qc-aibot-chat-input {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

/* 优化消息气泡在深色模式下的视觉效果 */
#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-bot .qc-aibot-message-content,
.io-black-mode .qc-aibot-bot .qc-aibot-message-content {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* 优化卡片悬停效果在深色模式 */
#qc-aibot-container[data-color-scheme="dark"] .qc-aibot-card:hover,
.io-black-mode .qc-aibot-card:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
    border-color: rgba(102, 126, 234, 0.4);
}