/* AI智能助手样式 */
:root {
    --ai-primary-color: #64ffda;
    --ai-secondary-color: #0a192f;
    --ai-accent-color: #00a8ff;
    --ai-text-color: #e6f1ff;
    --ai-shadow-color: rgba(2, 12, 27, 0.7);
    --ai-border-color: rgba(100, 255, 218, 0.3);
}

/* AI助手悬浮挂件 */
.ai-assistant-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-secondary-color), #112240);
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.5);
    z-index: 9999;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.ai-assistant-widget.dragging {
    cursor: grabbing;
    opacity: 0.8;
    transform: scale(1.1);
}

.ai-assistant-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, transparent, transparent, var(--ai-accent-color)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ai-border-rotate 4s linear infinite;
}

.ai-assistant-widget::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(100, 255, 218, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-assistant-widget:hover::after {
    opacity: 1;
}

.ai-assistant-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.7);
}

.ai-assistant-icon {
    color: var(--ai-accent-color);
    font-size: 24px;
    transition: all 0.3s ease;
    z-index: 1;
}

.ai-assistant-widget:hover .ai-assistant-icon {
    color: var(--ai-primary-color);
}

/* 收起状态样式 */
.ai-assistant-widget.collapsed {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
    right: 0;
    transform: translateX(15px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-assistant-widget.collapsed::before {
    border-radius: 10px;
}

.ai-assistant-widget.collapsed:hover {
    transform: translateX(0);
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.6);
}

.ai-assistant-widget.collapsed .ai-assistant-icon {
    font-size: 18px;
    transform: scale(0.9);
}

/* 折叠按钮 */
.ai-collapse-button {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-secondary-color), #112240);
    border: 1px solid var(--ai-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0);
}

.ai-assistant-widget:hover .ai-collapse-button {
    opacity: 1;
    transform: scale(1);
}

.ai-collapse-button:hover {
    background: var(--ai-accent-color);
}

.ai-collapse-button i {
    color: var(--ai-text-color);
    font-size: 10px;
}

/* AI助手脉冲效果 */
.ai-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: ai-pulse 2s ease-out infinite;
    background: radial-gradient(circle at center, var(--ai-accent-color) 0%, transparent 70%);
    opacity: 0;
}

.ai-assistant-widget.collapsed .ai-pulse {
    border-radius: 10px;
}

@keyframes ai-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

@keyframes ai-border-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 增加粒子效果 */
.ai-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    border-radius: 50%;
    pointer-events: none;
}

.ai-assistant-widget.collapsed .ai-particles {
    border-radius: 10px;
}

.ai-particle {
    position: absolute;
    background-color: var(--ai-primary-color);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    animation: ai-float-particle 3s ease-in-out infinite;
}

@keyframes ai-float-particle {
    0% {
        opacity: 0;
        transform: translateY(30px) translateX(0);
    }
    30% {
        opacity: 0.6;
    }
    70% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) translateX(10px);
    }
}

/* 悬浮轨迹效果 */
.ai-assistant-widget .ai-trail {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--ai-accent-color) 0%, transparent 70%);
    opacity: 0;
    z-index: -1;
    animation: ai-trail-fade 1s ease-out forwards;
    pointer-events: none;
}

@keyframes ai-trail-fade {
    0% {
        transform: scale(0.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 优化后的AI助手对话面板 */
.ai-assistant-panel {
    position: fixed;
    width: 420px;
    max-height: 80vh;
    background: linear-gradient(to bottom, var(--ai-secondary-color), #0d1b2a);
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--ai-shadow-color);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--ai-border-color);
    overflow: hidden;
}

.ai-assistant-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: ai-panel-appear 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* 展开模式 */
.ai-assistant-panel.expanded {
    width: 800px;
    height: 80vh;
    max-height: 800px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* 面板头部 */
.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, var(--ai-secondary-color), #0f2942);
    border-bottom: 1px solid var(--ai-border-color);
    position: relative;
    z-index: 2;
}

/* 头部工具栏 */
.ai-panel-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-panel-tool {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ai-text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.ai-panel-tool:hover {
    background-color: rgba(100, 255, 218, 0.15);
    color: var(--ai-primary-color);
    transform: scale(1.1);
}

.ai-panel-tool.active {
    background-color: var(--ai-primary-color);
    color: var(--ai-secondary-color);
}

/* 搜索栏 */
.ai-search-bar {
    padding: 10px 15px;
    background-color: rgba(0, 10, 20, 0.3);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ai-border-color);
}

.ai-search-input {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    color: var(--ai-text-color);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.ai-search-input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.3);
}

.ai-search-close {
    margin-left: 10px;
    cursor: pointer;
    color: var(--ai-text-color);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.ai-search-close:hover {
    opacity: 1;
    color: var(--ai-primary-color);
}

/* 分类标签 */
.ai-category-tabs {
    display: flex;
    padding: 0;
    background: linear-gradient(90deg, rgba(10, 25, 47, 0.9), rgba(13, 30, 55, 0.9));
    border-bottom: 1px solid var(--ai-border-color);
    overflow-x: auto;
    scrollbar-width: none;
    justify-content: space-around;
}

.ai-category-tabs::-webkit-scrollbar {
    display: none;
}

.ai-tab {
    padding: 12px 18px;
    cursor: pointer;
    color: var(--ai-text-color);
    opacity: 0.7;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid transparent;
}

.ai-tab::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ai-primary-color), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ai-tab:hover {
    opacity: 1;
    background-color: rgba(100, 255, 218, 0.05);
}

.ai-tab.active {
    color: var(--ai-primary-color);
    opacity: 1;
    font-weight: 500;
}

.ai-tab.active::before {
    transform: scaleX(1);
    animation: ai-tab-glow 2s infinite;
}

@keyframes ai-tab-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.ai-tab::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(100, 255, 218, 0.1);
}

.ai-tab:last-child::after {
    display: none;
}

/* 改进的消息内容区域 */
.ai-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: rgba(10, 25, 47, 0.7);
    position: relative;
    scroll-behavior: smooth;
    min-height: 200px;
}

/* 自定义滚动条 */
.ai-panel-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ai-panel-content::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.2);
    border-radius: 3px;
}

.ai-panel-content::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.ai-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.5);
}

/* 改进的消息样式 */
.ai-message {
    margin-bottom: 24px;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
    max-width: 100%;
    animation: message-appear 0.5s ease-out;
    transform-origin: left center;
}

.ai-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-message.ai {
    padding-left: 42px;
    margin-right: 20px;
}

.ai-message.user {
    text-align: right;
    margin-left: 20px;
}

.ai-message.search-hidden {
    display: none;
}

.ai-message.search-highlight {
    animation: search-highlight-pulse 2s infinite;
}

.ai-message.category-hidden {
    display: none;
}

@keyframes search-highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(100, 255, 218, 0); }
    50% { box-shadow: 0 0 0 5px rgba(100, 255, 218, 0.2); }
}

/* 消息时间戳 */
.ai-message-time {
    font-size: 11px;
    color: rgba(230, 241, 255, 0.5);
    margin-bottom: 4px;
    white-space: nowrap;
}

.ai-message.user .ai-message-time {
    text-align: right;
}

/* AI头像 */
.ai-avatar {
    position: absolute;
    left: 0;
    top: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #112240, var(--ai-secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ai-border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1;
}

.ai-avatar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, var(--ai-primary-color), transparent);
    animation: ai-avatar-rotate 3s linear infinite;
    opacity: 0.3;
}

@keyframes ai-avatar-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-avatar i {
    color: var(--ai-primary-color);
    font-size: 16px;
    transition: all 0.3s ease;
    animation: ai-avatar-glow 3s infinite;
    z-index: 1;
}

@keyframes ai-avatar-glow {
    0%, 100% { text-shadow: 0 0 3px rgba(100, 255, 218, 0.3); }
    50% { text-shadow: 0 0 10px rgba(100, 255, 218, 0.8), 0 0 15px rgba(0, 168, 255, 0.6); }
}

/* 消息内容容器 */
.ai-message-content {
    display: inline-block;
    max-width: 100%;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    text-align: left;
    line-height: 1.5;
    transition: all 0.3s ease;
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.ai-message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    z-index: -1;
    opacity: 0.85;
}

.ai-message.ai .ai-message-content {
    background: transparent;
    color: var(--ai-text-color);
    border-top-left-radius: 4px;
    border-left: 2px solid var(--ai-primary-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ai-message.ai .ai-message-content::before {
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.95), rgba(17, 34, 64, 0.95));
}

/* 添加AI消息的高科技装饰 */
.ai-message.ai .ai-message-content::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at top right, rgba(100, 255, 218, 0.15), transparent 70%);
    opacity: 0.7;
    z-index: -1;
    border-top-right-radius: 18px;
}

/* 添加AI消息内容的闪光边缘效果 */
.ai-message.ai {
    position: relative;
}

.ai-message.ai::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 40px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--ai-primary-color), transparent);
    opacity: 0.5;
}

.ai-message.ai::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 20px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ai-primary-color));
    opacity: 0.3;
}

.ai-message.user .ai-message-content {
    background: transparent;
    color: var(--ai-text-color);
    border-top-right-radius: 4px;
    border-right: 2px solid var(--ai-accent-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ai-message.user .ai-message-content::before {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.2), rgba(100, 255, 218, 0.2));
}

.ai-message.ai .ai-message-content:hover,
.ai-message.user .ai-message-content:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* 针对长文本优化显示 */
.ai-message-content {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* 增强AI消息段落样式 */
.ai-message-content p {
    margin: 0 0 12px 0;
    position: relative;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

/* 强化代码块样式 */
.ai-message-content pre {
    background: rgba(17, 34, 64, 0.6);
    border-radius: 8px;
    padding: 12px;
    border-left: 2px solid var(--ai-primary-color);
    margin: 12px 0;
    overflow-x: auto;
    position: relative;
}

.ai-message-content pre::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ai-primary-color));
}

.ai-message-content pre::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30%;
    height: 1px;
    background: linear-gradient(90deg, var(--ai-primary-color), transparent);
}

/* 美化表格样式 */
.ai-message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(100, 255, 218, 0.15);
}

.ai-message-content th {
    background: rgba(100, 255, 218, 0.1);
    color: var(--ai-primary-color);
    text-align: left;
    padding: 10px;
    font-weight: normal;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

.ai-message-content td {
    padding: 10px;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.ai-message-content tr:last-child td {
    border-bottom: none;
}

/* 强化列表样式 */
.ai-message-content ul, 
.ai-message-content ol {
    padding-left: 18px;
    margin: 10px 0;
}

.ai-message-content li {
    margin-bottom: 8px;
    position: relative;
}

.ai-message-content ul li::marker {
    color: var(--ai-primary-color);
}

/* 代码和引用样式 */
.ai-message-content code:not(pre code) {
    background: rgba(100, 255, 218, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    color: var(--ai-primary-color);
}

.ai-message-content blockquote {
    border-left: 3px solid var(--ai-primary-color);
    margin: 10px 0;
    padding: 8px 15px;
    background: rgba(10, 25, 47, 0.3);
    border-radius: 0 6px 6px 0;
}

/* 链接样式 */
.ai-message-content a {
    color: var(--ai-primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--ai-primary-color);
    transition: all 0.2s ease;
}

.ai-message-content a:hover {
    border-bottom: 1px solid var(--ai-primary-color);
    text-shadow: 0 0 8px rgba(100, 255, 218, 0.5);
}

/* 强调元素样式 */
.ai-message-content strong, 
.ai-message-content b {
    color: var(--ai-primary-color);
    font-weight: bold;
}

.ai-message-content em, 
.ai-message-content i {
    color: rgba(100, 255, 218, 0.9);
    font-style: italic;
}

/* 搜索高亮 */
.search-term {
    background-color: rgba(100, 255, 218, 0.3);
    padding: 0 2px;
    border-radius: 3px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(100, 255, 218, 0.3);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* 消息工具栏 */
.ai-message-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ai-message:hover .ai-message-toolbar {
    opacity: 1;
}

.ai-message-tool {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ai-text-color);
    position: relative;
}

.ai-message-tool:hover {
    background-color: rgba(100, 255, 218, 0.15);
    color: var(--ai-primary-color);
}

.ai-message-tool[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--ai-secondary-color);
    color: var(--ai-primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
    animation: tooltip-fade 1.5s forwards;
}

@keyframes tooltip-fade {
    0%, 80% { opacity: 1; }
    100% { opacity: 0; }
}

.ai-message-tool.speaking {
    background-color: var(--ai-primary-color);
    color: var(--ai-secondary-color);
    animation: speaking-pulse 1s infinite;
}

@keyframes speaking-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 思考中动画效果 */
.ai-thinking-indicator {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-top: 10px;
    background: rgba(10, 25, 47, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(100, 255, 218, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: thinking-appear 0.3s ease-out forwards;
    width: 220px;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

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

.ai-thinking-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-secondary-color), #112240);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    position: relative;
    border: 1px solid var(--ai-border-color);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ai-thinking-avatar::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--ai-accent-color), var(--ai-primary-color)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: thinking-rotate 3s linear infinite;
    opacity: 0.7;
}

@keyframes thinking-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-thinking-avatar i {
    color: var(--ai-primary-color);
    font-size: 16px;
    animation: thinking-pulse 1.5s ease infinite;
}

@keyframes thinking-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.ai-thinking-content {
    flex: 1;
}

.ai-thinking-progress-container {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ai-thinking-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ai-accent-color), var(--ai-primary-color));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.ai-thinking-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: progress-shine 1.5s linear infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 增强粒子效果 */
.ai-thinking-particle {
    position: absolute;
    background-color: var(--ai-primary-color);
    width: 2px;
    height: 2px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    box-shadow: 0 0 6px 2px rgba(100, 255, 218, 0.3);
}

@keyframes thinking-particle-float {
    0% {
        opacity: 0;
        transform: translateY(10px) translateX(0) scale(1);
    }
    20% {
        opacity: 0.8;
        transform: translateY(5px) translateX(5px) scale(1.2);
    }
    80% {
        opacity: 0.5;
        transform: translateY(-5px) translateX(15px) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px) translateX(25px) scale(0.5);
    }
}

/* 输入区域 */
.ai-panel-input {
    padding: 12px 15px;
    background-color: rgba(10, 25, 47, 0.9);
    display: flex;
    align-items: flex-end;
    position: relative;
    border-top: 1px solid var(--ai-border-color);
}

.ai-input-field {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--ai-border-color);
    border-radius: 20px;
    padding: 12px 15px;
    color: var(--ai-text-color);
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 20px;
    overflow-y: auto;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.ai-input-field:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--ai-primary-color);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.2);
}

/* 自定义滚动条 */
.ai-input-field::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ai-input-field::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.2);
    border-radius: 3px;
}

.ai-input-field::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 3px;
}

.ai-input-field::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.5);
}

/* 面板底部 */
.ai-panel-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: rgba(10, 25, 47, 0.7);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.ai-history-button,
.ai-clear-button {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--ai-text-color);
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 10px;
    border-radius: 4px;
}

.ai-history-button:hover,
.ai-clear-button:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
}

.ai-history-button i,
.ai-clear-button i {
    margin-right: 5px;
    font-size: 14px;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .ai-assistant-panel {
        width: calc(100% - 40px);
        max-height: 80vh;
        bottom: 80px;
    }
    
    .ai-assistant-widget {
        bottom: 20px;
        right: 20px;
    }
}

/* 模型信息 */
.ai-model-info {
    padding: 10px 20px;
    font-size: 12px;
    color: var(--ai-text-color);
    opacity: 0.5;
    text-align: center;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    background: linear-gradient(90deg, rgba(10, 25, 47, 0), rgba(17, 34, 64, 0.5), rgba(10, 25, 47, 0));
}

/* 快捷问题区域 */
.ai-quick-questions {
    padding: 8px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: rgba(10, 25, 47, 0.5);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.ai-quick-question {
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(17, 34, 64, 0.8), rgba(10, 25, 47, 0.8));
    border: 1px solid var(--ai-border-color);
    border-radius: 18px;
    font-size: 13px;
    color: var(--ai-text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    animation: ai-question-appear 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ai-quick-question::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(100, 255, 218, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ai-quick-question:hover::before {
    opacity: 1;
}

.ai-quick-question:nth-child(1) { animation-delay: 0.1s; }
.ai-quick-question:nth-child(2) { animation-delay: 0.2s; }
.ai-quick-question:nth-child(3) { animation-delay: 0.3s; }
.ai-quick-question:nth-child(4) { animation-delay: 0.4s; }
.ai-quick-question:nth-child(5) { animation-delay: 0.5s; }

@keyframes ai-question-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-quick-question:hover {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.2), rgba(100, 255, 218, 0.2));
    border-color: var(--ai-accent-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--ai-primary-color);
}

/* 发送按钮 */
.ai-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-accent-color), #3498db);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--ai-text-color);
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    margin-left: 12px;
    position: relative;
    overflow: hidden;
}

.ai-send-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ai-send-button:hover::before {
    opacity: 1;
    animation: ai-send-pulse 1.5s ease-out infinite;
}

@keyframes ai-send-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.ai-send-button:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 5px 15px rgba(0, 168, 255, 0.4);
    background: linear-gradient(135deg, #00b8ff, #2979ff);
}

.ai-send-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ai-send-button i {
    transform: translateX(1px);
    animation: ai-send-icon 2s ease infinite;
}

@keyframes ai-send-icon {
    0%, 100% {
        transform: translateX(0px);
    }
    50% {
        transform: translateX(2px);
    }
}

/* 历史会话视图样式 */
.ai-history-view {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    background: linear-gradient(to bottom, var(--ai-secondary-color), #0d1b2a);
    border-radius: 16px;
    box-shadow: 0 10px 25px var(--ai-shadow-color);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ai-border-color);
    overflow: hidden;
    animation: ai-history-appear 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes ai-history-appear {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ai-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, var(--ai-secondary-color), #0f2942);
    border-bottom: 1px solid var(--ai-border-color);
}

.ai-history-title {
    display: flex;
    align-items: center;
    color: var(--ai-text-color);
    font-size: 16px;
    font-weight: 500;
}

.ai-history-title i {
    margin-right: 10px;
    color: var(--ai-primary-color);
}

.ai-history-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ai-text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.ai-history-close:hover {
    background-color: rgba(100, 255, 218, 0.15);
    color: var(--ai-primary-color);
    transform: scale(1.1);
}

.ai-history-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: rgba(10, 25, 47, 0.7);
}

/* 自定义滚动条 */
.ai-history-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.ai-history-content::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.2);
    border-radius: 3px;
}

.ai-history-content::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.ai-history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 255, 218, 0.5);
}

.ai-history-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--ai-text-color);
    opacity: 0.6;
    font-style: italic;
}

.ai-history-item {
    margin-bottom: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.8), rgba(17, 34, 64, 0.8));
    border-radius: 12px;
    border-left: 2px solid var(--ai-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.ai-history-item:hover {
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.9), rgba(17, 34, 64, 0.9));
    border-left-color: var(--ai-primary-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ai-history-item-info {
    flex: 1;
    overflow: hidden;
}

.ai-history-item-title {
    color: var(--ai-text-color);
    font-size: 14px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-history-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: rgba(230, 241, 255, 0.5);
}

.ai-history-item-actions {
    display: flex;
    gap: 8px;
}

.ai-history-item-load,
.ai-history-item-delete {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-history-item-load {
    background-color: rgba(100, 255, 218, 0.2);
    color: var(--ai-primary-color);
}

.ai-history-item-load:hover {
    background-color: rgba(100, 255, 218, 0.3);
}

.ai-history-item-delete {
    background-color: rgba(255, 99, 71, 0.2);
    color: #ff6347;
}

.ai-history-item-delete:hover {
    background-color: rgba(255, 99, 71, 0.3);
}

/* 面板拖动样式 */
.ai-assistant-panel.dragging {
    cursor: grabbing;
    user-select: none;
    opacity: 0.95;
    transition: none;
}

.ai-panel-header {
    cursor: grab;
}

.ai-panel-header:active {
    cursor: grabbing;
}

/* 减少初始空白区域 */
.ai-quick-questions {
    padding: 5px 10px;
    gap: 6px;
}

.ai-quick-question {
    padding: 6px 12px;
    font-size: 12px;
}

.ai-panel-footer {
    padding: 8px 15px;
}

/* API设置相关样式 */
.ai-api-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: settings-overlay-fade 0.3s ease-in-out;
}

@keyframes settings-overlay-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ai-api-settings {
    background: linear-gradient(to bottom, var(--ai-secondary-color), #112240);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(2, 12, 27, 0.7), 0 0 0 1px rgba(100, 255, 218, 0.2);
    width: 450px;
    max-width: 90%;
    overflow: hidden;
    animation: settings-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes settings-appear {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

.ai-settings-header {
    background: linear-gradient(to right, rgba(0, 168, 255, 0.1), rgba(100, 255, 218, 0.1));
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(100, 255, 218, 0.2);
}

.ai-settings-header h3 {
    color: var(--ai-primary-color);
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

.ai-settings-close {
    background: none;
    border: none;
    color: var(--ai-text-color);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.ai-settings-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--ai-primary-color);
}

.ai-settings-body {
    padding: 20px;
    color: var(--ai-text-color);
}

.ai-settings-body p {
    margin: 0 0 15px;
    line-height: 1.5;
    font-size: 14px;
    opacity: 0.9;
}

.ai-settings-form {
    margin-top: 20px;
}

.ai-settings-form-group {
    margin-bottom: 15px;
    position: relative;
}

.ai-settings-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ai-primary-color);
    font-size: 14px;
}

.ai-settings-form-group input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: rgba(2, 12, 27, 0.7);
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: 5px;
    color: var(--ai-text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.ai-settings-form-group input:focus {
    outline: none;
    border-color: var(--ai-primary-color);
    box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.2);
}

.ai-toggle-key-visibility {
    position: absolute;
    right: 8px;
    top: 33px;
    background: none;
    border: none;
    color: var(--ai-text-color);
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-toggle-key-visibility:hover {
    opacity: 1;
    color: var(--ai-primary-color);
}

.ai-api-status {
    display: flex;
    align-items: center;
    margin-top: 20px;
    padding: 12px;
    background: rgba(2, 12, 27, 0.5);
    border-radius: 5px;
    font-size: 14px;
}

.status-label {
    margin-right: 8px;
    opacity: 0.8;
}

.status-value {
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.status-value.active {
    background-color: rgba(100, 255, 218, 0.2);
    color: var(--ai-primary-color);
}

.status-value.mock {
    background-color: rgba(255, 184, 108, 0.2);
    color: #ffb86c;
}

.ai-settings-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    background: rgba(2, 12, 27, 0.5);
}

.ai-settings-footer button {
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.ai-settings-save {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.8), rgba(100, 255, 218, 0.8));
    border: none;
    color: var(--ai-secondary-color);
    font-weight: 500;
}

.ai-settings-save:hover {
    background: linear-gradient(135deg, rgba(0, 168, 255, 1), rgba(100, 255, 218, 1));
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

.ai-settings-test {
    background-color: transparent;
    border: 1px solid rgba(0, 168, 255, 0.6);
    color: var(--ai-accent-color);
}

.ai-settings-test:hover {
    background-color: rgba(0, 168, 255, 0.2);
    border-color: var(--ai-accent-color);
}

.ai-settings-test:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-settings-cancel {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--ai-text-color);
}

.ai-settings-cancel:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 模式标识 */
.ai-assistant-panel.mock-mode .ai-panel-title-text::after {
    content: '';
    font-size: 12px;
    opacity: 0.7;
    margin-left: 6px;
    color: #ffb86c;
}

.ai-assistant-panel.api-mode .ai-panel-title-text::after {
    content: '';
    font-size: 12px;
    opacity: 0.7;
    margin-left: 6px;
    color: var(--ai-primary-color);
}

/* API错误通知样式 */
.ai-api-error-notice {
    margin-top: 15px;
    background-color: rgba(255, 99, 71, 0.1);
    border: 1px solid rgba(255, 99, 71, 0.3);
    border-radius: 5px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-api-error-notice.hidden {
    display: none;
}

.error-icon {
    color: #ff6347;
    font-size: 16px;
}

.error-message {
    color: #ff6347;
    font-size: 13px;
    line-height: 1.5;
}

/* 打字动画样式 */
.ai-typing-animation {
    display: inline-block;
    min-height: 20px;
    position: relative;
}

.ai-typing-animation::after {
    content: '|';
    position: relative;
    display: inline-block;
    opacity: 1;
    margin-left: 2px;
    animation: cursor-blink 0.8s infinite;
    color: var(--ai-primary-color);
    font-weight: normal;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 消息出现动画优化 */
@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 朗读按钮动画 */
.ai-message-tool[data-action="speak"].speaking {
    position: relative;
    animation: speak-wave 1.5s infinite;
}

.ai-message-tool[data-action="speak"].speaking::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--ai-primary-color);
    animation: speak-expand 2s infinite;
}

@keyframes speak-wave {
    0%, 100% { background-color: rgba(100, 255, 218, 0.15); }
    50% { background-color: rgba(100, 255, 218, 0.3); }
}

@keyframes speak-expand {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* 复制按钮动画 */
.ai-message-tool[data-action="copy"]:active {
    transform: scale(0.9);
    transition: transform 0.1s;
} 