/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

.chat-box {
    background-color: #f7f8fa;
    color: #1d2129;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 20px;
}

/* 主容器样式 */
.chat-container {
    background-color: white;
    width: 1200px;
    max-width: 100%;
    height: 750px;
    border-radius: 12px;
    box-shadow: 1px 3px 15px 3px #E6E8ED;
    display: flex;
    overflow: hidden;
}

/* 左侧边栏样式 */
.sidebar {
    width: 300px;
    background-color: #FBFCFF;
    display: flex;
    flex-direction: column;
}

.new-chat-btn {
    margin: 20px;
    padding: 20px 24px;
    color: #25499D;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    background: url('/wp-content/themes/my-first-theme/assets/imgs/chat-newchat.png') 10% center no-repeat;
    background-color: #EDF2FF;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #0056D2;
    border-radius: 10px;
    padding: 8px 16px;
    margin: 0 10px;
    background: url('/wp-content/themes/my-first-theme/assets/imgs/chatpage-search.png') no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background-color: transparent;
}

.chat-head{
    margin: 20px 20px 10px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.chat-head h1{
    font-size: 18px;
    font-weight: 700;
}
.chat-head .chat-operate-clear{
    font-size: 14px;
    color: #666666;
    margin-right: 10px;
}
.chat-head .chat-operate-manage{
    font-size: 14px;
    color: #666666;
}
/* 对话列表样式 */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    padding: 10px;
    margin: 0 10px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    font-size: 14px;
    color: #666666;
    overflow:hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-item:hover {
    background-color: #EDF2FF;
}

.chat-item.active {
    background-color: #EDF2FF;
}

/* 主聊天区域样式 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 聊天内容区域样式 */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-container {
    text-align: center;
    max-width: 600px;
}

.welcome-title {
    font-size: 26px;
    color: #333;
    margin-bottom: 20px;
}

.welcome-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 40px;
}

.feature-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    margin-bottom: 60px;
}

.feature-btn {
    background-color: #F4F4F4;
    color: #333;
    border: none;
    padding: 14px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 80px;
}

.feature-btn:hover {
    background-color: #EDF2FF;
    border-color: #EDF2FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 输入区域样式 */
.chat-input-container {
    padding:10px 30px;
    background-color: #fff;
    margin-bottom: 20px;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    background-color: #F4F4F4;
    border-radius: 20px;
}

.message-input {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 20px;
    resize: none;
    outline: none;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    background-color: transparent;
}

.send-btn {
    width: 48px;
    height: 48px;
    background-color: transparent;
    color: #666;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.send-btn:hover {
    background-color: #25499D;
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        height: 90vh;
    }

    .sidebar {
        display: none;
    }

    .chat-content {
        padding: 20px;
    }

    .feature-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .feature-btn {
        min-width: 100%;
    }
}
/* 对话样式 */

.chat-info{
    padding: 0 40px;
}
.chat-info .user-msg,
.chat-info .ai-msg {
    display: flex;
    align-items: flex-start;
    margin: 6px 0;
}

.chat-info .user-msg .anwserp,
.chat-info .ai-msg .anwserp {
    padding: 8px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4rem;
    font-size: 12px;

}
.chat-info .user-msg .anwserp p,
.chat-info .ai-msg .anwserp p{
    margin: 0;
}
.chat-info .user-msg .avatar,
.chat-info .ai-msg .avatar {
    display: block;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
}

/* 用户消息：右对齐 + 头像在右边 */
.chat-info .user-msg {
    justify-content: flex-end;
}

.chat-info .user-msg .anwserp {
    background-color: #EBF1FF;
    color: #333333;
    border-top-right-radius: 0;
    margin-right: 6px;
    margin-bottom: 4px;
}
.chat-info .user-msg .avatar{
    background: url('/wp-content/themes/my-first-theme/assets/imgs/chat-userimg.png') no-repeat center 0px;
    background-position: center 0px;
    background-size: cover;
}

/* AI 消息：左对齐 + 头像在左边 */
.chat-info .ai-msg {
    justify-content: flex-start;
}

.chat-info .ai-msg .anwserp {
    background-color: #fff7eb;
    color: #333333;
    border-top-left-radius: 0;
    margin-left: 6px;
}
.chat-info .ai-msg .avatar {
    background: url('/wp-content/themes/my-first-theme/assets/imgs/chat-aiimg.png') no-repeat center 0px;
    background-position: center 0px;
    background-size: cover;
}