/* pages/chat/chat.wxss */
page {
  background-color: #f0f0f0;
}

@keyframes rotation {
  from {
    -webkit-transform: rotate(0deg);
  }

  to {
    -webkit-transform: rotate(360deg);
  }
}

.content {
  padding: 50rpx 50rpx;
  padding-bottom: 240rpx;

  .chatItem {
    margin-bottom: 40rpx;

    .chatContent {
      position: relative;

      &.left {
        text-align: left;
      }

      &.right {
        text-align: right;
      }

      .chatGpt {
        position: absolute;
        top: 0;
        left: -25rpx;
        height: 80rpx;
        border-radius: 50% 50%;

        &.isResponing {
          animation: rotation 2s linear infinite;
        }
      }

      .textShape {
        transition: all 0.2s;

        &.istouching {
          opacity: 0.65;
        }

        .arrowWhite {
          position: absolute;
          left: 50rpx;
          height: 80rpx;
          z-index: 0;
        }

        .arrowGreen {
          position: absolute;
          transform: rotate(180deg);
          top: -12rpx;
          right: 53rpx;
          height: 80rpx;
          z-index: 0;
        }

        .message {
          position: relative;
          display: inline-block;
          max-width: 450rpx;
          text-align: left;
          z-index: 1;

          &.left {
            left: 80rpx;
            color: #000000;
            background-color: #ffffff;
            padding: 20rpx;
            border-radius: 20rpx;
          }

          &.right {
            right: 80rpx;
            color: #ffffff;
            background-color: #07c160;
            padding: 20rpx;
            border-radius: 20rpx;
          }

          .copyBoxLeft {
            position: absolute;
            top: 10rpx;
            right: 10rpx;
            z-index: -1;
            opacity: 0;
            transition: all 0.3s;

            &.active {
              right: -120rpx;
              opacity: 1;
              z-index: 1;
            }

            .boxInside {
              position: relative;
              width: 80rpx;
              height: 40rpx;
              color: #ffffff;
              background-color: #333333;
              text-align: center;
              padding: 8rpx;
              border-radius: 15rpx;
              z-index: 1;

              .text {
                z-index: 1;
              }

              .arrowBlack {
                position: absolute;
                top: -5rpx;
                left: 25rpx;
                height: 70rpx;
                transform: translateX(-50%);
                z-index: -1;
              }
            }
          }

          .copyBoxRight {
            position: absolute;
            top: 10rpx;
            left: 10rpx;
            z-index: -1;
            opacity: 0;
            transition: all 0.3s;

            &.active {
              left: -120rpx;
              opacity: 1;
              z-index: 1;
            }

            .boxInside {
              position: relative;
              width: 80rpx;
              height: 40rpx;
              color: #ffffff;
              background-color: #333333;
              text-align: center;
              padding: 8rpx;
              border-radius: 15rpx;
              z-index: 1;

              .text {
                z-index: 1;
              }

              .arrowBlack {
                position: absolute;
                top: -15rpx;
                right: -65rpx;
                height: 70rpx;
                transform: translateX(-50%) rotate(180deg);
                z-index: -1;
              }
            }
          }
        }

        .loading {
          position: absolute;
          left: -60rpx;
          height: 40rpx;
          animation: rotation 2s linear infinite;
        }
      }

      .userAvatar {
        position: absolute;
        top: 0;
        right: -25rpx;
        height: 80rpx;
        border-radius: 50% 50%;
      }
    }
  }

  .over {
    width: 170rpx;
    font-size: 23rpx;
    border-radius: 12rpx;
    background-color: #0000001c;
    padding: 10rpx 0;
    text-align: center;
    margin: 0 auto;
  }
}

.chatBox {
  position: fixed;
  width: 100%;
  height: 150rpx;
  bottom: 0;
  padding-left: 40rpx;
  padding-top: 30rpx;
  background-color: #f5f5f5;
  z-index: 10;

  .boxOutside {
    margin-bottom: 20rpx;

    .voiceBtn {
      height: 70rpx;
      margin-right: 20rpx;
    }

    .pushBtn {
      display: inline-block;
      width: 530rpx;
      height: 70rpx;
      line-height: 60rpx;
      padding: 5rpx 0;
      margin-left: 35rpx;
    }

    .inputBox {
      display: inline-block;
      width: 410rpx;
      height: 70rpx;
      line-height: 70rpx;
      border-radius: 10rpx;
      margin-right: 15rpx;
      padding-left: 30rpx;
      background-color: #ffffff;
    }

    .sendBtn {
      display: inline-block;
      width: 150rpx;
      height: 70rpx;
      line-height: 60rpx;
      padding: 5rpx 0;
    }
  }
}