
.simple-chat-room {
    border-radius: 8px;
    background: #f5f5f5;
    width: 750px;
    height: 600px;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

.chat-header {
    background: #f5f5f5;
    color: #078786;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px; /* 调大2px */
}

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

.online-count {
    font-size: 16px; /* 调大2px */
}

.chat-messages {
    flex: 1;
    padding: 8px 10px;
    overflow-y: auto;
    background: #e5e5e5;
    font-size: 16px; /* 调大2px */
    display: flex;
    flex-direction: column-reverse; /* 默认最新在前 */
}

/* 消息容器 - 三框架布局 */
.message {
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    gap: 6px;
    max-width: 100%;
    align-items: flex-start;
    min-height: auto;
}

.message.own {
    background: #f5f5f5;
    margin-right: 10px;
    color: #078786;
}
.message.own .message-content {
    color: #078786;
}

.message.other {
    background: #f5f5f5;
    margin-right: 10px;
    color: #999;
}
.message.admin {
    background: #f5f5f5;
    margin-right: 10px;
    color: #fc6668;
}

.message.admin .message-content {
    color: #fc6668;
}


/* 第一框架：头像 */
.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    align-self: flex-start;
}

/* 第二框架：用户信息和时间 */
.message-user-info {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 120px;
    min-width: 120px;
    justify-content: flex-start; /* 改为顶部对齐 */
    height: auto; /* 改为自动高度 */
    align-self: flex-start; /* 确保顶部对齐 */
}

.message-user-line {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex-wrap: nowrap;
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
    margin-bottom: 2px; /* 添加与时间的间距 */
}

.message-user-name {
    font-weight: 500;
    font-size: 13px; /* 调大2px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75px; /* 稍微增加宽度 */
    flex-shrink: 0;
    align-items: flex-end;
    color: #666;
}


/* 管理员标识样式 */
.admin-badge {
    color: #fc6668;
    font-size: 11px; /* 调大2px */
    line-height: 1;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.moderator-badge {
    background: #078786;
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    font-size: 11px; /* 调大2px */
    line-height: 1;
    flex-shrink: 0;
}

/* 用户等级样式 */
.user-rank {
    font-size: 11px; /* 调大2px */
    line-height: 1;
    flex-shrink: 0;
    align-items: flex-end;
}

.message.own .user-rank {
    font-size: 11px; /* 调大2px */
    line-height: 1;
    flex-shrink: 0;
    align-items: flex-end;
}

/* 确保Bootstrap图标正确显示 */
.bi {
    display: inline-block;
    font-size: 11px; /* 调大2px */
    align-items: flex-end;
}

/* 等级特定的颜色 */
.rank {
    display: inline-block;
    font-size: 11px; /* 调大2px */
    align-items: flex-end;

}

.rank2 {
    font-size: 11px; /* 调大2px */
    color: #666;
}

.message.own .rank2 {
    font-size: 11px; /* 调大2px */
    color: #666;
}

/* 时间样式 */
.message-time {
    font-size: 11px; /* 调大2px */
    color: #999;
    line-height: 1;
    white-space: nowrap;
}
.message.admin .message-time {
    color: #999;
}
/* 第三框架：消息内容 */
.message-content {
    word-wrap: break-word;
    line-height: 1.4; /* 增加行高提高可读性 */
    font-size: 15px;
    flex: 1;
    min-width: 0;
    padding-left: 6px;
    color: #666;
    align-self: flex-start;
    margin-top: 0; /* 移除顶部边距 */
    white-space: pre-wrap; /* 保留换行符 */
    word-break: break-word; /* 长单词换行 */
}

.message.own .message-content {
    word-wrap: break-word;
    line-height: 1.4; /* 增加行高提高可读性 */
    font-size: 15px;
    flex: 1;
    min-width: 0;
    padding-left: 6px;
    color: #078786;
    align-self: flex-start;
    margin-top: 0; /* 移除顶部边距 */
    white-space: pre-wrap; /* 保留换行符 */
    word-break: break-word; /* 长单词换行 */
}

.chat-input {
    padding: 10px 15px 0 10px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#chat-message-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px; /* 调大2px */
}


.simple-chat-login-required {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #999;
    width: 740px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px; /* 调大2px */
}

.loading-messages {
    text-align: center;
    color: #666;
    padding: 15px;
    font-size: 15px; /* 调大2px */
}

/* 登录提示样式 */
.chat-login-prompt {
    padding: 15px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    border-radius: 0 0 8px 8px;
    text-align: center;
    color: #999;
}

.chat-login-prompt a {
    color: #078786;
    text-decoration: none;
    font-weight: bold;
    text-decoration: none;
}

.chat-login-prompt a:hover {
    text-decoration: underline;
}

/* <开始修改> - 添加手机端响应式样式 */
@media (max-width: 768px) {
    /* 修复聊天室容器宽度 */
    .simple-chat-room {
        width: 100% !important;
        height: 500px;
        margin: 0 auto;
    }
    
    /* 修复侧边栏悬浮问题 */
    #right-sidebar {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px;
        padding-left: 0;
        z-index: 1;
    }
    
    /* 调整主内容区布局 */
    #middle-container {
        flex-direction: column;
        width: 100%;
    }
    
    #main-content {
        width: 100% !important;
        max-width: 100% !important;
        order: 1;
    }
    
    .main-content2 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px;
    }
    
    /* 调整聊天消息区域 */
    .chat-messages {
        height: 350px;
        font-size: 14px;
    }
    
    /* 修复消息布局 */
    .message {
        flex-direction: column;
        gap: 5px;
        padding: 8px;
    }
    
    .message-user-info {
        width: 100% !important;
        min-width: 100% !important;
        flex-direction: row;
        align-items: center;
        margin-bottom: 5px;
    }
    
    .message-user-line {
        margin-bottom: 0;
    }
    
    .message-content {
        padding-left: 0;
        width: 100%;
    }
    
    /* 修复输入框挤压问题 - 改为垂直布局 */
    .chat-input {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    #chat-message-input {
        width: 100% !important;
        margin-bottom: 5px;
    }
    
    #send-message-btn {
        width: 100% !important;
        height: 35px;
    }
    
    /* 调整登录提示样式 */
    .simple-chat-login-required {
        width: 100% !important;
        height: 400px;
    }
    
    /* 调整聊天头部 */
    .chat-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .chat-header-right {
        justify-content: center;
    }
}

/* 针对更小屏幕的额外调整 */
@media (max-width: 480px) {
    .simple-chat-room {
        height: 450px;
    }
    
    .chat-messages {
        height: 300px;
        font-size: 13px;
    }
    
    .message-avatar {
        width: 24px;
        height: 24px;
    }
    
    .message-user-name {
        font-size: 12px;
        max-width: 60px;
    }
    
    .message-content {
        font-size: 13px;
    }
    
    .chat-header h3 {
        font-size: 16px;
    }
    
    .online-count {
        font-size: 14px;
    }
}
/* <结束修改> */
