/* 算命的小神仙聊天机器人样式 */
.fortune-teller-chatbot-container {
    width: 100%;
    max-width: 600px;
    height: 800px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0 auto;
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    position: relative;
}

.chat-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.chat-title {
    margin-right: 10px;
    flex-grow: 1;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: inline-block;
    animation: pulse 2s infinite;
    margin-right: 10px;
}

.language-selector {
    display: flex;
    align-items: center;
}

.language-selector select {
    padding: 5px;
    border-radius: 4px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
}

.language-selector select option {
    background-color: #8B4513;
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f9f5e7;
}

.message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
    position: relative;
}

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

.user-message {
    align-self: flex-end;
    background-color: #e1e9f5;
    border-bottom-right-radius: 5px;
}

.bot-message {
    align-self: flex-start;
    background-color: #ffffff;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.system-message {
    align-self: center;
    background-color: #f5f5f5;
    color: #666;
    font-style: italic;
    max-width: 90%;
    text-align: center;
}

.timestamp {
    font-size: 0.7em;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.typing-indicator {
    align-self: flex-start;
    background-color: #ffffff;
    border-radius: 18px;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: none;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
}

.typing-indicator .dot {
    height: 6px;
    width: 6px;
    margin-left: 4px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.6;
}

.typing-indicator .dot:nth-of-type(1) {
    animation: typing 1s infinite;
}

.typing-indicator .dot:nth-of-type(2) {
    animation: typing 1s 0.33s infinite;
}

.typing-indicator .dot:nth-of-type(3) {
    animation: typing 1s 0.66s infinite;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eaeaea;
    background-color: white;
    align-items: center;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s;
    font-size: 14px;
}

#userInput:focus {
    border-color: #8B4513;
}

#sendButton {
    background-color: #8B4513;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
    font-weight: bold;
    min-width: 80px;
}

#sendButton:hover {
    background-color: #A0522D;
}

#sendButton:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.button-text {
    margin-right: 5px;
}

.send-icon {
    width: 16px;
    height: 16px;
}

.chat-footer {
    padding: 10px 15px;
    border-top: 1px solid #eaeaea;
    background-color: white;
    text-align: center;
}

.clear-chat-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.8em;
    text-decoration: underline;
}

.clear-chat-btn:hover {
    color: #8B4513;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .fortune-teller-chatbot-container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .chat-header {
        padding: 10px 15px;
        font-size: 16px;
    }

    .language-selector select {
        padding: 3px;
        font-size: 12px;
    }

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

    #sendButton {
        padding: 10px 15px;
        min-width: 70px;
    }
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}