/* 右侧聊天面板容器 */
.chat-panel {
    flex: 0 0 30%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100vh;
    border-left: 1px solid #333;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    display: flex !important;
}

/* 聊天头部区域 */
.chat-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a1a1a;
    flex-shrink: 0;
}

/* 聊天内容区域 */
.chat-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    color: #ccc;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 消息通用样式 */
.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    animation: messageIn 0.3s ease-out;
}

/* 其他用户消息（靠左） */
.other-user-message {
    align-self: flex-start;
}

/* 我的消息（靠右） */
.my-message {
    align-self: flex-end;
}

/* 用户信息行（头像+用户名） */
.message-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

/* 我的消息用户信息行（右对齐） */
.my-message .message-user-info {
    flex-direction: row-reverse;
}

/* 消息头像 */
.message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* 消息用户名 */
.message-username {
    font-size: 0.75rem;
    color: #999;
}

/* 消息文本气泡 */
.message-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    line-height: 1.4;
    word-break: break-word;
}

/* 其他用户消息气泡 */
.other-user-message .message-bubble {
    background-color: #2a2a2a;
    color: #fff;
    border-top-left-radius: 0.25rem;
}

/* 我的消息气泡 */
.my-message .message-bubble {
    background-color: #0d6efd;
    color: #fff;
    border-top-right-radius: 0.25rem;
}

/* 消息时间戳 */
.message-time {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 0.25rem;
    align-self: flex-end;
}

/* 聊天输入区域 */
.chat-input {
    padding: 0.75rem 1rem;
    border-top: 1px solid #333;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.chat-input img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.chat-input input {
    flex-grow: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    outline: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

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

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

.chat-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-content::-webkit-scrollbar-thumb {
    background-color: #495057;
    border-radius: 3px;
}
.chat-content::-webkit-scrollbar-thumb:hover {
    background-color: #6c757d;
}
/* 消息进入动画 */
@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}




/* 加载动画样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    height: 100px;
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: #4a90e2;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.loading-text {
    color: #666;
    font-size: 14px;
    text-align: center;
}




/* 新增：发送按钮样式 */
#chatMessageSend.btn-success {
    font-family: 'Roboto', sans-serif; /* 与 streamerName 一致 */
    font-size: 0.9rem; /* 紧凑字体，与 chat-area 协调 */
    font-weight: 500; /* 中等粗体 */
    background-color: #28a745; /* Bootstrap btn-success 绿色 */
    border-color: #28a745;
    padding: 0.5rem 1rem; /* 适中内边距 */
    border-radius: 4px; /* 圆角，与 viewerCount 一致 */
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 默认轻微阴影 */
}

#chatMessageSend.btn-success:hover {
    background-color: #218838; /* 深绿色 */
    border-color: #1e7e34;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3); /* 悬停时阴影稍强 */
}

#chatMessageSend.btn-success:active {
    background-color: #1e7e34; /* 更深的绿色 */
    border-color: #1c7430;
    box-shadow: none !important; /* 点击时移除阴影 */
    transform: scale(0.98); /* 轻微缩小，提供按压反馈 */
}

#chatMessageSend.btn-success:focus {
    box-shadow: none !important; /* 移除焦点阴影 */
}

/* 输入框样式（与按钮协调） */
#chatMessageInput.form-control {
    font-family: 'Roboto', sans-serif; /* 统一字体 */
    font-size: 0.9rem;
    background-color: #1a1a1a; /* 深色背景，与 chat-area 一致 */
    color: #ffffff; /* 白色文字 */
    border: 1px solid #495057; /* 灰色边框 */
    border-radius: 4px;
}

#chatMessageInput.form-control::placeholder {
    color: #adb5bd; /* 浅灰色占位符 */
}

#chatMessageInput.form-control:focus {
    background-color: #262626; /* 焦点时背景略亮 */
    border-color: #0d6efd; /* Bootstrap 蓝色边框 */
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); /* 焦点光晕 */
}

/* 输入组整体样式 */
.input-group {
    background-color: #000000; /* 与 chat-area 一致 */
    padding: 0.5rem; /* 紧凑内边距 */
    border-radius: 6px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    #chatMessageSend.btn-success {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    #chatMessageInput.form-control {
        font-size: 0.8rem;
    }
}




