html, body {
    display: grid;
    grid-template-columns: minmax(200px, 300px) 1fr minmax(200px, 300px); /* 左GIF区域 | 聊天区域 | 右GIF区域 */
    grid-template-rows: auto 1fr; /* 标题行 | 内容行 */
    gap: 20px;
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    /* background-color: #f0eded; 
    background-color: #66ccff;*/
    align-items: start;
}
body{
    background: linear-gradient(135deg, 
        #ffe6f0 0%, 
        #ffdeeb 20%, 
        #ffd6e7 40%, 
        #ffebf3 60%, 
        #fff5f9 80%, 
        #fffafc 100%);
}
@font-face {
	font-family: "JBmono";
	src: url("../fonts/JetBrainsMono-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;                    /* 避免布局偏移 */
}
@font-face {
	font-family: "LXGW";
	src: url("../fonts/LXGWWenKaiMono-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;                    /* 避免布局偏移 */
}
table {
    width: 400px;
    margin: 0 auto;
    border: 1px solid #000000;
    border-collapse: collapse;
}

th,td {
    border: 1px solid #000000;
    text-align: center;
}
.final-answer pre {
    background-color: #36486A;
    border: 1px solid #ccc;
    padding: 10px;
    overflow: auto;
    border-radius: 20px;
}

.final-answer>code>code {
    font-family: "JBmono", Courier, monospace;
    background-color: #727678;
    border-radius: 20px;
}
.pagetitle {
    grid-column: 1 / -1; /* 标题横跨所有列 */
    text-align: center;
    margin-bottom: 10px;
    color: #ff6b9d;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.2);
}
body > p {
    grid-column: 1 / -1;
    text-align: center;
    margin: 0;
}
/* 左侧GIF容器 */
/* .left-gifs {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}.right-gifs {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
} */

/* 每个GIF项目的样式 */
.gif-item {
    width: 100px; /* 调整GIF宽度 */
    background: transparent;
    border-radius: 10px;
    padding: 15px;
}
.gif-container img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

/* .chat-container {
    width: 1000px;
    max-width: 95%;
    height: calc(100vh - 174px);
    margin: 30px auto;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    grid-column: 2;
    grid-row: 3;
    justify-self: center;
} */
.left-gifs, .right-gifs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    /* 确保GIF区域与聊天框对齐 */
    grid-row: 3;
    align-self: start; /* 从顶部开始 */
}

/* 聊天容器 - 关键修改 */
.chat-container {
    width: 1000px;
    max-width: 95%;
    height: calc(100vh - 150px);
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* 网格定位 */
    grid-column: 2;
    grid-row: 3;
    justify-self: center;
    /* 垂直居中 */
    align-self: flex-start;;
    margin: 0; /* 移除原来的margin */
}
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    background: #f9f9f9;
}

/* .input-container {
    display: flex;
    border-top: 2px solid #c6c6c6;
    background: #fff;
} */

/* #user-input {
    flex: 1;
    padding: 12px;
    border: none;
    font-size: 16px;
    outline: none;
    word-wrap: break-word;
} */

/* #send-button {
    padding: 12px 20px;
    border: none;
    background-color: #0da7ee;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#send-button:hover {
    background-color: #005a9e;
} */


.message-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}



.bubble {
    position: relative;
    margin-bottom: 15px;
    padding: 10px 15px;
    padding-bottom: 30px;
    max-width: 70%;
    border-radius: 10px;
    word-wrap: break-word;
    line-height: 1.4;
    z-index: 1;
}

.message-container.user {
    flex-direction: row;
    /* align-self: flex-end; */
    align-items: flex-start; /* Changed from flex-end to flex-start */
    justify-content: flex-end; /* Added justify-content */
    margin-right: 0;
}
.user .bubble{
    background-color: #5eb8d3;
}
.message-container.bot {
    flex-direction: row;
    align-self: flex-start;
}
.bot .bubble{
    background-color: #c6c6c6;
    color: black;
}
.message-container .avatar {
    background-color: #fff;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    display: flex;
    box-shadow: 0 0 0 1px #d5e4ff;
}

.message-container.user .bubble {
    order: 1; /* 气泡显示在前面 */
}
.message-container.user .avatar{
    order: 2; /* 头像显示在后面 */
    margin-left: 10px;
}
.message-container .avatar svg{
    width: 35px;
    height: 35px;
}

.bubble strong {
    display: block;
    margin-bottom: 5px;
    color: black;
}
.deepthink{
    background-color: rgba(0, 0, 0, 0.3);
	font-size: 18px;
    color: black;
    border-radius: 9px;
}
.bubble .thinking {
    
    /* background-color: rgba(0, 0, 0, 0.3); */
    margin-bottom: 5px;
    position: relative;
    padding-left: 10px;
}
.bubble .thinking pre{
    max-width: 100%;
    font-size: 16px;
    font-family: "LXGW";
    color: #363636;
    white-space: pre-wrap;
    overflow-x: auto; /* 小屏幕备用滚动条 */
    /* word-wrap: break-word; */
}
.thinking::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;         /* 灰色条宽度 */
    background-color: rgb(100, 100, 100);
    /* margin-right: 6px; */
    border-radius: 2px; /* 可选：圆角效果 */
}

/* 最终回答样式，可保持原有风格 */
.bubble .final-answer {
    font-size: 20px;
    color: black;
}

.copy-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    bottom: -20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

/* 用户消息复制图标放在右下角 */
.message-container.user .copy-icon {
    right: 62px;
}

/* 机器人消息复制图标放在左下角 */
.message-container.bot .copy-icon {
    left: 62px;
}

/* 鼠标悬停时增强透明度 */
.copy-icon:hover {
    opacity: 1;
}

/* 使用伪元素显示 tooltip 提示：默认不显示，悬停时显示 */
.copy-icon::after {
    content: "复制";
    position: absolute;
    bottom: 100%; /* 在图标上方 */
    left: 50%;
    transform: translate(-50%, -5px);
    background: black;
    color: white;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

/* 悬停时显示 tooltip */
.copy-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
    z-index: 6;
}


.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(255, 249, 251, 0.7);
}

/* 输入区域美化 */
.input-container {
    display: flex;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(255, 107, 157, 0.1);
    gap: 12px;
}

#user-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid rgba(255, 107, 157, 0.2);
    border-radius: 25px;
    font-size: 14px;
    resize: none;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

#user-input:focus {
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
    background: white;
}

#send-button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fab 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

#send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

#send-button:active {
    transform: translateY(0);
}