.chat_container_linear_gradient {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx),
    linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx),
    linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
  background-repeat: no-repeat;
}
.chat_messages_body {
  position: relative;
  z-index: 100;
  .login_btn {
    padding: 0 50rpx;
  }
}
.chat-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100vw;
  // background-color: #f5f5f5;
}

.chat-messages {
  width: 100%;
  padding: 0 30rpx;
  padding-top: 314rpx;
  padding-bottom: calc(260rpx + env(safe-area-inset-bottom));
  box-sizing: border-box;
  flex: 1;
}
.chat-messages-chat {
  padding-bottom: calc(160rpx + env(safe-area-inset-bottom));
}
.chat-messages-update-top{
  padding-top: 30rpx;
}

.message-item {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 30rpx;
  animation: fadeIn 0.3s ease-in;
}
.ai-message {
  align-items: flex-start;

  .message-content-wrapper {
    align-items: flex-start;
  }

  .message-content {
    background-color: #fff;
    color: #333;
    margin-left: 12rpx;
    margin-right: 0;
    flex-shrink: 0;
  }

  .message-time {
    color: #999;
    font-size: 22rpx;
    min-width: 80rpx;
  }

  .message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 6rpx;
    gap: 8rpx;
    margin-left: 12rpx;
    flex-direction: row;
  }

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

.user-message {
  justify-content: flex-end;
  align-items: flex-start;

  .message-content-wrapper {
    align-items: flex-end;
  }

  .message-content {
    background-color: #1c64f2;
    color: #fff;
    margin-right: 0;
    flex-shrink: 0;

    // 用户消息中的图片显示优化
    .message-images {
      margin-bottom: 20rpx;

      .message-image-item {
        border-radius: 8rpx;
      }
    }
  }

  .message-time {
    color: #999;
    font-size: 22rpx;
    margin-top: 6rpx;
    text-align: right;
    min-width: 80rpx;
  }

  .message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 6rpx;
    gap: 8rpx;
    flex-direction: row;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10rpx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;

  image {
    width: 100%;
    height: 100%;
  }

  .user-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .user-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24rpx;
    font-weight: 500;
  }
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 100rpx);
}

.message-content {
  padding: 20rpx 24rpx;
  border-radius: 16rpx;
  font-size: 28rpx;
  line-height: 1.5;
  word-wrap: break-word;
  word-break: break-all;
  box-sizing: border-box;
  background-color: #1c64f2;
  &.loading {
    opacity: 0.7;
  }

  // 纯图片消息的样式优化
  &:has(.message-images) {
    padding: 12rpx;

    .user-message & {
      padding: 8rpx;
    }
  }

  view {
    display: block;
    word-wrap: break-word;
    word-break: break-all;

    &:not(:last-child) {
      margin-bottom: 8rpx;
    }
  }

  text {
    display: inline;
    word-wrap: break-word;
    word-break: break-all;
  }
}

.quick-questions {
  margin-top: 16rpx;
  display: flex;
  flex-direction: column;
  gap: 12rpx;
  padding-left: 12rpx;
}

.question-btn {
  background-color: #f0f7ff;
  border: 1px solid #d0e3ff;
  border-radius: 12rpx;
  padding: 16rpx 20rpx;
  font-size: 26rpx;
  color: #1c64f2;
  line-height: 1.4;
  transition: all 0.2s ease;

  &:active {
    background-color: #e6f2ff;
    transform: scale(0.98);
  }

  text {
    display: block;
    word-wrap: break-word;
    word-break: break-all;
  }
}



.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  border-top: 1px solid #f8f8f8;
  padding: 20rpx 20rpx;
  padding-bottom: calc(155rpx + env(safe-area-inset-bottom));
  z-index: 100;
}
.chat-input-area-chat {
  padding-bottom: calc(30rpx + env(safe-area-inset-bottom));
}

.input-container {
  display: flex;
  align-items: center;
  background-color: #f7f7f7;
  border-radius: 50rpx;
  padding: 10rpx 20rpx;
}

.message-input {
  flex: 1;
  height: 70rpx;
  font-size: 28rpx;
  padding: 0 20rpx;
  background-color: transparent;
}

.send-button {
  width: 70rpx;
  height: 70rpx;
  background: linear-gradient(135deg, #1c64f2 0%, #0e4aa7 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 20rpx;

  &.disabled {
    opacity: 0.5;
    pointer-events: none;
  }
}

.upload-button {
  width: 70rpx;
  height: 70rpx;
  background-color: #f7f7f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 20rpx;
}

.image-preview-area {
  margin-bottom: 20rpx;
}

// 快捷按钮栏样式
.quick-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16rpx;
  padding: 0 0 16rpx 0;
}

.quick-action-btn {
  height: 60rpx;
  padding: 0 24rpx;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 100rpx;
  font-size: 23rpx;
  color: #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  white-space: nowrap;

  &:active {
    transform: scale(0.98);
    background-color: #f8f8f8;
  }

  text {
    display: block;
  }
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16rpx;
}

.image-preview-item {
  position: relative;
  width: 120rpx;
  height: 120rpx;
  border-radius: 12rpx;
  overflow: hidden;

  &.add-more-button {
    background-color: #f5f5f5;
    border: 2rpx dashed #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    &:active {
      background-color: #e8e8e8;
    }
  }
}

.preview-image {
  width: 100%;
  height: 100%;
}

.add-more-text {
  font-size: 22rpx;
  color: #999;
  margin-top: 8rpx;
}

.remove-image {
  position: absolute;
  top: 8rpx;
  right: 8rpx;
  width: 40rpx;
  height: 40rpx;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12rpx;
  margin-bottom: 12rpx;
  max-width: 500rpx;

  // 用户消息中的图片样式优化
  .user-message & {
    margin-bottom: 0;
  }
}

.message-image-item {
  border-radius: 12rpx;
  overflow: hidden;

  &.single-image {
    max-width: 500rpx;
    width: 500rpx !important;
    height: auto !important;

    // 用户消息单张图片的样式
    .user-message & {
      max-width: 450rpx;
      width: 450rpx !important;
    }
  }

  &:not(.single-image) {
    width: 200rpx;
    height: 200rpx;
  }
}

.message-image {
  width: 100%;
  height: 100%;
  display: block;
}

.message-text-line {
  margin-bottom: 4rpx;

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

.copy-button {
  width: 32rpx;
  height: 32rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4rpx;
  transition: background-color 0.2s ease;

  &:active {
    background-color: rgba(0, 0, 0, 0.05);
  }

  .copy-icon {
    width: 26rpx;
    height: 26rpx;
    opacity: 0.7;
  }
}

.opening_remarks {
  padding: 30rpx 30rpx 10rpx 30rpx;
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background:
    linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, rgba(255, 255, 255, 0) 300rpx),
    linear-gradient(159deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 150rpx),
    linear-gradient(188deg, #dffff3 -8%, #f7f7f7 300rpx);
  background-repeat: no-repeat;

  .opening_remarks_body {
    height: 254rpx;
    border-radius: 20rpx;
    border: 1px solid #ffffff;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      linear-gradient(58deg, #e3faff 1%, rgba(255, 255, 255, 0) 24%),
      linear-gradient(221deg, #dbe3ff 0%, rgba(255, 255, 255, 0) 19%), rgba(255, 255, 255, 0.5);
    .opening_remarks_server_img {
      width: 56rpx;
      height: 224rpx;
      margin: 0 40rpx;
      image {
        width: 56rpx;
        height: 224rpx;
      }
    }
    .opening_remarks_server_info {
      flex: 1;
      padding-right: 30rpx;
    }
    .label {
      font-size: 28rpx;
      color: #333;
      overflow: hidden;
      white-space: nowrap;
      width: 0;
      display: inline-block;
      animation:
        typing 3s steps(30, end) forwards,
        blink 0.75s step-end infinite;
    }
    .group_btn {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      overflow: hidden;
      height: 160rpx;
      &_item {
        background-color: #fff;
        border-radius: 100rpx;
        font-size: 24rpx;
        color: #333333;
        padding: 15rpx 25rpx;
        margin-top: 15rpx;
        margin-right: 30rpx;
        &:nth-child(3n) {
          margin-right: 0;
        }
      }
    }
  }
}

// 开场白隐藏动画
.hide-opening-remarks {
  animation: slideUpFadeOut 1s forwards,
}

@keyframes slideUpFadeOut {
   from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}


.message-content .quick-questions-actions{
  width:auto;
  padding:20rpx 0 10rpx 0;
  display: flex;
  align-items: center;
}

.query-go-to-btn {
  background-color: #1c64f2;
  color: #fff;
  border-color: #1c64f2;
  text-align: center;
  width:100%;
  margin-right: 30rpx;
  &:last-child{
    margin-right: 0;
    margin-bottom: 0rpx;
  }
}



.message-content .confirmation-buttons {
  margin-top: 16rpx;
  display: flex;
  align-items: center;
}

.message-content .confirmation-btn {
  width: 100%;
  border-radius: 10rpx;
  padding: 14rpx 20rpx;
  font-size: 24rpx;
  line-height: 1.4;
  text-align: center;
  transition: all 0.2s ease;
  background-color: #fff;
  color: #000;
  border: 1px solid #e5e5e5;
  margin-bottom: 0 !important;
  margin-right: 30rpx;
  &:active:not(.disabled) {
    transform: scale(0.98);
  }

  &.selected {
    background-color: #1c64f2;
    color: #fff;
    border-color: #1c64f2;
  }

  &.disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  text {
    display: block;
    font-weight: 500;
  }
  &:last-child {
    margin-right: 0 !important;
  }
}

