.ai-chat-container
  height 100%
  display flex
  flex-direction column

.ai-chat-history
  flex-grow 1
  min-height 0
  &::-webkit-scrollbar
    width 0
.ai-history-wrap
  width 100%
  overflow-y auto
  overflow-x hidden

.chat-history-item
  position relative
  > .ai-stop-icon-square
    position absolute
    bottom 8px
    right 8px
    z-index 10
  .code-block
    border 1px dashed var(--main-darker)
    padding 5px
    border-radius 3px
    pre
      margin-bottom 0
    // .code-block-actions
    //   display block
    // &:hover
    //   .code-block-actions
    //     display block

.ai-stream-output
  max-height 400px
  overflow-y auto

.ai-chat-input
  position relative
  margin-top 10px

  .ant-input
    padding-bottom 40px

  .ai-chat-terminals
    position absolute
    bottom 5px
    left 5px
    right 5px
    background transparent
    z-index 1
    font-size 16px

.code-block
  width 100%
  pre
    white-space pre-wrap
    word-wrap break-word
    overflow-x auto
    max-width 100%
  code
    white-space pre-wrap
    word-break break-all

.send-to-ai-icon.disabled
  opacity 0.4
  cursor not-allowed

.clear-ai-icon
  position relative
  &::after
    content '×'
    position absolute
    font-size 12px
    top 8px
    right -4px
    font-weight bold

.ai-stop-icon-square
  width 20px
  height 20px
  border-radius 2px
  display flex
  align-items center
  justify-content center
  font-size 10px

.ai-history-item-title
  display flex
  align-items center
  .ai-stop-icon-square
    margin-left auto

.agent-tool-calls
  margin 8px 0

.agent-tool-call-card
  border 1px solid var(--main-darker)
  border-radius 4px
  margin-bottom 6px
  font-size 13px

.agent-tool-header
  display flex
  align-items center
  padding 6px 8px
  gap 6px

.agent-tool-name
  font-weight 500

.agent-tool-tag
  margin-left auto

.agent-tool-status-running
  color #1890ff
  animation spin 1s linear infinite

.agent-tool-status-completed
  color #52c41a

.agent-tool-status-error
  color #ff4d4f

.agent-tool-detail
  padding 0 8px 8px
  border-top 1px solid var(--main-darker)

.agent-tool-args
  margin-top 6px

.agent-tool-result
  margin-top 6px

.agent-tool-label
  font-weight 500
  margin-bottom 4px
  font-size 12px
  color var(--text-color-2)

.agent-tool-pre
  background var(--main-dark)
  padding 6px 8px
  border-radius 3px
  font-size 12px
  max-height 200px
  overflow-y auto
  white-space pre-wrap
  word-break break-all
  margin-bottom 0

.agent-tool-running
  border-color #1890ff

.agent-tool-completed
  border-color #52c41a

.agent-tool-error
  border-color #ff4d4f

@keyframes spin
  from
    transform rotate(0deg)
  to
    transform rotate(360deg)
