/* 修复：确保顶部导航在最上层 */
.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;
}

/* 底部信息开始 */
/* ==================== 蓝色系底部导航 ==================== */
:root {
    --footer-primary: #0d6efd;
    --footer-secondary: #0b5ed7;
    --footer-accent: #0a58ca;
    --footer-gradient-start: rgba(13, 110, 253, 0.95);
    --footer-gradient-middle: rgba(11, 94, 215, 0.97);
    --footer-gradient-end: rgba(10, 88, 202, 0.95);
    --footer-glow: rgba(13, 110, 253, 0.3);
    --footer-text: #ffffff;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, 
        var(--footer-gradient-start) 0%,
        var(--footer-gradient-middle) 50%,
        var(--footer-gradient-end) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 12px 10px 8px;
    z-index: 1000;
    box-shadow: 
        0 -10px 30px rgba(13, 110, 253, 0.25),
        0 -5px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 0 15px rgba(134, 183, 254, 0.2);
    animation: slideUp 0.5s ease-out;
}

/* 蓝色光晕效果 */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, 
            rgba(13, 110, 253, 0.25) 0%,
            transparent 60%),
        radial-gradient(circle at 80% 20%, 
            rgba(11, 94, 215, 0.25) 0%,
            transparent 60%);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    animation: blueGlow 3s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes blueGlow {
    0% {
        opacity: 0.3;
        filter: blur(4px);
    }
    100% {
        opacity: 0.6;
        filter: blur(10px);
    }
}

/* 底部导航链接容器 */
.footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style-type: none;
    padding: 0 5px;
    margin: 0;
    position: relative;
    gap: 2px;
}

/* 底部导航项 */
.footer-item {
    flex: 1;
    text-align: center;
    position: relative;
    margin: 0 2px;
    transition: all 0.3s ease;
}

/* 底部链接样式 */
.footer-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--footer-text);
    padding: 8px 4px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    min-height: 60px;
    max-width: 80px;
    margin: 0 auto;
    width: 100%;
}

/* 图标样式 */
.footer-icon {
    font-size: 22px;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    text-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 255, 255, 0.3);
    z-index: 2;
    position: relative;
    color: var(--footer-text);
    line-height: 1;
}

/* 文字样式 */
.footer-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--footer-text);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.2),
        0 0 6px rgba(255, 255, 255, 0.15);
    z-index: 2;
    position: relative;
    line-height: 1.2;
    margin-top: 2px;
}

/* 悬停效果 - 蓝色主题 */
.footer-item a:hover {
    transform: translateY(-6px) scale(1.06);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 10px 25px rgba(13, 110, 253, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(13, 110, 253, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--footer-text);
}

/* 悬停时图标效果 */
.footer-item a:hover .footer-icon {
    transform: scale(1.15) rotate(3deg);
    filter: drop-shadow(0 4px 6px rgba(13, 110, 253, 0.4));
    text-shadow: 
        0 0 12px rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(13, 110, 253, 0.4);
}

/* 悬停时文字效果 */
.footer-item a:hover .footer-text {
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(13, 110, 253, 0.3);
    letter-spacing: 1px;
}

/* 激活/当前页面状态 */
.footer-item.active a {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 
        0 5px 15px rgba(13, 110, 253, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.footer-item.active .footer-icon {
    transform: scale(1.08);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* 响应式设计 - 大屏 */
@media (min-width: 1200px) {
    .footer-item a {
        max-width: 90px;
        min-height: 64px;
    }
    
    .footer-icon {
        font-size: 24px;
    }
    
    .footer-text {
        font-size: 12px;
    }
}

/* 响应式设计 - 平板 */
@media (max-width: 991px) {
    .footer {
        border-top-left-radius: 22px;
        border-top-right-radius: 22px;
        padding: 10px 8px 6px;
        backdrop-filter: blur(12px);
    }
    
    .footer-item a {
        min-height: 56px;
        max-width: 70px;
    }
    
    .footer-icon {
        font-size: 20px;
    }
    
    .footer-text {
        font-size: 10px;
        letter-spacing: 0.3px;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 576px) {
    .footer {
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        padding: 8px 5px 4px;
        backdrop-filter: blur(10px);
    }
    
    .footer-item a {
        min-height: 52px;
        max-width: 58px;
        padding: 6px 2px;
        border-radius: 14px;
    }
    
    .footer-icon {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .footer-text {
        font-size: 9px;
        letter-spacing: 0.2px;
        white-space: normal;
        line-height: 1.1;
    }
    
    .footer-item a:hover {
        transform: translateY(-4px) scale(1.04);
    }
}

/* 超小屏设备 */
@media (max-width: 375px) {
    .footer-item a {
        min-height: 48px;
        max-width: 52px;
    }
    
    .footer-icon {
        font-size: 16px;
    }
    
    .footer-text {
        font-size: 8px;
    }
}

/* 兼容 iOS 安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

@supports (padding-bottom: constant(safe-area-inset-bottom)) {
    .footer {
        padding-bottom: calc(8px + constant(safe-area-inset-bottom));
    }
}

/* 优化触摸区域 */
@media (hover: none) and (pointer: coarse) {
    .footer-item a {
        min-height: 58px;
        padding: 10px 4px;
    }
    
    .footer-item a:active {
        transform: translateY(-3px) scale(1.02);
        background: rgba(255, 255, 255, 0.18);
    }
}
/* 底部信息结束 */
/* 底部信息结束 */