/* AI客服助手样式 */
.ai-assistant-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', Meiryo, メイリオ, Osaka, 'MS PGothic', arial, helvetica, sans-serif;
}

/* 悬浮触发按钮 */
.ai-assistant-btn {
    width: 60px;
    height: 60px;
    background: #2b8aef;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.ai-assistant-btn:hover {
    background: #1f6fd1;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.ai-assistant-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* 聊天窗口 */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.chat-window.active {
    display: flex;
}

/* 标题栏 */
.chat-header {
    background: linear-gradient(135deg, #555555, #333333);
    color: white;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-logo {
    height: 32px;
    width: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.language-selector option {
    background: #333;
    color: white;
}

.chat-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0 auto;
    text-align: center;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 消息列表区域 */
.message-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 消息样式 */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease;
}

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

.message.user {
    background: #007bff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.message.ai {
    background: white;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 输入区域 */
.chat-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.send-btn {
    width: 40px;
    height: 40px;
    background: #007bff;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.send-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-bottom: 16px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 快捷问题按钮 */
.quick-questions {
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.quick-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.quick-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.quick-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.quick-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-assistant-container {
        bottom: 20px;
        right: 20px;
    }
    
    .chat-window {
        width: 320px;
        height: 450px;
        bottom: 70px;
    }
    
    .ai-assistant-btn {
        width: 55px;
        height: 55px;
    }
    
    .ai-assistant-btn svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        height: 400px;
        right: -10px;
    }
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 85%;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}
