@import "../../../../themes/page.scss";

/* module/chats/pages/consultation-record/consultation-record.wxss */

.page-scroll__container {
  box-sizing: border-box;
  overflow-y: auto;
  padding-top: 10px;
  background-color: #f5f5f5;
}

.consultation-container {
  padding: 40rpx 30rpx;
  background-color: #ffffff;
}

.consultation-session {
  margin-bottom: 60rpx;

  &:last-child {
    margin-bottom: 0;
  }
}

.timestamp {
  text-align: center;
  font-size: 24rpx;
  color: #999999;
  margin: 0rpx 0 10rpx;
}

.status-message {
  text-align: center;
  font-size: 24rpx;
  color: #999999;
  margin: 15rpx 0 15rpx 0;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 30rpx;
}

.message-item {
  display: flex;
  align-items: flex-start;
  margin: 20rpx 0 20rpx 0;

  &--agent {
    justify-content: flex-start;
  }

  &--user {
    justify-content: flex-end;
  }
}

.message-avatar {
  flex-shrink: 0;
}

.message-bubble {
  max-width: 500rpx;
  padding: 20rpx 24rpx;
  border-radius: 12rpx;
  position: relative;
  word-wrap: break-word;
  margin-left: 20rpx;

  &--agent {
    background-color: #ffffff;
    border: 1rpx solid #e5e5e5;

    // 三角形尾巴（指向左侧头像）
    &::before {
      content: "";
      position: absolute;
      left: -10rpx;
      top: 16rpx;
      width: 0;
      height: 0;
      border-top: 10rpx solid transparent;
      border-bottom: 10rpx solid transparent;
      border-right: 10rpx solid #ffffff;
      z-index: 2;
    }

    // 三角形边框
    &::after {
      content: "";
      position: absolute;
      left: -11rpx;
      top: 16rpx;
      width: 0;
      height: 0;
      border-top: 10rpx solid transparent;
      border-bottom: 10rpx solid transparent;
      border-right: 10rpx solid #e5e5e5;
      z-index: 1;
    }
  }

  &--user {
    background-color: #409eff;
    margin-right: 20rpx;
    // 三角形尾巴（指向右侧头像）
    &::before {
      content: "";
      position: absolute;
      right: -10rpx;
      top: 16rpx;
      width: 0;
      height: 0;
      border-top: 10rpx solid transparent;
      border-bottom: 10rpx solid transparent;
      border-left: 10rpx solid #409eff;
    }
  }
}

.message-text {
  font-size: 28rpx;
  color: #000000;
  line-height: 1.5;
  word-wrap: break-word;

  &--user {
    color: #ffffff;
  }
}
.message-item--system {
  width: 100%;
  align-items: center;
  justify-content: center;
  .message-bubble--system {
    width: 100%;
    text-align: center;
    .message-text--system {
      color: #999999 !important;
      font-size: 24rpx;
    }
  }
}
.message-image {
  width: 200rpx;
  height: 200rpx;
  background: transparent !important;
  display: block;
  border-radius: 8rpx;
}
