@import "../../../../themes/t.cell.scss";
@import "../../common.scss";

.consult-wrapper {
  padding-bottom: 180rpx;

  &.consult-ended {
    padding-bottom: 0;
  }
}

.message-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-size: 28rpx;
  color: #333;

  .markdown-content {
    width: 100%;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    line-height: 1.5;
    font-size: 28rpx;
    display: block;

    strong,
    b {
      display: inline !important;
      font-weight: bold !important;
      white-space: normal !important;
      margin: 0 !important;
      padding: 0 !important;
      line-height: inherit !important;
      vertical-align: baseline;
    }

    em,
    i {
      display: inline !important;
      font-style: italic !important;
      white-space: normal !important;
      margin: 0 !important;
      padding: 0 !important;
      line-height: inherit !important;
      vertical-align: baseline;
    }

    // 代码块样式
    pre {
      background-color: #f5f5f5;
      padding: 16rpx;
      border-radius: 8rpx;
      overflow-x: auto;
      margin: 16rpx 0;
      display: block;
    }

    code {
      background-color: #f5f5f5;
      padding: 4rpx 8rpx;
      border-radius: 4rpx;
      font-family: "Courier New", monospace;
      font-size: 24rpx;
      display: inline;
    }

    pre code {
      background-color: transparent;
      padding: 0;
      display: block;
    }

    ul,
    ol {
      margin: 16rpx 0;
      padding-left: 40rpx;
      display: block;
    }

    li {
      margin: 8rpx 0;
      list-style-type: disc;
      display: list-item;

      strong,
      b {
        display: inline !important;
      }
    }

    p {
      margin: 8rpx 0;
      display: block;
      line-height: 1.5;

      strong,
      b {
        display: inline !important;
      }

      &:has(strong),
      &:has(b) {
        strong,
        b {
          display: inline !important;
          white-space: normal !important;
        }
      }
    }

    br {
      line-height: 1.5;
    }

    span {
      display: inline !important;
      white-space: normal !important;
    }
  }
}

.message-image {
  width: 200rpx;
  height: 200rpx;
  border-radius: 16rpx;
  display: block;
}

.input-panel {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16rpx 24rpx;
  box-sizing: border-box;
  z-index: 10;
  transition: bottom 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: bottom;
}
.chat-card {
  --avatar-size: 42px;

  .image-message,
  .text-message {
    max-width: calc(90% - var(--avatar-size)) !important;
    border-radius: 0px 10px 10px 10px !important;
    background-color: white;
    overflow: hidden;
  }

  &.right {
    .image-message,
    .text-message {
      border-radius: 10px 0px 10px 10px !important;
    }
  }
}
.action-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12rpx;
  gap: 24rpx;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 24rpx;
  height: 80rpx;
  line-height: 80rpx;
  border-radius: 12rpx;
  font-size: 30rpx;
}

.action-btn.secondary {
  color: black;
}

.action-btn.danger {
  color: #1d6ff6;
}

.action-text {
  margin-left: 8rpx;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 16rpx;
}

.text-input {
  flex: 1;
  width: 60% !important;
  min-height: 80rpx;
  max-height: 200rpx;
  padding: 12rpx 20rpx;
  background: #ffffff;
  border-radius: 12rpx;
  border: 1rpx solid #e6e6e6;
  color: #333333;
  font-size: 28rpx;
  line-height: 1.9;
  box-sizing: border-box;
  overflow-y: scroll !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: height 0.2s ease-out;
  word-wrap: break-word;
  word-break: break-all;
  scroll-behavior: smooth;
}

.send-btn {
  padding: 0 24rpx;
  height: 80rpx;
  line-height: 80rpx;
  background: #1d6ff6;
  color: #ffffff;
  border-radius: 12rpx;
  font-size: 28rpx;
  flex-shrink: 0;
}

.media-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 8rpx;
  padding: 0 20rpx;
  flex-shrink: 0;
  height: 80rpx;
  margin: 0 5rpx;
}

.media-text {
  color: #1d6ff6;
  font-size: 24rpx;
  margin-top: 2rpx;
}

/* 系统消息样式 */
.system-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 6px 0;

  .title {
    padding: 4px 12px;
    font-size: 12px;
    color: #999999;
    border-radius: 5px;
  }

  .date {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
  }
}
.chat-box {
  padding: 15rpx 0 15rpx 30rpx !important;
}
