#chat-box {
    height: 70vh;
    overflow-y: auto;
    padding: 1rem;
    background-color: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.message-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

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

.ai {
    flex-direction: row;
}

.user {
    flex-direction: row-reverse;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 20px;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ai .message-bubble {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

.user .message-bubble {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
}

/* 警告黄色样式 (count === 1) */
.ai .message-bubble.warning-yellow {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 警告红色样式 (count === 2) */
.ai .message-bubble.warning-red {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.avatar {
    width: 40px;
    height: 40px;
    margin: 0 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai .avatar {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.user .avatar {
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: white;
}

#chat-form {
    background: white;
    border-radius: 25px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#chat-form input {
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 16px;
}

#chat-form input:focus {
    outline: none;
    box-shadow: none;
}

#chat-form button {
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    border: none;
    transition: all 0.3s ease;
}

#send-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

#send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

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

.end-btn {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.end-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.thinking-animation {
    display: inline-block;
}

.thinking-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.thinking-dots::after {
    content: '';
    animation: thinking 1.5s infinite;
    white-space: nowrap;
}

@keyframes thinking {
    0% {
        content: '';
    }
    25% {
        content: '思';
    }
    50% {
        content: '思考';
    }
    75% {
        content: '思考中';
    }
    100% {
        content: '';
    }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

#chat-form button {
    border-radius: 15px;
    padding: 0.75rem 1.5rem;
    border: none;
    transition: all 0.3s ease;
}