* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

/* 主内容区域 */
.main-content {
    display: flex;
    position: relative;
    min-height: calc(100vh - 80px); /* 减去header高度 */
}

/* Prompt系统样式 */
.prompt-system {
    background: white;
    height: calc(100vh - 80px); /* 固定高度 */
    overflow-y: auto; /* 启用滚动 */
    position: sticky;
    top: 80px; /* 跟随页面滚动但保持可见 */
    width: 432px;
    border-right: 1px solid #eee;
    padding-right:5px;
}


/* WebKit 浏览器专属样式 */
.prompt-system::-webkit-scrollbar {
    width: 6px;
}
.prompt-system::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.prompt-system::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}


.section-title1 {
    font-weight:900;
    display: grid;
    place-items: center;
    background-color: #5892ff;
    font-size: 30px;
    color: #fff;
}
.section-title2 {
    font-weight: 800;
    display: grid;
    place-items: center;
    background-color: #d0e3fe;
    font-size: 25px;
    color: #3d51fe;
}

.section-title3 {
    display: grid;
    place-items: center;
    background-color: #e4e3e3;
    color: black;
    font-size: 20px;
    padding-left: 11px;
    justify-content: flex-start;
}
.section-title4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    color: rgb(70, 70, 70);
    font-size: 30px;
    padding: 11px;
    border-bottom: 1px solid #ddd;
}

/* 关键词分类容器 */
.keywords-container {
    height: 20vh;       /* 固定高度 */
    overflow: hidden;   /* 隐藏溢出 */
    margin-top: 3px;
    margin-bottom: 3px;
}

/* 网格容器（实际滚动区域） */
.keywords-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 强制等分列宽 */
    gap: 0.5rem 0.4rem; /* 统一行列间距 */
    overflow-y: auto;   /* 滚动条在此层级 */
    height: 100%;
    max-height: 20vh;
    padding-right: 15px;/* 避免滚动条覆盖内容 */
    padding-left: 10px;  
}

/* 滚动条美化 */
.keywords-grid::-webkit-scrollbar {
    width: 6px;
}
.keywords-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.keywords-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.keyword {
    background: white;
    border: 1px solid black;
    border-radius: 4px;
    text-align: center;
    cursor: pointer; /* 鼠标悬停时显示指针 */
    user-select: none;
    width: 100%;    /* 宽度填满网格列 */
    padding: 6px 6px; 
    color: gray;
    margin-left: 2px;
    transition: background-color 0.3s;
}
/* 选中状态的样式 */
.keyword.selected {
    border: 2px solid #3d51fe; 
    color: #3d51fe; 

}
.keyword:hover {
    background-color: #d5d5d5; /* 鼠标悬停时改变背景色 */
}

/* 右侧聊天界面 */
.chat-interface {
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 10px rgba(0,0,0,0.1);
    position: static;
    flex: 1;
    margin: 20px 30px;
    left: calc(432px + 30px);
    width: calc(100% - 432px - 60px);
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    top: 100px;
    padding: 20px;
}

/* 消息容器 */
.message-container {
    flex: 1;
    background: #F7FAFD;   
    padding: 20px;
    overflow-y: auto;
}

/* 名称标签 */
.name-tag {
    color: #A8A8A8;
    font-size: 15px;
    font-weight: 600;
    margin-left: 8px;
}

/* 用户消息容器 */
.user-message-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 70%;
    margin: 12px 0 12px auto; /* 关键修改：上右下左 */
}

/* 用户名称标签 */
.user-name-tag {
    color: #A8A8A8;
    font-size: 15px;
    font-weight: 600;
    margin-right: 8px;
    text-align: right;
}

/* 机器人消息容器 */
.bot-message-container {
    max-width: 70%;
    margin: 12px 0;
}

/* 消息气泡字体颜色 */
.bubble-content {
    color: #000; 
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    width: 100%; 
}

/* 自定义滚动条 */
.message-container::-webkit-scrollbar {
    width: 6px;
}
.message-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}
.message-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

/* 输入区域 */
.chat-input {
    background: white;
    padding: 1rem 0 0 0;
    display: flex;
    gap: 12px;
    border-top: 1px solid #eee;
}

.chat-input input::placeholder {
    color: #D9D9D9;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.chat-input input:focus {
    outline: none;
    border-color: #2759CD;
}

/* 附件按钮 */
.attach-btn {
    width: 48px;
    height: 48px;
    background: url(assets/images/图片.svg) no-repeat center;
    background-size: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.attach-btn:hover {
    background-color: #f5f5f5;
}

/* 发送按钮 */
.send-btn {
    background: #2759CD;
    color: white;
    padding: 7px 41px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
    font-size: 16px;
}

.send-btn:hover {
    opacity: 0.9;
}

/* 页脚样式 */
.footer {
    background: white;
    padding: 1rem;
    position: relative; /* 添加相对定位作为计算基准 */
    z-index: 1; /* 确保页脚在上层 */
    margin-top: auto; /* 确保页脚在底部 */
}
/* 响应式设计调整 */
@media (max-width: 1440px) {
    .chat-interface {
        /* 保持比例微调 */
        left: calc(432px + 30px);
        width: calc(100% - 432px - 60px);
    }
}

@media (max-width: 1280px) {
    .chat-interface {
        left: calc(432px + 20px);
        width: calc(100% - 432px - 40px);
    }
}

/* 调整响应式布局 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .prompt-system {
        width: 100%;
        max-height: 50vh; /* 限制最大高度 */
        position: static;
        height: auto;
    }
    
    .chat-interface {
        width: calc(100% - 40px) !important;
        height: 65vh;
        margin: 20px;
    }
}

@media (max-width: 768px) {
     /* 导航栏优化 */
     .header.navbar-area {
        height: 60px;
    }
    .header .navbar-brand img {
        width: 32px !important;
        height: 32px !important;
    }
    .header .ms-2 {
        font-size: 20px !important;
    }
     /* 隐藏设置按钮 */
     .btn.p-1[href="#"] {
        display: none;
    }

    /* 登录按钮优化 */
    .btn.d-flex.align-items-center.gap-2 {
        padding: 2px 10px 2px 5px !important;
        font-size: 16px !important;
        margin-top: 4px !important;
    }

    /* 登录图标调整 */
    .btn.d-flex.align-items-center.gap-2 img {
        width: 24px !important;
        height: 28px !important;
    }
    .chat-interface {
        /* 移动端全宽显示 */
        width: calc(100% - 20px);
        padding: 15px;
        height: 80vh;
        border-radius: 8px;
    }

    /* 调整消息容器 */
    .bot-message-container,
    .user-message-container {
        max-width: 90%;
    }
}