/* 修复：确保顶部导航在最上层 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030; /* 必须高于 .footer 的 z-index（1000） */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 聊天容器 */
#chat-container {
    height: 60vh;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scroll-behavior: smooth;
}

       /* 增加外框 */
        .zjwk {
            margin: 10px; /* 每列之间的间隙 */
            background-color: white; /* 背景颜色，可根据需要调整 */
            padding: 15px; /* 内边距 */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); /* 阴影效果 */
            border-radius: 8px; /* 圆角 */
            text-align: left; /* 文字居中 */
            margin-left: 10px; /* 增加左外边距 */
            margin-top: 10px;  /* 增加上边距离 */
            margin-right: 10px;  /* 增加右边距离 */
            height: auto;  /* height: 73vh;  高度占比73% */
        }

        hr {  
           border: none; /* 移除默认的边框 */
           border-top: 3px solid #0d6efd; /* 设置顶部边框的颜色和粗细 */
           height: 5px; /* 设置高度 */
           background-color: #0d6efd; /* 设置颜色 */
           margin: 20px 0; /* 设置上下边距 */
        }
        
        h5 {  
            color: #0d6efd;  
            text-align: center;  
        }

/* 消息项通用样式 */
.message-item {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    word-wrap: break-word;
}

/* 用户名样式 */
.message-item .username {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

/* 消息内容气泡通用样式 */
.message-item .message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
    max-width: 100%;
}

/* 左对齐：别人的消息（靠左）*/
.message-item.user-left {
    align-self: flex-start;
}

/* 右对齐：自己的消息（靠右）*/
.message-item.user-right {
    align-self: flex-end;
}

/* 自己的消息：用户名、内容、时间都右对齐 */
.message-item.user-right .username,
.message-item.user-right .message-content,
.message-item.user-right .timestamp {
    text-align: right;
}

/* 自己的消息气泡颜色（浅蓝）*/
.message-item.user-right .message-content {
    background-color: #c4e3ff;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 18px;
}

/* 别人消息的气泡：靠左，底部右侧圆角切断 */
.message-item.user-left .message-content {
    background-color: #e9ecef;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 18px;
}

/* ========== 七彩色系：21 种用户颜色（别人的消息）========== */

/* 红系 */
.message-item.user-red1 .message-content { background-color: #f8d7da; }
.message-item.user-red2 .message-content { background-color: #f1aeb5; }
.message-item.user-red3 .message-content { background-color: #e68a99; }

/* 橙系 */
.message-item.user-orange1 .message-content { background-color: #ffe0b2; }
.message-item.user-orange2 .message-content { background-color: #ffcc80; }
.message-item.user-orange3 .message-content { background-color: #ffb74d; }

/* 黄系 */
.message-item.user-yellow1 .message-content { background-color: #fff9c4; }
.message-item.user-yellow2 .message-content { background-color: #fff59d; }
.message-item.user-yellow3 .message-content { background-color: #ffed6f; }

/* 绿系 */
.message-item.user-green1 .message-content { background-color: #dcedc8; }
.message-item.user-green2 .message-content { background-color: #c5e1a5; }
.message-item.user-green3 .message-content { background-color: #aed581; }

/* 青系 */
.message-item.user-cyan1 .message-content { background-color: #b2dfdb; }
.message-item.user-cyan2 .message-content { background-color: #80cbc4; }
.message-item.user-cyan3 .message-content { background-color: #4db6ac; }

/* 蓝系 */
.message-item.user-blue1 .message-content { background-color: #bbdefb; }
.message-item.user-blue2 .message-content { background-color: #90caf9; }
.message-item.user-blue3 .message-content { background-color: #64b5f6; }

/* 紫系 */
.message-item.user-purple1 .message-content { background-color: #e1bee7; }
.message-item.user-purple2 .message-content { background-color: #ba68c8; color: #fff; }
.message-item.user-purple3 .message-content { background-color: #9c27b0; color: #fff; }

/* 时间戳 */
.message-item .timestamp {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 0.25rem;
}

/* 输入框和发送按钮容器 */
#message-form {
    margin-bottom: 1rem;
}

/* 清空按钮样式 */
#clear-form .btn {
    font-size: 0.875rem;
}

/* 清空状态提示 */
#clear-status .alert-sm {
    font-size: 0.875rem;
    padding: 0.5rem;
    margin-bottom: 0;
}

/* 底部信息开始 */
.footer {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); /* 阴影效果 */
    position: fixed; /* 固定在屏幕底部 */
    background-color: #0d6efd;
    color: white;    
    padding: 15px 0 1px;  /* 仅保留上下内边距 */
    text-align: center;
    bottom: 0;
    width: 100%;
    /* 添加一些外边距，以防止内容被footer覆盖 */
    margin-top: 15px; /* 根据需要调整 */
    font-size: 12px; /* 控制字体大小，可以根据需要调整 */
    z-index: 1000; /* 确保高于其他内容 */
}

/* 底部导航链接样式 */
.footer-links {  
    padding-left: 0; /* 新增：覆盖浏览器的默认样式 */
    display: flex; /* 使用 Flexbox 布局 */  
    justify-content: space-around; /* 平均分配空间 */  
    list-style-type: none; /* 移除默认项目符号 */  
    padding: 0; /* 移除默认内边距 */  
}

/* 底部导航项样式 */  
.footer-item {  
    position: relative; /* 相对定位 */  
    margin-left: -5px; /* 增加右边距离 */
}

/* 底部链接 */  
.footer-item a {  
    color: #fff; /* 链接颜色 */  
    text-decoration: none; /* 移除下划线 */
    transition: color 0.3s ease; /* 添加过渡效果 */
    display: block; /* 占据块级元素的空间 */  
    text-align: center; /* 文本居中 */  
}

/* 鼠标悬停时的链接样式 */
.footer-item a:hover {  
    color: #EA4335; /* 悬停时的颜色 */
}

/* 底部emoji样式 */  
.footer-icon {  
    font-size: 16px; /* emoji大小 */
    color: #EA4335; /* emoji颜色 */
    display: block; /* 占据块级元素的空间 */
    text-align: center; /* 文本居中 */  
    margin-bottom: 1px; /* 与链接之间的间距 */
}
/* 底部信息结束 */