.ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.ai-chat-container.minimized {
    height: 64px;
    width: 64px;
    background: transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ai-chat-container.minimized:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ai-chat-container.minimized .ai-chat-header {
    background: transparent;
    padding: 0;
    height: 100%;
    width: 100%;
}

.ai-chat-container.minimized .ai-chat-toggle {
    width: 100%;
    height: 100%;
    background: url('../images/genie.png') center center no-repeat;
    background-size: contain;
    transition: transform 0.3s ease;
    border: none;
    box-shadow: none;
}

/* Logo悬停动画 */
.ai-chat-container.minimized:hover .ai-chat-toggle {
    transform: scale(1.1) rotate(5deg);
}

/* 展开状态的头部样式 */
.ai-chat-header {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    padding: 15px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ai-chat-header:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.ai-chat-header h3:before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* 最小化按钮样式 */
.ai-chat-container:not(.minimized) .ai-chat-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ai-chat-container:not(.minimized) .ai-chat-toggle:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

.ai-chat-container:not(.minimized) .ai-chat-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 确保隐藏其他元素 */
.ai-chat-container.minimized .ai-chat-messages,
.ai-chat-container.minimized .ai-chat-input,
.ai-chat-container.minimized h3 {
    display: none;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
    display: none;
}

.ai-chat-container:not(.minimized) .ai-chat-messages {
    display: block;
}

.ai-chat-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    animation: messageAppear 0.3s ease;
}

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

.ai-chat-message.user {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.2);
}

.ai-chat-message.assistant {
    background: white;
    color: #2c3e50;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ai-chat-input {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #fff;
    display: none;
}

.ai-chat-container:not(.minimized) .ai-chat-input {
    display: block;
}

.ai-chat-input textarea {
    width: 100%;
    height: 60px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    resize: none;
    margin-bottom: 10px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.ai-chat-input textarea:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 2px 10px rgba(78, 205, 196, 0.1);
}

.ai-chat-send {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.ai-chat-send:hover {
    background: linear-gradient(135deg, #FF8E53, #FF6B6B);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.ai-chat-send:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* 自定义滚动条样式 */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #95a5a6;
    border-radius: 3px;
}

/* 加载动画 */
.ai-chat-message.loading {
    display: flex;
    align-items: center;
}

.ai-chat-message.loading:after {
    content: '...';
    animation: loading 1s infinite;
}

@keyframes loading {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* 响应式布局 */
@media (max-width: 768px) {
    .ai-chat-container {
        width: 300px;
        height: 450px;
        bottom: 15px;
        right: 15px;
        transform-origin: bottom right;
    }

    .ai-chat-input textarea {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .ai-chat-container {
        width: calc(100% - 30px);
        height: 400px;
        bottom: 10px;
        right: 15px;
        left: 15px;
        transform-origin: bottom right;
    }

    .ai-chat-header {
        padding: 12px;
    }

    .ai-chat-header h3 {
        font-size: 14px;
    }

    .ai-chat-message {
        padding: 8px 12px;
        font-size: 14px;
    }

    .ai-chat-input {
        padding: 10px;
    }

    .ai-chat-input textarea {
        font-size: 14px;
        padding: 8px;
    }

    .ai-chat-send {
        padding: 8px;
        font-size: 14px;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .ai-chat-container {
        width: 320px;
        height: 480px;
    }
}

/* 确保收起状态在所有设备上保持一致 */
@media (max-width: 1024px) {
    .ai-chat-container.minimized {
        width: 64px;
        height: 64px;
        right: 15px;
        bottom: 15px;
        left: auto;
    }
} 