* {
    box-sizing: border-box;
    /* 确保所有元素的内边距和边框都包含在总宽度内 */
}

img,
iframe,
video {
    max-width: 100%;
    /* 确保媒体文件不会超过其容器宽度 */
    height: auto;
    /* 保持媒体文件的原始宽高比 */
}

/* 使用 vw 单位来设置宽度 */
input,
textarea {
    max-width: 100vw;
    /* 使用视口宽度单位 */
    box-sizing: border-box;
    /* 确保内边距和边框包含在宽度内 */
}

#user-input {
    min-height: 50px;
    /* 最小高度 */
    max-height: 200px;
    /* 最大高度 */
    overflow-y: auto;
    /* 当内容超过最大高度时显示滚动条 */
}

/* 添加滚动条样式 */
#user-input::-webkit-scrollbar {
    width: 5px;
    /* 设置滚动条宽度 */
}

#user-input::-webkit-scrollbar-track {
    background: transparent;
    /* 滚动条轨道透明 */
}

#user-input::-webkit-scrollbar-thumb {
    background: #888;
    /* 滚动条颜色 */
}

#user-input::-webkit-scrollbar-thumb:hover {
    background: #555;
    /* 滚动条悬停时的颜色 */
}


body {
    font-family: Arial, sans-serif;
    /* background-color: #f7f7f7; */
    margin: 0;
    /* padding: 20px; */
    /* padding-bottom: 10px; */
    /* 为底部固定的输入框留出空间 */
    margin-bottom: 0;
    /* 移除之前设置的外边距 */
    background-image: url('pictures/SnakeRiverTeton_1920x1080.jpg');
    /* 替换为您的背景图片链接 */
    background-size: cover;
    /* 背景图片覆盖整个页面 */
    background-repeat: no-repeat;
    /* 不重复背景图片 */
    background-position: center center;
    /* 背景图片居中 */
    min-height: 100vh;
    /* 确保body至少与视口一样高 */
    background-attachment: fixed;
    /* 背景图片固定，不随滚动条滚动 */
    position: relative;
    /* 设置为相对定位，作为后代绝对定位的参照 */
}

body {
    overflow: hidden;
    /* 禁用滚动 */
}


/*内联代码*/
code {
    font-family: 'Arial', sans-serif;
}


#login-container {
    position: relative;
    /* 这是必须的，以便于内部的绝对定位元素正确定位 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-image: url('pictures/bing_wallpaper_PurpleCrocus_1920x1080.jpg');
    /* 替换为您的图片路径 */
    background-size: cover;
    /* 背景图片覆盖整个容器 */
    background-repeat: no-repeat;
    /* 不重复背景图片 */
    background-position: center;
    /* 背景图片居中 */
}

#login-container input {
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.login-button {
    background-color: #4CAF50;
    /* 绿色背景 */
    color: white;
    /* 白色文字 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标悬停时的指针形状 */
    width: 100px;
    /* 宽度，可以根据需要设置为特定的px值 */

    /* Flexbox布局确保内容居中 */
    display: flex;
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    border-radius: 5px;
    padding: 5px 5px;
    /* 根据需求调整内边距，但要保持上下内边距相等 */
    height: 30px;
    /* 按钮的固定高度，根据需要调整 */
    box-sizing: border-box;
    /* 确保padding和border包含在width和height内 */

    transition: background-color 0.3s;
    /* 鼠标悬停时的背景颜色变化效果 */
}

.login-button:hover {
    background-color: #45a049;
    /* 鼠标悬停时的背景颜色变深 */
}

.floating-text-login {
    position: absolute;
    top: 50%;
    left: 50%;
    /* 假设这是用户名输入框的左边距 */
    transform: translateY(-50%);
    margin-left: -350px;
    /* 向左移动50px */
    margin-top: -15px;
    /* 向上移动20px，根据需要调整 */
    color: white;
    font-size: 30px;
    font-weight: bold;
    /* 加粗文本 */
    z-index: 1;
}




.floating-text {
    display: none;
    position: fixed;
    top: 50%;
    /* 垂直居中，根据具体需要调整 */
    left: 50%;
    transform: translate(-50%, -50%);
    /* 使用transform居中对齐 */
    color: white;
    font-size: 30px;
    /* 设置字体大小，根据需要调整 */
    z-index: 1;
    /* 确保这个值小于chat-container的z-index */
    text-align: center;
    /* 文本居中对齐 */
    width: 100%;
    /* 宽度设置为100%，以便水平居中 */
    max-width: 600px;
    /* 最大宽度，根据需要调整 */
    margin: 0 auto;
    /* 水平居中的另一种方式，与left和transform结合使用 */
}



#chat-container {
    display: none;
    /* 初始不显示消息容器 */
    background-color: transparent;
    border-radius: 5px;
    padding: 10px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    margin-left: 100px;
    /* 左边间距 */
    margin-right: 100px;
    /* 右边间距 */
    margin-bottom: 30px;
    margin-top: 30px;
    /* 确保与输入框有足够的间距 */
    max-height: 70vh;
    /* 设置一个最大高度，可以根据需要调整 */
    overflow-y: auto;
    /* 允许垂直滚动 */
    font-family: Arial, sans-serif;
    scroll-behavior: smooth;
    /*滚动效果*/
    position: relative;
    /* 如果还没有定位，需要添加 */
    z-index: 2;
    /* 确保这个值大于floating-text的z-index */
}

#chat-container p {
    margin: 0;
    /* 移除上下边距 */
}


/* 添加滚动条样式 */
#chat-container::-webkit-scrollbar {
    width: 5px;
    /* 设置滚动条宽度 */
}

#chat-container::-webkit-scrollbar {
    height: 5px; /* 设置水平滚动条的高度 */
}


#chat-container::-webkit-scrollbar-track {
    background: transparent;
    /* 滚动条轨道透明 */
}

#chat-container::-webkit-scrollbar-thumb {
    background: #888;
    /* 滚动条颜色 */
}

#chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
    /* 滚动条悬停时的颜色 */
}


.message {
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    position: relative;
    font-family: Arial, sans-serif;
    text-align: left;
    /* 设置文本对齐到左侧 */
    font-size: 14px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

@keyframes zoomIn {
    from {
      transform: scale(0);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  .zoomIn {
      animation: zoomIn 0.5s ease-out forwards;
  }
  


.user-message {
    background-color: #f0f4f9;
}

.ai-message {
    background-color: #e1f5fe;
}

.user-message,
.ai-message {
    /* 设置圆角 */
    border-radius: 5px;

    /* 垂直间距设置 */
    margin-top: 5px;
    /* AI消息上方的间距 */
    margin-bottom: 5px;
    /* 用户消息下方的间距 */

    /* 如果需要调整水平间距，可以使用以下代码 */
    margin-left: 5px;
    margin-right: 5px;

    /* 其他样式保持不变 */
}


/* 调整输入框的初始显示状态 */
#input-form {
    display: none;
    justify-content: center;
    /* 子元素在主轴（此处是垂直）居中 */
    align-items: center;
    /* 子元素在交叉轴（此处是水平）居中 */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    padding: 5px 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}


#input-form textarea {
    flex-grow: 1;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 4px;
    resize: vertical;
    height: 60px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

#input-form #user-input {
    resize: none;
}


#input-form button {
    padding: 4px;
    background-color: transparent;
    /* 透明背景 */
    color: white;
    border: none;
    cursor: pointer;
    /* transition: background-color 0.3s ease; */
    /* 添加过渡效果 */
    font-size: 16px;
    /* 或者是与 #image-label 相同的具体大小 */
    max-height: 30px;
    min-width: 20px;
    margin-right: 4px;
    /* 添加到除最后一个按钮之外的每个按钮 */
}


#input-form button:disabled {
    /* background-color: #9E9E9E; */
    /* 禁用状态的背景色 */
    cursor: not-allowed;
    /* 禁用状态的光标 */
    /* animation: pulseAnimation 1s infinite; */
    /* 添加动画 */
}

#image-input {
    display: none;
}

#image-label {
    padding: 4px;
    /* 与 button 相同的内边距 */
    background-color: transparent;
    /* 背景色 */
    color: white;
    /* 文字颜色 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标样式 */
    /* transition: background-color 0.3s ease; */
    /* 过渡效果 */
    text-align: center;
    /* 文本居中 */
    font-size: 16px;
    /* 或者是与 #image-label 相同的具体大小 */
    display: flex;
    /* 使用flex布局 */
    align-items: center;
    /* 垂直居中 */
    justify-content: center;
    /* 水平居中 */
    line-height: normal;
    /* 移除固定的行高，因为flex布局会处理垂直对齐 */
    margin-right: 4px;
    /* 添加到除最后一个按钮之外的每个按钮 */
    max-height: 30px;
}




#send-button i,
#image-label i {
    font-size: 20px;
    /* 图标大小 */
    color: #1E3050;
    /* 图标颜色 */
}

#send-button i,
#image-label i {
    font-size: 20px;
    /* 初始图标大小 */
    color: #1E3050;
    /* 图标颜色 */
    transition: transform 0.3s ease;
    /* 平滑过渡动画 */
}

#send-button:hover i,
#image-label:hover i {
    transform: scale(1.2);
    /* 悬停时放大图标  */
}

/* 添加一个样式用于显示错误消息 */
.error-message {
    position: fixed;
    z-index: 1000;
    /* 确保这个值高于页面上其他元素的z-index */
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: red;
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    display: none;
}

.logout-button {
    display: none;
    position: fixed;
    top: 10px;
    /* 距离顶部的距离 */
    left: 2px;
    /* 距离右侧的距离 */
    background-color: transparent;
    /* 透明背景 */
    color: #ff6b6b;
    /* 珊瑚色文字 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标悬停时的指针形状 */
    display: flex;
    /* Flexbox布局确保内容居中 */
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    padding: 5px 5px;
    /* 内边距 */
    font-size: 16px;
    /* 文字大小，根据需要调整 */
    transition: color 0.3s;
    /* 鼠标悬停时的文字颜色变化效果 */
}

.logout-button:hover {
    color: #ff8787;
    /* 鼠标悬停时的文字颜色变为稍微深一点的珊瑚色 */
}


.clear-btn {
    display: none;
    position: fixed;
    top: 40px;
    /* 距离顶部的距离 */
    left: 2px;
    /* 距离右侧的距离 */
    background-color: transparent;
    /* 透明背景 */
    color: #ff6b6b;
    /* 珊瑚色文字 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标悬停时的指针形状 */
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    padding: 5px 5px;
    /* 内边距 */
    font-size: 16px;
    /* 文字大小，根据需要调整 */
    transition: color 0.3s;
    /* 鼠标悬停时的文字颜色变化效果 */
}

.clear-btn:hover {
    color: #ff8787;
    /* 鼠标悬停时的文字颜色变为稍微深一点的珊瑚色 */
}

.clear-img {
    display: none;
    position: fixed;
    top: 70px;
    /* 距离顶部的距离 */
    left: 2px;
    /* 距离右侧的距离 */
    background-color: transparent;
    /* 透明背景 */
    color: #ff6b6b;
    /* 珊瑚色文字 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标悬停时的指针形状 */
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    padding: 5px 5px;
    /* 内边距 */
    font-size: 16px;
    /* 文字大小，根据需要调整 */
    transition: color 0.3s;
    /* 鼠标悬停时的文字颜色变化效果 */
}

.clear-img:hover {
    color: #ff8787;
    /* 鼠标悬停时的文字颜色变为稍微深一点的珊瑚色 */
}

.change-model {
    display: none;
    position: fixed;
    top: 100px;
    /* 距离顶部的距离 */
    left: 2px;
    /* 距离右侧的距离 */
    background-color: transparent;
    /* 透明背景 */
    color: #ff6b6b;
    /* 珊瑚色文字 */
    border: none;
    /* 无边框 */
    cursor: pointer;
    /* 鼠标悬停时的指针形状 */
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
    padding: 5px 5px;
    /* 内边距 */
    font-size: 16px;
    /* 文字大小，根据需要调整 */
    transition: color 0.3s;
    /* 鼠标悬停时的文字颜色变化效果 */
}

.change-model:hover {
    color: #ff8787;
    /* 鼠标悬停时的文字颜色变为稍微深一点的珊瑚色 */
}

.model-selector {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 105px;
    left: 30px;
    background-color: transparent;
}

.model-selector button {
    background-size: cover;
    border: none;
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-radius: 50%;
    margin: 5px 2px; /* 垂直方向间距5px，水平方向间距0 */
}



#openai-button {
    background-image: url('pictures/AI_MODEL/openai.png'); /* 替换为OPENAI logo的路径 */
}

#google-button {
    background-image: url('pictures/AI_MODEL/google.ico'); /* 替换为GOOGLE logo的路径 */
}

#xunfei-button {
    background-image: url('pictures/AI_MODEL/xunfei.ico'); /* 替换为XUNFEI logo的路径 */
}

.message {
    word-wrap: break-word;
    /* 允许长单词或URL在边界内换行 */
    display: flex;
    align-items: flex-start;
    /* 将头像和文本顶部对齐 */
    margin-bottom: 10px;
    /* 消息之间的间距 */

}

.user-message, .ai-message {
    border-radius: 5px; /* 设置圆角 */
    margin: 3px 1px; /* 设置垂直和水平间距 */
    font-size: 14px; /* 字体大小 */
    overflow: auto; /* 当内容溢出时显示滚动条 */
    max-width: 100%;
}




.avatar {
    width: 20px;
    /* 头像的固定宽度 */
    height: 20px;
    /* 头像的固定高度 */
    border-radius: 50%;
    /* 圆形头像 */
    margin-right: 2px;
    /* 头像和文本之间的间隔 */
}


img {
    max-width: 100%;
    /* 图片最大宽度为其容器宽度 */
    height: auto;
    /* 高度自动 */
}

.count-container {
    position: fixed;
    bottom: 6px;
    right: 55px;
    color: #a9a9a9; /* 浅灰色 */
    background-color: transparent;
    padding: 0 5px;
    font-size: 12px;
    user-select: none; /* 防止文本选择 */
}








/* 定义动画 */
@keyframes pulseAnimation {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* 媒体查询适配小屏幕 */
@media (max-width: 600px) {

    #chat-container,
    #input-form {
        padding: 5px;
        /* 为小屏幕设备减少内边距 */
        margin: 0 auto;
        /* 水平居中 */
    }

    #input-form {
        display: none;
        /* 开启Flexbox布局 */
        justify-content: center;
        /* 水平居中 */
        align-items: center;
        /* 垂直居中 */
        flex-wrap: wrap;
        /* 允许子元素在必要时换行 */
        padding: 4px;
        /* 根据需要调整内边距 */
        gap: 5px;
        /* 子元素之间的间隔 */
    }

    #input-form textarea {
        flex-grow: 2;
        /* 让文本区域占据更多空间 */
        margin-right: 4px;
        /* 与其他元素的间隔 */
        height: 60px;
    }

    #input-form button,
    #image-label {
        flex-grow: 1;
        /* 使按钮和图片标签平分剩余空间 */
        padding: 3px 4px;
        /* 调整内边距 */
        font-size: 12px;
        /* 调整字体大小 */
        text-align: center;
        /* 文字居中 */
        white-space: nowrap;
        /* 防止文字换行 */
        max-width: 50px;
        /* 限制最大宽度 */
        border: 1px solid transparent;
        /* 统一边框样式 */
        margin-right: 2px;
        /* 为按钮之间添加间隔 */
        margin-bottom: 2px;
    }

    #input-form button:last-child,
    #image-label:last-child {
        margin-right: 0;
        /* 最后一个元素不需要右边距 */
    }

    #chat-container {
        margin-left: 30px;
        /* 左边间距 */
        margin-right: 30px;
        /* 右边间距 */
        margin-top: 10px;
        top: 105px;
        /* 向下移动 30px */
    }



    #login-container {
        /* 其他样式保持不变 */
        background-image: url('pictures/bing_wallpaper_PurpleCrocus_1920x1080.jpg');
        /* 替换为您的图片路径 */
        background-size: cover;
        /* 背景图片覆盖整个页面 */
        background-repeat: no-repeat;
        /* 不重复背景图片 */
        background-position: center;
        /* 背景图片居中 */
        display: none;
    }

    .floating-text-login {
        position: absolute;
        top: calc(50% - 150px);
        /* 调整为距离顶部50%的位置再向上偏移50px */
        left: 50%;
        transform: translate(-50%, -50%);
        margin-left: 0;
        /* 移除不必要的左边距 */
        margin-top: 0;
        /* 移除不必要的上边距 */
        color: white;
        font-size: 20px;
        /* 可以调整字体大小以适应小屏幕 */
        text-align: center;
        /* 文本居中 */
    }

}