html, body {      /* 基础容器设置 */
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* 父容器 - 自适应视窗 */
.container {
    width: 60vw; /* 默认桌面宽度 */
    height: 85vh;
    min-width: 320px; /* 设置最小宽度防止移动端溢出 */
    max-width: 1200px; /* 设置最大宽度保持大屏显示效果 */
    display: flex;
    flex-direction: column;
    background: #f0f0f0;
}
/* 子元素通用样式 */
.header, .chat-container, .footer {
    width: 100%;
    padding: 0.3rem 0;
    box-sizing: border-box;
}
/* 高度占比分配 */
.header {
    flex: 0 0 5%; /* 5%高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #007bff, #00bfff);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
    padding:10px 0;
}
.chat-container {
    flex: 1 1 80%; /* 80%高度 */
    overflow: hidden; /* 隐藏滚动条溢出 */
}
.footer {
    padding: 15px;
    background: #eee;
    border-top: 1px solid #eee;
    border-radius: 0 0 12px 12px;
    display: flex; /* 改为flex布局 */
    flex-direction: column;
    gap: 10px;
}
#inputMessage {
    padding: 10px 12px;
    border: 2px solid #e0e3e6;
    border-radius: 8px;
    resize: none;
    font-size: 15px;
    transition: all 0.3s;
    min-height: 60px;    /* 保证移动端输入体验 */
}
#inputMessage:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0,123,255,0.1);
    outline: none;
}
/* 聊天框样式 */
.chat-box {
    height: 100%;
    background: white;
    border-radius: 8px;
    padding: 0 1rem;
    overflow-y: auto; /* 启用垂直滚动 */
}
/* 消息通用样式 */
.message {
    display: flex;
    gap: 0.8rem;
    margin: 0.8rem 0;
}
/* 用户头像 */
.avatar {
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
/* 消息内容区域 */
.message-content {
    max-width: 85%;
    padding: 12px 12px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); /* 添加柔和阴影 */
    font-size: 16px;
    line-height: 1.5;
}
/* 接收消息样式 */
.bot .message-content {
    background: #ffffff;
    color: #333;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 3px;
}
/* 发送消息样式 */
.user {
    flex-direction: row-reverse;
}
.user .message-content {
    background: linear-gradient(135deg, #007bff, #00bfff);
    color: white;
    border-bottom-right-radius: 3px; /* 更自然的对话气泡形状 */
    white-space: pre-wrap;
}
/* 滚动条美化 */
.chat-box::-webkit-scrollbar {
    width: 6px;
}
.chat-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.chat-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}
button {
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s;
    background: linear-gradient(135deg, #007bff, #00bfff);
    align-items: center;
    gap: 8px;
}
button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}
/* 增强触摸响应 */
button:active {
    transform: scale(0.98);
}
/* 响应式设计：根据屏幕宽度调整样式 */
@media (max-width: 1200px) {
    .container {
        width: 75vw; /* 在小屏幕上宽度更大 */
        height: 88vh; /* 在小屏幕上高度更大 */
    }
    .message-content{
        max-width: 88%;
    }

}
@media (max-width: 992px) {
    .container {
        width: 85vw; /* 在小屏幕上宽度更大 */
        height: 90vh; /* 在小屏幕上高度更大 */
    }
    .message-content{
        max-width: 90%;
    }
    .message-content::before {
        border-width: 8px; /* 小屏幕缩小箭头 */
        top: 12px;
    }
    .bot .message-content::before {
        left: -16px;
    }
    .user .message-content::before {
        right: -16px;
    }
    .header {
        font-size: 1.3rem;
        padding: 8px 0;
    }
    .avatar {
        flex: 0 0 32px;
        height: 32px;
    }
}
@media (max-width: 768px) {
    .container {
        width: 95vw;
        height: 95vh;
        border-radius: 0; /* 移动端去圆角 */
    }
    .header {
        font-size: 1.2rem;
        border-radius: 0;
    }
    .message-content {
        max-width: 92%;
        font-size: 13px;
    }
    /* 优化移动端箭头 */
    .message-content::before {
        border-width: 8px;
        top: 10px;
    }
    .bot .message-content::before {
        left: -16px;
    }
    .user .message-content::before {
        right: -16px;
    }
}
@media (max-width: 480px) {
    .container {
        width: 100vw; /* 在超小屏幕上宽度占满 */
        height: 100vh; /* 在超小屏幕上高度占满 */
    }
    .message-content{
        max-width: 95%;
    }
    .header {
        font-size: 1.1rem;
        padding: 6px 0;
    }
    .avatar {
        flex: 0 0 28px;
        height: 28px;
    }
    #inputMessage {
        font-size: 14px;
        min-height: 55px;
    }
    button {
        padding: 10px 20px;
        font-size: 14px;
    }
    /* 移动端隐藏代码语言标签 */
    .code-language {
        font-size: 0.75em;
    }
}
.response-container {
    padding: 10px;
    border-radius: 5px;
    white-space: pre-wrap;
}
.reasoning-content-container {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: small;
    color: #668;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 2px solid #007bff;
    white-space: pre-wrap;
}
.content-container {
    margin-bottom: 20px;
    line-height: 1.6;
}
.code-block {
    position: relative;
    margin-top: 20px;
    background-color: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid rgba(0,123,255,0.1);
    border-radius: 8px 8px 0 0;
    font-family: 'SF Mono', 'Consolas', monospace;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.code-language {
    color: #2d5986;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.code-language::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(135deg, #007bff 30%, #00bfff 100%);
}
.copy-button {
    background: rgba(0,123,255,0.08);
    border: 1px solid rgba(0,123,255,0.15);
    padding: 5px 12px;
    border-radius: 6px;
    color: #007bff;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.copy-button:hover {
    background: rgba(0,123,255,0.12);
    border-color: rgba(0,123,255,0.25);
    box-shadow: 0 2px 6px rgba(0,123,255,0.1);
    transform: translateY(-1px);
}
.copy-button:active {
    transform: translateY(0);
    transition: none;
}
.code-container {
    overflow-x: auto;
    padding: 15px;
    max-width: calc(100vw - 40px); /* 防止横向溢出 */
}
/* 添加代码块容器样式 */
.code-block-wrapper {
    margin: 1.5em 0;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}
.code-block-wrapper:hover {
    transform: translateY(-2px);
}
pre[class*=language-]{
    margin: 0 !important;
    white-space: pre-wrap; /* 小屏自动换行 */
    word-break: break-word;
}
code {
    font-family: Consolas, "Courier New", monospace;
}