/* 默认亮色主题变量 */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #e9eaeb;
  --bg-tertiary: rgba(245, 245, 245, 1);
  --bg-message-bot:rgba(245, 245, 245, 0.8);
  --text-primary: rgb(19, 19, 19);
  --text-secondary: rgba(64, 64, 68, 0.8);
  --text-tertiary: rgba(64, 64, 68, 0.6);
  --border-color: #e5e5e5;
  --hover-color:rgba(201, 231, 255, 0.9);
  --active-color:rgba(228, 228, 228, 0.8);
  --gradient-start: #f0f0f1ec;
  --gradient-end: #ffffff;
  --link-color: #005cc5;
  --hover-link-color: #7b91ff;
  --sidebar-bg: rgb(249 249 249 / 80%);
  --menu-bg: #ffffff;
  --code-bg: rgb(252, 252, 252);
  --code-text: #000000;
  --popup-bg: rgba(252, 255, 234, 0.9);
  --img-width:200px;
  --box-shadow-color: rgba(0, 0, 0, 0.1);
  --dynamic-content:"☀️";
}

/* 定义主题颜色变量 */
:root[class='dark'] {
  /* 暗色主题变量 */
  --bg-primary: rgba(42, 42, 55, 1);
  --bg-secondary: rgba(52, 53, 65, 0.9);
  --bg-tertiary: rgba(68, 70, 84, 1);
  --bg-message-bot:rgb(53 55 72 / 72%);
  --text-primary: rgb(249, 249, 253);
  --text-secondary: rgba(225, 225, 225, 0.9);
  --text-tertiary: rgba(225, 225, 225, 0.6);
  --border-color: rgba(32, 33, 35, 0.5);
  --hover-color: rgb(49 78 146 / 90%);
  --active-color: rgba(95, 95, 109, 0.9);
  --link-color: #79c0ff;
  --hover-link-color: #7b91ff;
  --menu-bg: rgba(36, 38, 40, 0.9);  
  --sidebar-bg: rgba(36, 38, 40, 0.8);
  --code-bg: rgb(24,29,40);
  --code-text: #fafafa;  
  --popup-bg: rgba(99, 100, 92, 0.9);
  --box-shadow-color: rgba(255, 255, 255, 0.1);
  --dynamic-content:"🌙";
}


/* 添加自动主题样式 */
@media (prefers-color-scheme: dark) {
  :root[class='auto'] {
  /* 暗色主题变量 */
  --bg-primary: rgba(42, 42, 55, 1);
  --bg-secondary: rgba(52, 53, 65, 0.5);
  --bg-tertiary: rgba(68, 70, 84, 1);
  --bg-message-bot:rgb(53 55 72 / 72%);
  --text-primary: rgb(249, 249, 253);
  --text-secondary: rgba(225, 225, 225, 0.9);
  --text-tertiary: rgba(225, 225, 225, 0.6);
  --border-color: rgba(32, 33, 35, 0.5);
  --hover-color: rgb(49 78 146 / 90%);
  --active-color: rgba(95, 95, 109, 0.9);
  --link-color: #79c0ff;
  --hover-link-color: #7b91ff;
  --menu-bg: rgba(36, 38, 40, 0.9);  
  --sidebar-bg: rgba(36, 38, 40, 0.8);
  --code-bg: rgb(24,29,40);
  --code-text: #fafafa;  
  --popup-bg: rgba(99, 100, 92, 0.9);
  --box-shadow-color: rgba(255, 255, 255, 0.1);
  --dynamic-content:"🌙";
  }
}


/* 修改现有样式，使用变量 */
html,
body {
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-primary);
  overflow: hidden;
  scroll-behavior: smooth;
  font-family: Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,Oxygen,Open Sans,sans-serif;
  color:var(--text-primary);
}










.system body,
.system html {
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* 设置聊天气泡的样式 */
.chat-bubble {
  width: 100%;
  text-align: center;
  justify-content: center;
  border-radius: 0px;
  padding: 10px 5px;
  display: flex;
  --tw-text-opacity: 1;
  color: var(--text-primary);
  box-sizing: border-box;
  border-color: var(--border-color);
  border-top-width: 1px;
  position: relative;
}

.user {
  --tw-bg-opacity: 1;
  background-color: var(--bg-primary);
}

.bot {
  --tw-bg-opacity: 1;
  background-color: var(--bg-primary);

}

.icon {
  line-height: normal;

}

.flex {
  display: flex;
}

.gap-1 {
  gap: .25rem;
}
.gap-2 {
  gap: .5rem;
}

.items-center {
  align-items: center;
}

.icon-sm {
  stroke-width: 2;
  flex-shrink: 0;
  height: 1rem;
  width: 1rem;
}

.faceicon {
  position: relative;
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  vertical-align: middle;
  border-radius: 100%;
  margin-top: 10px;
  text-align: center;
  line-height: 28px;
  text-indent: 6px;
  /* background-image: linear-gradient(125deg, #dddddd, #c7c7c7); */
  /* background-image: linear-gradient(125deg, rgba(119, 0, 255, 0.911), var(--bg-secondary));   */
}

.faceicon img {
  border-radius: 100%;
  object-fit: cover;
  width: 100%;
  height: 100%;
  margin: auto;
  padding: 1px;
}

.faceicon.sd img {
  padding: 2px;
}

.faceicon.doingtext {
  padding: 0px;
}

.icon-user {
  background-image: linear-gradient(-41deg, var(--text-primary), var(--bg-tertiary));
}

.icon-bc {
  background-image: linear-gradient(-41deg, var(--text-primary), transparent);
}

.faceicon.sd {
  background-image: linear-gradient(-41deg, #8ba4e9b4, #a2fabc, rgba(255, 115, 157, 0.795));
}

.doingtext {
  background-image: linear-gradient(-41deg, var(--text-primary), var(--active-color), var(--text-secondary));
}

.doingdraw {
  background-image: linear-gradient(-41deg, var(--text-primary), var(--active-color), var(--text-secondary));
}

.message-box {
  max-width: 1920px;
  min-width: 256px;
  margin: 10px 0 5px 0;
  width: 100%;
  padding: 5px 5px;  
  display: flex;
  flex-direction: column;
  
  /* 垂直排列整体内容 */
}

.userbox {
  display: flex;
  align-items: flex-end; 
}
.assistantbox {
  display: flex;
  align-items: flex-start; 
}

.userbox .icon-box {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
}

.message-box-content{
  display: flex;
  flex-direction: column;
  padding: 5px 5px;
  max-width: calc(100% - 20px); /* 添加最大宽度限制 */
  overflow-x: hidden; /* 防止水平溢出 */ 
}


.bot .message-box-content{  
  float: left;  
  margin: -60px 0px 0px 30px;  
}

.userbox .message-box-content{  
  float: right;  
  margin: -60px 32px 15px 30px;  
  max-width: 90%;  
}

.userbox .message{
  margin-top: 25px;
  background-color: var(--hover-color);
  position: relative;
  padding: 2px 15px;
  border-radius: 10px; 
  display: block;
  width: fit-content; /* 改为 fit-content 让宽度适应内容 */
  max-width: 100%; /* 但不超过容器宽度 */
}

.userbox .message::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 100%; /* 右边对齐 */
  border-width: 6px; /* 尖角的大小 */
  border-style: solid;
  border-color: transparent transparent transparent var(--hover-color); /* 颜色匹配背景 */
}



.bot .message{
  margin-top: 0px;
  background-color: var(--bg-message-bot);
  position: relative;
  padding: 5px 10px;
  border-radius: 10px;
  display: block; /* 改为 block 而不是 inline-block */
  width: 100%; /* 确保宽度100% */
}

.bot .message::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -12px; /* 调整为负值以移动到左边 */
  border-width: 6px; /* 尖角的大小 */
  border-style: solid;
  border-color: transparent var(--bg-message-bot) transparent transparent; /* 颜色匹配背景 */
}


.userbox .userinfo{
  display: flex ;
  flex-direction: row-reverse;  
  align-items: center;
  position:absolute;
  right: 50px;
}


.icon-box {
  display: flex;
  align-items: flex-start;
}
.userinfo {
  margin-top: 0px;
  padding: 0;
  text-align:justify;
  
}


.message {
  font-size: 1em;
  text-align: start;
  padding: 0px;
  line-height: 1.8em;
  flex: 1;
  white-space: normal;
  min-height: 32px;
  margin: 0px 0px;
  clear: both;
}

.message img {
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  max-height: 80vh;
}

/* .message> :first-child:is(p) {
  text-indent: 2.2em; 
} */

.message>p:empty {
  min-height: 20px;
  /* 设置空段落的最小高度 */
}

/* .message> :first-child:not(p, hr) {
  margin-top: 20px;
} */

.message p,.doc-container p{
  white-space: normal;
  word-break: break-all;
  margin: 10px 0px;
}
.message div,.doc-container p {
  white-space: normal;
  word-break: break-all;
}

.message li,.doc-container li {
  margin: 0 0px;
  white-space: normal;
  word-break: break-all;
}

.message ol,.doc-container ol, .search-message ol {
  padding-left:20px;
  margin: 10px;
}

.message ul.ol, .doc-container ul.ol {
  padding-left:20px;
  margin: 10px;
  list-style-type: none;
}

.message ul, .doc-container ul, .search-message ul{
  margin: 10px;
  padding-left: 20px;
}



.table-row {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.icon-cell {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.text-cell {
  flex: 1;
}

.full-height {
  height: 100%;
}

.sendbtn-box {
  padding: 3px;
  position: absolute;
  bottom: 25px;
  right: 25px;   
  
}

.formbtn {
  border: none;
  outline: none;
  color: var(--text-secondary);
  background-color: transparent;
  border-radius: 100%;
}

.uppyModalOpener {

  display: block;
}

.stopbtn {
  display: none; 
  padding: 0px;
  background-color: var(--link-color) !important;  
  color:var(--bg-tertiary) !important;
  border-radius: 100%;
  height: 32px;
  width: 32px;
}

.sendbtn {
  margin: 0px;
  color:#fff !important;
  background-color: var(--link-color) !important;
  border-radius: 100%;
  height: 32px;
  width: 32px;
  
}

.formbtn:hover {
  color:#fff !important;
  background-color: var(--hover-link-color)!important;
}

.formbtn :active {
  color:var(--bg-secondary) !important;
  background-color: var(--active-color);
}

.formbtn:focus {
  color:var(--bg-tertiary) !important;
  background-color: var(--hover-link-color);
}


.share-button {
  top: 0px;
  position: absolute;
  right: 5px;
}

.no-select {
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

a {
  color: var(--link-color);
  text-decoration: none;
}
a:hover {
  color: var(--hover-link-color);
}

.message pre {
  margin: 5px 0;
  border-radius: 5px;
  position: relative;
  width: 100%; /* 设置宽度100% */  
  overflow: visible; /* 允许内容溢出 */
}
.message pre.sd{
  max-width: 960px;
}

.message pre code.mermaid{
  max-height: none !important;
}

.message pre code {
  /* font-family: Consolas, "Courier New", monospace; */
  background-color: var(--code-bg) !important;
  color: var(--text-primary);
  border-radius: 0 0 5px 5px; 
  padding: 10px;
  display: block;
  overflow-x: auto; /* 允许横向滚动 */
  white-space: pre; /* 保持原始格式 */
  line-height: 1.6em;
  font-size: 12px;
  max-height: 60vh;
}

pre button {

  color: var(--text-secondary);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}

pre button:hover {
  background-color: var(--hover-color) !important;
  color: var(--text-primary);
}


button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
}

:root {
  --sidebar-width: 0px;
  --div-move-left: calc(var(--sidebar-width) / 2);
  --div-max-width: calc(100vw - var(--sidebar-width));
}

:root:has(.sidebar.show) {
  --sidebar-width: 250px;
  --div-move-left: calc(var(--sidebar-width) / 2);
  --div-max-width: calc(100vw - var(--sidebar-width));
}

.navbar-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
    height: 45px;
  min-width: 250px;
  transition: top 0.3s;
  background-color: var(--sidebar-bg);
  
}

.navbar-header .title {
  text-align: -webkit-center;
}

.navbar-header h1 {
  color: var(--text-secondary);
  font: 1.0em large;
  width: 250px;
  /* 文字显示的宽度为200像素 */
  white-space: nowrap;
  /* 不允许文字换行 */
  overflow: hidden;
  /* 超出的文字部分隐藏 */
  text-overflow: ellipsis;
  /* 超出部分以省略号显示 */

}

.icon-bar {
  background-color: var(--text-primary);
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  margin-top: 4px;
}


.sidebar a {
  color: var(--text-secondary);
}

.sidebar a:hover {
  background-color: var(--hover-color);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin-left: 0px;
}

.sidebar li {
  margin: 5px 5px;
  border-radius: 10px;
  color: #666;
  font-size: xx-small;
}

.sidebar li a {
  font-size: small;
  display: block;
  border-radius: 10px;
  padding: 5px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  width: 100%;
  max-width: 240px;
  /* 文字显示的宽度为200像素 */
  white-space: nowrap;
  /* 不允许文字换行 */
}

.sidebar li a:hover {
  background-color: var(--hover-color);
}

.content.full {
  left: 0px;

}

.content {
  position: relative;
  flex-grow: 1;
  z-index: 1;
  background-color: var(--bg-primary);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 设置聊天窗口的样式 */
.chat-window {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 100px;  
  position: relative;
  /* background-color: var(--bg-secondary); */
}

.bottom a {
  font: 0.8em sans-serif;
}

.chatform {
  left: 250px;
  position: fixed;
  z-index: 99;
  text-align: center;
  padding: 15px;
  box-sizing: border-box;
  max-width: 1280px;
  min-width: 250px;
  margin: auto;
  right: 0px;
  bottom: 0px;
  max-height: 90%;
}

.chatform form {
  display: flex;
  /* 使用 Flexbox 布局 */
}

.chatform.full {
  left: 0px
}

.message-input img {
  max-width: 50px !important;
  max-height: 50px !important;
}


.message-textarea {
  position: absolute;
  left: 0;
}

/* 设置发送消息的输入框的样式 */
.message-input {
  text-align: left;
  width: 100%;
  max-width: 1280px;
  padding: 15px 30px 10px 10px;
  border: none;
  border-radius: 10px;
  box-sizing: border-box;
  outline: none;
  background-color: var(--bg-tertiary);
  opacity: 0.9;
  /* transition: all 0.2s ease-in-out; */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 16px;
  max-height: 40vh;
  overflow-y: auto;
  min-height: auto;
  resize: vertical;
  margin-top: 10px;
  white-space: pre-wrap;
  /* 保留换行和空格 */
}

.message-input:hover {
  outline: none;  
  opacity: 0.95;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
}

div::webkit-resizer {
  background-color: #2c2c2c;
  /* 设置手柄颜色 */
  border: 2px solid #000;
  /* 可以添加边框 */
}


/* 为所有非图片容器的其他元素设置整行宽度 */
.message>*:not(.image-container, img, a, p) {
  flex: 0 0 100%;
  /* 占满整行 */
}

.image-container a img {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
}

li p img {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
}


.sd_models {
  width: 200px;
}

.sd_rate {
  width: 75px;
}

.message i {
  font-size: xx-small;
}



.xx-small {
  font-size: xx-small;
}
.x-small{
  font-size: x-small;
}

.message h1,.doc-container h1 {
  font: 1.3em sans-serif;
  font-weight: bold;
}

.message h2,.doc-container h2 {
  font: 1.2em sans-serif;
  font-weight: bold;
}

.message h3,.doc-container h3 {
  font: 1.1em sans-serif;
  font-weight: bold;
}

.message h4,
.message h5,
.message h6,
.doc-container h4,
.doc-container h5,
.doc-container h6 {
  font: 1.0em sans-serif;
  font-weight: bold;
}

.aitype {
  max-width: 200px;
}

.sd_steps {
  max-width: 80px;
}


.funclist label {
  font: 1.3em sans-serif;
  color: #fafafa;
}

.menu-container {
  padding-top: 50px;
  overflow-x: hidden;
  overflow-y: auto;
  width: 250px;
  height: calc(100vh - 50px);
  background-color: var(--sidebar-bg);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

}

* {
  box-sizing: border-box;
}


.sidebar {
  background-color: var(--sidebar-bg);
  border-color: var(--border-color);
  z-index: 97;
  display: none;
  flex: 0 0 250px;
}

.sidebar.show {
  display: block;
}

.sidebar-toggle {
  float: left;  
}

.addSession {
  position: absolute;
  top: 0px;
  left: 50px;
}

.sidebar-button,
.sidebar-toggle {
  margin: 6px 4px;
  padding: 4px;
  background-color: transparent;
  border: 0px solid transparent;
  border-radius: 4px;
  border-color: #333;
  display: block;
  color: #fff;
  width: 32px;
  height: 32px;  
  font-size: small;
  fill: none;
  stroke: none;
  color: var(--text-primary);
}

.sidebar-button:hover,
.sidebar-toggle:hover {
  
  background-color: var(--hover-color)
}


.image-container {
  position: relative;
  display: inline-block;
  /*flex: 1; 每个image-container占用相等宽度 */
  max-width: 30%;
  /* 可以限制container最大宽度，以确保在多余的空间里也不会太大 */
  padding: 10px;
  /* 图片容器之间增加一些间距 */
  box-sizing: border-box;
  /* 包含padding在内计算宽度 */
}


.image-container.count-1 {
  max-width: 50%;
}

.image-container,
.image-container.count-2,
.image-container.count-3,
.image-container.count-4 {
  max-width: 25%;
}

.image-container.count-5 {
  max-width: 20%;
}

.image-container.count-6 {
  max-width: 16.66%;
}

.image-container.count-7 {
  max-width: 14.2%;
}

.image-container.count-8 {
  max-width: 12.5%;
}

.image-container.count-9 {
  max-width: 11.1%;
}

#step_label {
  width: 65px;
  white-space: nowrap;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}



#userimage {
  overflow-y: auto;
  overflow-x: auto;
  display: none;
  align-self: center;
  width: 100%;
}

.full #userimage {
  width: 100%;
}


#userimage img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 5px;
  border-color: rgba(80, 85, 100, var(--tw-border-opacity));
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  margin: 5px;
}

#userimage .img-hover {
  max-width: 50%;
  max-height: 50%;
  width: 50%;
  position: fixed;
  left: 25%;
  bottom: 25%
}

.canvas.full {
  max-width: min(calc((100vw - var(--sidebar-width))/1),1000px);
  width: calc((100vw - var(--sidebar-width))/2);
  min-width: calc((100vw - var(--sidebar-width))/4);
  height: 100vh;
  /* overflow: hidden; */
  background-color: var(--bg-secondary);
}


/* 媒体查询，在屏幕宽度小于 1024px 时应用以下样式 */
@media only screen and (max-width: 1024px) {
  .draw_toolsbar.show {
    display: block;
  }

  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    border-radius: 10px;
  }

  .addSession {
    position: absolute;
    top: 0px;
    right: 10px;
    left: unset;
  }

  .share-button {
    right: 55px;
  }

  .content {
    left: 0px;
  }

  .chatform {
    left: 0px;
  }
  .sidebar.show{
    position: fixed;
    z-index: 997;
  }
  .navbar-header {
    width: 100%;
  }

  .navbar-header h1 {
    max-width: 180px;
    width: 50%;
    min-width: 100px;
    margin-right: 40px;
  }

  .image-container.count-1 {
    max-width: 50%;
  }

  .image-container.count-2 {
    max-width: 25%;
  }

  .image-container.count-1 img {

    /* max-height: 360px; */
    min-height: 100px;
  }

  .image-container.count-3,
  .image-container.count-6,
  .image-container.count-9 {
    max-width: 33.3%;
  }

  .image-container.count-4,
  .image-container.count-7,
  .image-container.count-8 {
    max-width: 25%;
  }

  .image-container.count-5 {
    max-width: 20%;
  }

  select {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);    
  }
}


@media only screen and (max-width: 768px) {
  .sd_models {
    width: 250px;
  }

  .aitype {
    max-width: 250px;
  }

  .sd_steps {
    max-width: 80px;
  }

  .sd_rate {
    width: 80px;
  }
}


@media only screen and (max-width: 720px) {
  .sd_models {
    width: 100px;
  }

  .aitype {
    max-width: 100px;
  }

  .sd_steps {
    max-width: 80px;
  }

  .sd_rate {
    width: 60px;
  }

}

/* 媒体查询，在屏幕宽度小于 480px 时应用以下样式 */

@media only screen and (max-width: 480px) {
  .canvas.full {
    max-width: calc((100vw - var(--sidebar-width))/2);
    width: calc((100vw - var(--sidebar-width))/3);
    min-width: calc((100vw - var(--sidebar-width))/3);

  }
  #userimage img {
    max-width: 100px;
    max-height: 100px;
  }
  .image-container {
    max-width: 50%;
    flex: auto;
  }

  .image-container.count-1 {
    max-width: 100%;
  }

  .image-container.count-2,
  .image-container.count-3,
  .image-container.count-4 {
    max-width: 50%;
  }

  .image-container.count-3,
  .image-container.count-6 {
    max-width: 33.3%;
  }

  .image-container.count-5,
  .image-container.count-7,
  .image-container.count-8,
  .image-container.count-9 {
    max-width: 33.3%;
  }

  select {
    font-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;    /* Firefox */
    appearance: none;
    border: none;
    font-size: 12px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

  }

  .sd_models {
    width: 140px;
  }

  .aitype {
    max-width: 140px;
  }

  .sd_steps {
    max-width: 80px;
  }

  .sd_rate {
    width: 60px;
  }

  #sd_steps_div,#sd_seed_div{
    display: none !important;
  }
}

@media only screen and (max-width: 400px) {
  .sd_models {
    width: 100px;
  }

  .aitype {
    max-width: 100px;
  }

  .sd_steps {
    max-width: 60px;
  }

  .sd_rate {
    width: 40px;
  }
}

@media only screen and (orientation: landscape) {
  .sendbtn-box {
    bottom: 24px;
    right: 25px;
  }

  .chatform {
    bottom: 0px;
  }

  .image-container.count-1 img {
    max-height: 360px;
    min-height: 100px;
  }
}




.message-input {
  min-height: 55px;
}


.chat-bubble-end {
  height: 110px;
  max-height: 30vh;
}

.chat-bubble-begin {
  height: 45px;
}

.title-button {
  position: fixed;
  top: 0px;

}

.absolute {
  position: absolute;
}

.visible {
  visibility: visible;
}

.top-1 {
  margin-top: 0.1rem;
}

.left-1 {
  left: 0.2rem;
}

.right-1 {
  right: 0.2rem;
}

.right-2 {
  right: 2.2em;
}

.right-3 {
  right: 4.3em;
}

.flex {
  display: flex;
}

.break-all {
  word-break: break-all;
}

.text-ellipsis,
.truncate {
  text-overflow: ellipsis;
}

.overflow-hidden {
  overflow: hidden;
}

.items-center {
  align-items: center;
}

[role=button],
button {
  cursor: pointer;
}

[type=button],
[type=reset],
[type=submit],
button {
  -webkit-appearance: button;
  appearance: button;
  background-color: transparent;
  background-image: none;
}

*,
:after,
:before {
  border: 0 solid var(--border-color);
  box-sizing: border-box;
}

hr {
  border: 1 solid var(--border-color);
  box-sizing: border-box;
  margin: 0;
}



.from-gray-800 {
  --tw-gradient-from: #202123;
  --tw-gradient-to: rgba(52, 53, 65, 0);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.right-0 {
  right: 0;
}

.inset-0,
.inset-y-0 {
  bottom: 0;
  top: 0;
}

.w-8 {
  width: 5.5rem;
}

.bg-gradient-to-l {
  background-image: linear-gradient(to left, var(--tw-gradient-stops));
}


.chatlist a div {
  display: inline-flex;
}



.chatlist button {
  background: none;
  border: none;
  padding: 5px;
  margin: 0px 0;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
  color: var(--text-secondary);
  /* transition: all 0.3s ease; */
  display: inline;
  align-items: center;
}

/* 修改按钮内的图标样式 */
.chatlist button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* 修改按钮内的文本样式 */
.chatlist button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}

.chatlist .selected {
  background-color: var(--active-color);
  border-radius: 5px;
}

.chatlist .editbtns {
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-left: auto;
  padding-left: 2px;
  align-items: center;
  position: relative;
  right: 0px;
}

.chatlist .selected .editbtns {
  opacity: 0.8;
  /* transition: opacity 0.3s ease; */
  margin-left: auto;
  align-items: center;
}

.chatlist .editbtns button {

  border: none;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  /* transition: all 0.2s ease; */
}

.chatlist .editbtns button:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
}


.chatlist a:hover .editbtns {
  opacity: 1;
}

.chatlist .linkText {
  overflow: hidden;
  /* 超出的文字部分隐藏 */
  text-overflow: ellipsis;
  /* 超出部分以省略号显示 */
  max-width: 200px;
  width: 100%;
  white-space: nowrap;
}

.chatlist .selected .linkText {
  max-width: 175px;
}


.chat-bubble .editbtns {
  visibility: hidden;
}

.content .selected .editbtns.top{
  top:8px;
  bottom:unset !important;
}

.content .selected .editbtns {

  visibility: visible;
  margin-top: 0px;
  padding: 0 10px;
  bottom:8px;  
}




.retrybtn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.retrybtn svg {
  fill: currentColor;
  stroke: currentColor;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.retrybtn:hover svg {
  color: var(--text-primary);
}

.redrawbtn {
  display: none;
  display: inline-block;
}


.draw_toolsbar {
  display: none;
}

.draw_toolsbar.show {
  display: block;
}

.redrawbtn:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
}

div.wait *{
  opacity: 0.5;
  background-color: transparent !important;
  cursor: wait;
}

.disabled,
.disabled:hover {
  color: var(--text-secondary) !important;
  background-color: var(--hover-color)  !important;
  cursor: not-allowed;
}

.justify-center {
  justify-content: center;
}

.relative {
  position: relative;
}

.gallery {
  margin: 5px 0px;
}



.gallery .magnify-icon {
  position: absolute;
  font-size: 20px;
  cursor: pointer;
  filter: grayscale(50%);
  transition: all 0.3s;
  margin-top: -30px;
}

.gallery .magnify-icon:hover {
  filter: grayscale(1%);
}

/* 样式以确保自定义按钮在放大图像时显示 */
.custom-button {
  position: absolute;
  top: 5px;
  z-index: 1001;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 5px 5px;
  cursor: pointer;
  opacity: 0.8;
  font-size: 14px;
  border-radius: 5px;
}

.custom-button:hover {
  opacity: 1;
  /* 悬停时变为全不透明 */
}

.custom-button.download {
  left: 80px;
  /* 下载按钮位于右上角稍左 */
}

.custom-button.zoom {
  left: 20px;
  /* 放大按钮位于右上角 */
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 25px;
  background-color: var(--popup-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  z-index: 9999999;
  display: none;
  border-radius: 10px;
  word-wrap: break-word;
  max-width: 90%;
  min-width: 200px;
  font-size: small;
}

table {
  width: 100%; 
  border-collapse: collapse;
  margin-bottom: 5px;
  background-color: var(--bg-tertiary);
  font-size: small;
  border: 2px solid var(--border-color);
  max-height: 60vh;
  overflow-y: auto;
  display: inline-block;
}

th,
td {
  padding: 2px 2px;
  text-align: center;
  border: 1px solid var(--border-color);
  font-size: 12px;
}

th {
  background-color: var(--bg-secondary);
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: var(--bg-tertiary);
}

tr:hover {
  background-color: var(--hover-color);
}

.sd_seed {
  width: 80px;
}
.input-button {
  --tw-border-opacity: 1;
  --tw-bg-opacity: 1;
  --tw-text-opacity: 1;
  font-size: 12px;
  color: var(--text-primary);
  border-width: 0px;
  border-color: var(--border-color);
  padding: 0px 6px;
  border-radius: 5px 5px 5px 5px;
  background-color: var(--bg-tertiary);
  margin: 0 0px 3px 3px;
  float: left;
  height: 32px;
  opacity: 0.9;
}

.input-button:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
  opacity: 1;
}

.input-button label input {
  margin: 0px 0px;
}

.input-button label {
  padding: 9px 2px;
  display: flow;
  float: left;
}



.rq li,
li em,
li em,
p em {
  cursor: pointer;
  color: var(--link-color);
}

li em:hover {
  color: var(--hover-link-color) !important;
}


/* 修改 aitype_display 的样式 */
.aitype_display {
  position: absolute;
  top: -20px;  
  width: 32px;
  height: 32px;
  padding: 0;
  text-align: center;
  background-color: var(--bg-tertiary);
  border-radius: 50%;
  opacity: 0.6;
  transition: all 0.3s;
  cursor: pointer;
  z-index: 999;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* 添加信息图标 */
.aitype_display:not(.expanded)::before {
  content: "ℹ️";
  font-size: 14px;
  display: block;
}

/* 展开后的样式 */
.aitype_display.expanded {
  position: absolute;
  width: auto;
  min-width: 200px;
  max-width: 100%;
  height: auto;
  padding: 8px 12px;
  border-radius: 8px;
  opacity: 0.8;
  text-align: left;
  background-color: var(--code-bg);
  z-index:1000 ;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 展开后隐藏图标 */
.aitype_display.expanded::before {
  display: none;
}

/* 内容容器样式 */
.aitype_display .title_display,
.aitype_display .token_display {
  display: none;
  font-size: 12px;
  line-height: 1.4;
}

/* 展开后显示内容 */
.aitype_display.expanded .title_display,
.aitype_display.expanded .token_display {
  display: block;
}

/* 悬停效果 */
.aitype_display:hover {
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.title_display {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 5px;
}

.token_display {
  color: var(--text-secondary);
  font-size: 10px;
  margin-bottom: 5px;
}

.loader {
  position: absolute;
  /* 设置绝对定位 */
  bottom: 4px;
  display: none;
}

.spinner {
  width: 32px;
  /* 圆的直径 */
  height: 32px;
  /* 圆的直径 */
  border: 5px solid var(--bg-secondary);
  /* 边框颜色和透明度 */
  border-top: 5px solid #ffffff77;
  /* 上边框颜色 */
  border-radius: 50%;
  /* 使其圆形 */
  animation: spin 1s linear infinite;
  /* 应用旋转动画 */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  /* 从0度开始 */
  100% {
    transform: rotate(360deg);
  }

  /* 旋转到360度 */
}

span.time {

  font-size: 11px;
  color: transparent;
  /* 默认透明 */
  transition: color 0.3s ease;
  /* 添加过渡效果 */
  transition-delay: 30s;
  /* 设置为非悬停状态的延迟 */
  padding: 0 2px;
}

/* 鼠标悬停或触摸时字体颜色变为黑色 */
span.time:hover,
span.time:focus {
  color: lightgray;
  /* 悬停或触摸时显示的颜色 */
  transition-delay: 0s;
  /* 悬停时立即生效 */
}

span.nick {
  text-transform: capitalize;
  font-size: 12px;
  color: transparent;
  /* 默认透明 */
  transition: color 0.3s ease;
  /* 添加过渡效果 */
  transition-delay: 30s;
  /* 设置为非悬停状态的延迟 */
  padding: 0 2px;
}

.selected span.nick,
.selected span.time {
  color: var(--text-secondary);
  transition-delay: 0s;
}


span.nick:hover,
span.nick:focus {
  color: var(--text-secondary);
  /* 悬停或触摸时显示的颜色 */
  transition-delay: 0s;
  /* 悬停时立即生效 */
}


.message pre code.language-sd,
.message pre code.language-sdprompt,
.message pre code.language-sdcodehide {
  max-height: 150px;
  text-wrap:auto;
}

.message pre code.language-sdcodehide {
  display: none;
}

.message pre code.sdcodehide {
  display: none;
}

.doc-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0 10px;
  font-size: small;
  text-align: left;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  position: relative;
  box-sizing: border-box;
}

.doc-container pre code {
  /* font-family: Consolas, "Courier New", monospace; */
  background-color: var(--code-bg) !important;
  color: var(--code-text);
  border-radius: 0px 0px 5px 5px;
  padding: 10px;
  display: block;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 12px;
  margin: 0;
  max-height: 200px;

}


.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  /* 图标大小 */
  color: var(--text-secondary);
  width: 26px;
  background-color: var(--bg-tertiary);
  height: 26px;

}

.icon-button:hover {
  color: var(--text-primary);
  background-color: var(--hover-color);
}

.icon-minimize {
  border-radius: 0px 0px 0px 0;
}

.icon-maximize {
  /* 中间按钮 */
  display: none;

}


.icon-close {
  right: 0px;
  /* 右侧按钮 */
  border-radius: 0 5px 0px 0;
}

.fileName {
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  padding: 5px;
  background-color: var(--bg-tertiary);
}

.fileName::before {
  content: '📄';
  /* 添加加号 */
}

.fileName:hover {
  font-weight: bold;
}

/* 全屏覆盖的拖放区域 */
#dropArea {
  width: 100%;
  height: 100%;
  border: 2px dashed transparent;
  /* 默认透明边框 */
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 999999;
  pointer-events: none;
  /* 默认不干扰其他元素 */
  transition: background-color 0.3s, border 0.3s;
  /* 添加过渡效果 */


}

#dropMessage {
  display: none;
  position: fixed;
  width: 100%;
  height: 200px;
  /* top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); */
  bottom: 100px;
  font-size: 24px;
  color: #333;
  z-index: 999999;
}

/* 拖动时显示提示和边框 */
#dropArea.dragging {
  pointer-events: auto;
  /* 启用交互 */
  border: 2px solid #4CAF50;
  background-color: rgba(255, 255, 255, 0.6);
  /* 半透明背景 */
}

#dropArea.dragging #dropMessage {
  display: block;
}

.container {
  display: flex;
  /* 使用 Flexbox 布局 */
  width: 100vw;

  /* 容器宽度 */
  height: 100vh;

  /* 容器高度 */
  position: relative;
  overflow: hidden;

}


.canvas {
  display: none;
  position: relative;
  flex-direction: column;
  background-color: var(--bg-secondary);
  z-index: 99;
}

.canvas.full .doc-container pre code {
  max-height: calc(80vh);
}

.canvas.full .canvas-container {
  padding: 48px 0 10px 0;
  max-height: calc(100vh - 66px);
}


.canvas.normal .canvas-container {
  padding: 0;
  max-height: 80vh;
  max-width: calc(80vw - var(--sidebar-width));
  min-width:100px; 
}

.canvas.normal .doc-container pre code {
  max-height: 25vh;
}

.canvas.normal {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  position: absolute;
  bottom: 150px;
  left: calc(50vw + var(--div-move-left));
  /* 水平居中 */
  transform: translateX(-50%);
  /* 移动自身宽度的一半 */
  max-height: 80vh;
  max-width: calc(80vw - var(--sidebar-width));
  min-width: 100px;
  min-height: 60px;
  z-index: 1000;
}

.canvas.normal .doc-container {
  max-height: 80vh;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.canvas.normal .userimage-container {
  min-width: 110px;
}

.canvas.mini {
  position: absolute;
  padding-top: 0px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  right: 15px;
  bottom: 150px;
  z-index: 1000;
}

.canvas.mini .doc-container {
  display: none;
}

.canvas.mini .userimage-container {
  display: none !important;
}

.canvas-container {
  position: relative;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 5px;
}


/* .userbox .editbtns {
  display: flex;
  flex-direction: row-reverse;
} */





.userimage-container {
  min-height: 110px;
  max-height: 50vh;
  /* min-width: 200px; */
  overflow-y: auto;
  padding: 10px;
  box-sizing: border-box;
  background-color: var(--bg-tertiary);
}

.canvasBar {
  border-radius: 5px 5px 0px 0px;
  padding: 5px;
  z-index: 996;
  display: flex;
  justify-content: flex-end;
  background-color: var(--bg-tertiary);
}

.q1-resize-trigger {
  width: 2px;
  cursor: col-resize;
  top: 0;
  bottom: 0;
  left: 100%;
  /* 初始位置在 content 的右边 */
  z-index: 10;
  /* 确保其在上方 */
  background-color: rgba(255, 255, 255, 0);
  padding: 0 2px;
  /* 增加左右内边距，以扩大鼠标可控范围 */
  margin-left: -4px;
  /* 通过负的左边距保持可视效果不变 */
}

.q1-resize-trigger:hover {
  background-color: rgba(255, 255, 255, 0);
}

.canvas-resize {
  display: none;
}

.userchatimg {
  max-width: 25%;
}


.delete-icon {
  display: none;
  /* 初始隐藏 */
  position: relative;
  top: -70px;
}

.overlay-text {
  margin-top: 10px;
  /* 文字与图片间的间距 */
  text-align: center;
  /* 中心对齐 */
  font-size: 16px;
  /* 文字大小 */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  /* 文字阴影，提高可读性 */
}

.canvasTitle {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  padding: 5px 0px;
  position: relative;
  white-space: nowrap;

}

.filesTitle::before {
  content: '📄';
}

.filesTitle:empty:before,
.imagesTitle:empty:before {
  content: var(--icon-empty);
}

.imagesTitle::before {
  content: '🖼️';
}

.filesTitle {
  padding: 0px 5px;
}

.fancybox-button--download {
  background-image: url('download-icon.png');
  /* 使用下载图标 */
  background-size: cover;
}

.input-bar {
  float: right;
  right: 20px;
  top: 50px;
  color: #ddd;
  border-width: 0px;
  padding: px;
  border-radius: 5px;
  margin: 0;
  display: none;
  z-index: 999;
}

.input-bar button {
  cursor: pointer;
  background: none;
  border: 0px;
  border-radius: 5px;
  color: var(--text-secondary);
  fill: var(--text-secondary);
  padding: 5px 5px;
  line-height: 0px;

}

.input-bar button:hover {
  color: var(--text-secondary);
  background-color: var(--hover-color);
}

.editbtns button {
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  /* transition: all 0.3s ease; */

}

.editbtns button:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
}

.copybtn::after {
  content: '复制成功!';
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-100%);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.editbtns button:active::after {
  opacity: 1;
  visibility: visible;
  animation: showHide 3s ease-in-out;
}

@keyframes showHide {
  0% {
    opacity: 0;
    visibility: visible;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

#userdoc {
  position: relative;
}



.message pre code.language-think {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border-radius: 0 0 0 0px !important;
  border-left: 2px solid #a8a8a8b7;
  /* font-family: Consolas, "Courier New", monospace; */
  font-size: 0.9rem;
  line-height: 1.5rem;
  background-color:transparent !important;
  color: var(--text-secondary);
  border-radius: 10px;
  max-height: 50vh;  
  margin: 0px 0 10px 0;   
  padding: 0px 10px;
}
.message blockquote {
  overflow-wrap: break-word;
  border-radius: 0 0 0 0px !important;
  border-left: 2px solid #a8a8a8b7;
  /* font-family: Consolas, "Courier New", monospace; */
  font-size: 0.9rem;
  line-height: 1.5rem;  
  background-color: transparent !important;
  color: var(--text-secondary);
  max-height: 80vh;  
  margin: 0px 0;   
  padding: 0px 10px;
}
.doc-container blockquote  {

  overflow-wrap: break-word;
  /* border-left: 2px solid #a8a8a8b7; */
  font-size: 0.9rem;
  line-height: 1.5rem;  
  color: var(--text-secondary);
  max-height: 30vh;  
  margin: 0px 0;   
  padding: 0px 18px;
}

.think-message p{
  margin: 0px 0px;
}
.think-message{
  background-color: var(--bg-message-bot);
  /* border-radius: 0 0 0 0px !important; */
  border-left: 2px solid #a8a8a8b7;
  margin: 0px 0 10px 0;   
  overflow-wrap: break-word;
  padding: 10px;
  font-size: 0.9rem;
  line-height: 1.5rem;
  color: var(--text-secondary);
  border-radius: 10px;  
  max-height: 50vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  width: 100%;
  text-align: start;
  white-space: normal;
}

.search-message p{
  margin: 0px 0px
}
.search-message{
  overflow-wrap: break-word;
  /* border-radius: 0 0 0 0px !important; */
  /* border-left: 2px solid #a8a8a8b7; */
  padding: 10px;
  font-size: 0.9rem;
  line-height: 1.5rem;
  color: var(--text-secondary);
  border-radius: 10px;
  max-height: 30vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* margin: 0px 10px; */
  background-color: var(--bg-message-bot);
  position: relative;
  width: 100%;
  text-align: start;
  white-space: normal;
}

.web-icon {
  width: 16px !important;
  height: 16px;
  display: inline;
}


code {
  opacity: 1;
}

code.hide {
  /* display: none !important; */
  visibility: hidden !important;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, margin 0.5s ease-in-out !important;
  opacity: 0; 
  max-height: 0px !important;
}

.think, .status ,.search {
  display: inline;
  font: 0.9em sans-serif;
  color: var(--text-tertiary);
}

.inline {
  display: inline;
}

.think.hide,.status.hide {
  display: none;
}

.think.close::before {
  content: "⚛️已深度思考 ᐯ ";
  display: inline;
  cursor: pointer;
  /* margin: -25px 0 0px 36px;   */
  font: 0.9em sans-serif;
  color: var(--text-secondary);  
}

.toolbar.hide  {
 display: none !important; 
}
.hide  {
  display: none  !important; 
 }

.think::before {
  content: "⚛️已深度思考 ᐱ ";
  display: inline;
  cursor: pointer;
  font: 0.9em sans-serif;
  color: var(--text-secondary);
}

.think.ready::before {
  content: "⚛️深度思考中...";
}

.search.close::before {
  content: "🌐已完成搜索 ᐯ ";
  display: inline;
  cursor: pointer;
  /* margin: -25px 0 0px 36px;   */
  font: 0.9em sans-serif;
  color: var(--text-secondary);  
}
.search::before {
  content: "🌐已完成搜索 ᐱ ";
  display: inline;
  cursor: pointer;
  font: 0.9em sans-serif;
  color: var(--text-secondary);
}

.search.ready::before{
  content: "🌐联网搜索中...";
}

.status::before {
  content: "生成中...";
  display: inline;
  font: 0.9em sans-serif;
  color: var(--text-secondary);
  opacity: 0.7;
}
.status.drawing::before {
  content: "创作中..." !important;
}
.status.complete::before {
  content: "已完成";
}
.status.drawed::before {
  content: "创作完成";
}
.status.error::before {
  content: "出错了";
}
.status.stop::before {
  content: "已中断";
}
.status.timeout::before {
  content: "已超时";
}
.status.ready::before {
  content: "等待响应中...";
}
.status.think::before {
  content: "深度思考中...";
}
.status.search::before {
  content: "搜索中...";
}
.status.create::before {
  content: "生成内容中...";
}

.search-use-time,
.waiting-use-time,
.think-use-time,
.chat-use-time,
.draw-use-time {
  font: 0.8em sans-serif;
  color: var(--text-secondary);
  display: inline;
  opacity:0.8;
}


/* 修改工具栏容器样式 */
.toolbar {

  padding: 5px 5px 5px 0px;
  border-width: 0px;
  border-radius: 10px;
  /* background-color: var(--bg-tertiary) !important; */
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  z-index: 999;
  margin-top: 0px ;
}

/* 用户信息区域样式 */
.user-profile {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--bg-secondary);
  /* margin-bottom: 10px; */
  position: fixed;
  width: var(--sidebar-width);
  z-index: 999;
  bottom: 0;
}

.user-profile .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 10px;
}

.user-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-profile .settings-btn {
  margin-left: auto;
}

.user-profile .settings-btn button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.user-profile .settings-btn button:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
}

/* 设置菜单样式 */


.user-profile {
  background-color: var(--bg-secondary);
}

.user-profile .settings-btn button {
  color: var(--text-secondary);
}

.user-profile .settings-btn button:hover {
  background-color: var(--hover-color);
}


.settings-menu::before {
  background-color: var(--menu-bg);
}

.settings-menu {
  position: absolute;
  bottom: 50px;
  right: 10px;
  min-width: 160px;
  background-color: var(--menu-bg);
  border-radius: 8px;
  box-shadow: 0 2px 12px var(--box-shadow-color);
  display: none;
  z-index: 1000;
  padding: 4px 0;
}

.settings-menu.show {
  display: block;
  animation: menuFadeIn 0.2s ease;
}

@keyframes menuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.settings-menu li {
  margin: 0 !important;
}

.settings-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.settings-menu li a::before {
  font-size: 16px;
}

.settings-menu li a:hover {
  background-color: var(--hover-color);
}


/* 为每个菜单项添加图标 */
.theme-toggle::before {
  content: var(--dynamic-content, "🎨");
}


.lang-toggle::before {
  content: "🌐";
}

.clear-history::before {
  content: "🗑️";
}

.settings-menu li a[href="/logout"]::before {
  content: "👋";
}

/* 修改工具栏按钮的样式 */
.toolbar button,
.toolbar_bottom button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 4px;
  white-space: nowrap;
}

.toolbar button:hover,
.toolbar_bottom button:hover {
  background-color: var(--hover-color);
  color: var(--text-primary);
}

/* 修复 SVG 图标颜色 */
.toolbar button svg,
.toolbar_bottom button svg {
  fill: none;
  stroke: currentColor;
  width: 16px;
  height: 16px;
}



.toolbar_bottom {
  /* position: absolute;
  bottom: 25px; */
  /* right: 0px; */
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
}

/* 修改时间显示样式 */
.think-use-time,
.chat-use-time,
.draw-use-time {
  font: 0.8em sans-serif;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  /* margin-right: 2px; */
}

/* 修改重试按钮样式 */
.retrybtn {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.retrybtn svg {
  fill: currentColor;
  stroke: currentColor;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.retrybtn:hover svg {
  color: var(--text-primary);
}

/* 修改编辑和删除按钮样式 */
.editbtn,
.deletebtn,
.retrybtn {
  background: none;
  border: none;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 统一按钮图标样式 */
.editbtn svg,
.deletebtn svg,
.retrybtn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* 深色模式下的按钮样式 */
:root[class='dark'] .editbtn svg,
:root[class='dark'] .deletebtn svg,
:root[class='dark'] .retrybtn svg {
  stroke: currentColor;
  fill: none;
  color: var(--text-secondary);
}

/* 浅色模式下的按钮样式 */
:root[class='light'] .editbtn svg,
:root[class='light'] .deletebtn svg,
:root[class='light'] .retrybtn svg {
  stroke: var(--text-secondary);
  fill: none;
  color: var(--text-secondary);
}

/* 按钮悬停效果 */
.editbtn:hover svg,
.deletebtn:hover svg,
.retrybtn:hover svg {
  color: var(--text-primary);
  stroke: var(--text-primary);
}

/* 工具栏按钮统一样式 */
.toolbar button svg,
.toolbar_bottom button svg,
.editbtns button svg {
  stroke: var(--text-secondary);
  fill: none;
  color: var(--text-secondary);
}

.toolbar button:hover svg,
.toolbar_bottom button:hover svg,
.editbtns button:hover svg {
  stroke: var(--text-primary);
  color: var(--text-primary);
}

/* 修改下拉菜单样式 */
select {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

/* 修改下拉菜单选项样式 */
select option {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 2px;
  padding: 0;
  margin: 0;

}

/* 修改下拉菜单选项组样式 */
select optgroup {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-style: normal;
  font-weight: bold;
  padding: 8px 2px;
  margin: 0;

}

/* 悬停效果 */
select:hover {
  background-color: var(--hover-color);
  border-color: var(--text-secondary);
}

/* 聚焦效果 */
select:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(var(--text-primary-rgb), 0.1);
}

/* 确保在深色模式下选项可见 */
:root[class='dark'] select option,
:root[class='dark'] select optgroup {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* 确保在浅色模式下选项可见 */
:root[class='light'] select option,
:root[class='light'] select optgroup {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* 为纯净模式菜单项添加图标 */
.pure-mode-toggle::before {
  content: "🔒";
}

.online-mode-toggle::before {
  content: "🌐";
}

/* 为通知模式菜单项添加图标 */
.notification-toggle::before {
  content: "🔔";
}

/* 为个性化菜单项添加图标 */
.personalization-toggle::before {
  content: "🌸";
}


/* 添加选中状态样式 */
.pure-mode-toggle.active,
.online-mode-toggle.active,
.notification-toggle.active {
  background-color: var(--active-color);
}

/* 添加选中标记 */
.pure-mode-toggle.active::after,
.online-mode-toggle.active::after,
.notification-toggle.active::after {
  content: "✓";
  margin-left: auto;
  color: var(--text-primary);
}


:root{
  --img-max-width: 360px;
  --user-img-max-width: 200px;
  --gallery-max-width: min(calc(var(--div-max-width) - 80px),1800px);  
  --img-width: min(200px,calc(var(--gallery-max-width) / 6 - var(--gap)));    
  --gap:16px;
}

@media screen and (max-width: 1920px) {
  .gallery.count-1 {
    --img-width: calc(var(--gallery-max-width) / 1);  
  }
  .gallery.count-2,.gallery.count-4 {
    --img-width: calc(var(--gallery-max-width) / 4 - var(--gap));    
  } 
}

@media screen and (max-width: 800px) {
  :root{
    --gallery-max-width: min(calc(var(--div-max-width) - 80px),800px);  
    --img-width: calc(var(--gallery-max-width) / 3 - var(--gap) - var(--gap));
    --gap:12px;
  }
  .gallery.count-1 {
    --img-width: calc(var(--gallery-max-width) / 1);  
  }
  .gallery.count-2,.gallery.count-4 {
    --img-width: calc(var(--gallery-max-width) / 2 - var(--gap));    
  } 
}
@media screen and (max-width: 320px) {
  :root{
    --img-width: calc(var(--gallery-max-width) / 2 - var(--gap));
    --gap:10px;
  }
  .gallery.count-1 {
    --img-width: calc(var(--gallery-max-width) / 1);  
  }
}

.gallery{
  max-width: var(--gallery-max-width);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--img-width), 1fr)); /* 自动适配列数 */
  gap: var(--gap); /* 图片间距 */
  /* justify-items: center; */
}

.userbox .gallery img,.gallery .img{
  max-width: var(--user-img-max-width);
}

.gallery img,.gallery .img,.gallery video {
  max-width: var(--img-max-width);
  width: 100%;     /* 宽度充满网格单元格 */
  height: auto;   /* 高度自适应 */
  object-fit: cover; /* 保持比例裁剪图片 */
  border-radius: 8px; /* 可选圆角 */
}



.gallery img {
  transition: transform 0.3s;
}
.gallery img:hover {
  transform: scale(1.03);
  cursor: zoom-in;
}

li .gallery{
  margin-left: -20px; 
}

.gallery img,.gallery video {
  position: relative;
}

.gallery img::after {
  content: "点击放大";
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery img:hover::after {
  opacity: 1;
}


.images_info em{
  font-size: xx-small;
}

.draw_toolsbar_toggle.show{
  background-color: var(--hover-color);
}
.draw_toolsbar_toggle::after{
  content: "🍄";
  color: gray; 
  filter: grayscale(100%);
}
.draw_toolsbar_toggle.show::after{
  content: "🎨";
  color: black; /* 显示时变成黑色 */
  filter: none;
}
.draw_prompt_toggle.active{
  background-color: var(--hover-color);
}
.draw_prompt_toggle::after{
  content: "";
  color: gray; 
  filter: grayscale(100%);
}
.draw_prompt_toggle.active::after{
  content: "↙️";
  color: black; /* 显示时变成黑色 */
  filter: none;
}


/* 定义骨架效果的渐变动画 */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

/* 定义加载中文字的样式 */
.loading-skeleton {
  position: relative;
  display: inline-block;
  width: 100%; /* 确保宽度适应图像 */
  background: linear-gradient(90deg, rgba(165, 165, 165, 0.1) 25%, rgba(165, 165, 165, 0.3) 50%, rgba(165, 165, 165, 0.1) 75%);
  background-size: 400px 100%;
  animation: skeleton-loading 1.5s infinite;
}
.loading-skeleton1 {
  position: relative;
  display: inline-block;
  width: 100%; /* 确保宽度适应图像 */
  background: linear-gradient(90deg, rgba(165, 165, 165, 0.1) 25%, rgba(165, 165, 165, 0.3) 50%, rgba(165, 165, 165, 0.1) 75%);
  background-size: 400px 100%;
  
}

.loading-skeleton img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px; /* 可选圆角 */
}

.loading-skeleton::before {
  content: "生成中...";
  font-size: xx-small;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.1); /* 半透明背景 */
  color: #333;
  padding: 5px 5px;
  border-radius: 5px;
  z-index: 10;
}

.md-code-block-banner-wrap {
  height: 28px;
  padding: 2px 2px;
  display: flex;
  align-items: center;
  margin-block-end:0;
  border-radius: 5px 5px 0 0;
}

.lang-label {
  font-weight: bold;
  padding: 0px 5px;
}

.doc-container .open-btn{
  display: none;
}
.message .ide-btn{
  display: none;
}

.md-code-block-banner-wrap button svg{
  color:currentColor;
  /* stroke:currentColor; */
  fill:currentColor;
}

.scroll-bottom-btn {
  position: fixed;
  right: 28px;
  bottom: 150px;
  width: 32px;
  height: 32px;
  background-color: var(--bg-tertiary);
  color: var(--text-tertiary);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
  z-index: 1000;
  opacity: 0.7;
}

.scroll-bottom-btn:hover {
  opacity: 1;
}

.scroll-bottom-btn svg {
  color:currentColor;
  /* stroke:currentColor; */
  fill:currentColor;
}


pre.hljs code {
  max-height: 50vh;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  transition: box-shadow 0.3s ease;
}

/* 当代码块被用户滚动时添加一个微妙的阴影提示 */
pre.hljs code[data-user-scrolled="true"] {
  box-shadow: inset 0 -10px 10px -10px rgba(0, 0, 0, 0.2);
}

/* 滚动条样式 */
pre.hljs code::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

pre.hljs code::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

pre.hljs code::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

pre code {
  will-change: transform; /* 告诉浏览器这个元素将会有变化 */
  transform: translateZ(0); /* 强制GPU加速 */
  backface-visibility: hidden; /* 减少重绘 */
}

/* 记忆显示界面样式 */
.memory-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.memory-table thead {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

.memory-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: bold;
  color: var(--text-primary);
  font-size: 14px;
}

.memory-table th:nth-child(1) {
  width: 60%;
}

.memory-table th:nth-child(2) {
  width: 20%;
  text-align: center;
}

.memory-table th:nth-child(3) {
  width: 20%;
  text-align: center;
}

.memory-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.memory-table tbody tr:last-child {
  border-bottom: none;
}

.memory-table tbody tr:hover {
  background-color: var(--hover-color);
}

.memory-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

/* 记忆内容单元格 */
.memory-content-cell {
  width: 60%;
}

.memory-text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  max-width: 100%;
  display: block;
}

/* 时间单元格 */
.memory-time-cell {
  width: 20%;
  text-align: center;
}

.memory-time {
  color: var(--text-secondary);
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
}

/* 操作单元格 */
.memory-actions-cell {
  width: 20%;
  text-align: center;
  white-space: nowrap;
}

/* 穿越按钮 */
.travel-btn {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.travel-btn:hover {
  background-color: var(--link-color);
  color: #ffffff;
  border-color: var(--link-color);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--box-shadow-color);
}

/* 删除记忆按钮 */
.delete-memory-btn {
  background-color: #dc3545;
  color: #ffffff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-memory-btn:hover {
  background-color: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--box-shadow-color);
}

/* 记忆区域为空时的样式 */
.memory-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 40px 20px;
  opacity: 0.7;
  font-size: 14px;
}

/* 响应式设计 */
@media only screen and (max-width: 768px) {
  .memory-row {
    padding: 8px 12px;
    margin-bottom: 6px;
  }
  
  .memory-text {
    font-size: 13px;
  }
  
  .memory-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .travel-btn {
    align-self: flex-end;
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media only screen and (max-width: 480px) {
  .memory-row {
    padding: 6px 10px;
  }
  
  .memory-text {
    font-size: 12px;
  }
  
  .memory-time {
    font-size: 11px;
  }
}
