.row {
  display: flex;
  width: 100%;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.rowUser {
  justify-content: flex-end;
  padding-left: 88px;
}

.rowAi {
  justify-content: flex-start;
}

.userBubble {
  background: #6f81fb;
  border-radius: 24px 24px 0 24px;
  padding: 16px 24px;
  max-width: 100%;
}

.aiContent {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.text {
  font-size: 32px;
  line-height: 48px;
  color: #020202;
  margin: 0;
  word-break: break-word;

  .userBubble & {
    color: #fff;
    line-height: 44px;
  }
}

// 正在思考中
.thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 28px;
  line-height: 40px;
  color: #6f81fb;
  min-height: 56px;
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 3px solid rgba(111, 129, 251, 0.2);
  border-top-color: #6f81fb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.cursor {
  display: inline-block;
  width: 4px;
  height: 32px;
  background: #6f81fb;
  border-radius: 2px;
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

// 已停止生成提示
.stoppedHint {
  display: inline-block;
  font-size: 24px;
  line-height: 36px;
  color: #999;
  margin-top: 8px;
}

// 推荐问题列表
.suggestions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.suggestionItem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 16px 32px;
  max-width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.7;
  }
}

.suggestionText {
  flex: none;
  font-family: 'PingFang SC', sans-serif;
  font-size: 28px;
  color: #303540;
  line-height: 40px;
  word-break: break-word;
}

.suggestionArrow {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-90deg);
  color: #999;
  font-size: 28px;
  line-height: 1;
}

// 免责声明
.disclaimer {
  font-size: 24px;
  line-height: 48px;
  color: #8c8d91;
  margin: 0;
}

// 消息操作按钮行
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.actionBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 12px;
  background: #eaedf6;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.7;
  }
}

.actionBtnActive {
  background: #d4d9ee;
}

// 数据来源
.paraSources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paraLabel {
  font-size: 24px;
  line-height: 36px;
  color: #8c8d91;
}

.paraList {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.paraItem {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 26px;
  color: #303540;
  line-height: 36px;
  word-break: break-word;
}

.paraItemLink {
  color: #6f81fb;
  cursor: pointer;
}

.markdown {
  > *:first-child {
    margin-top: 0;
  }

  > *:last-child {
    margin-bottom: 0;
  }

  p {
    margin: 12px 0;
    line-height: 48px;
  }

  h1, h2, h3, h4, h5, h6 {
    margin: 20px 0 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #020202;
  }

  h1 { font-size: 44px; }
  h2 { font-size: 40px; }
  h3 { font-size: 36px; }
  h4 { font-size: 34px; }
  h5 { font-size: 32px; }
  h6 { font-size: 30px; }

  ul, ol {
    margin: 12px 0;
    padding-left: 40px;
  }

  li {
    margin: 8px 0;
    line-height: 44px;
  }

  blockquote {
    margin: 16px 0;
    padding: 8px 24px;
    border-left: 6px solid #6f81fb;
    background: rgba(111, 129, 251, 0.06);
    border-radius: 0 8px 8px 0;
    color: #555;

    p {
      margin: 8px 0;
    }
  }

  code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 28px;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 6px;
    color: #d63384;
    word-break: break-word;
  }

  pre {
    margin: 16px 0;
    padding: 20px 24px;
    background: #1e1e2e;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    code {
      display: block;
      background: none;
      padding: 0;
      color: #cdd6f4;
      font-size: 26px;
      line-height: 40px;
      border-radius: 0;
      white-space: pre;
      word-break: normal;
    }
  }

  table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    font-size: 28px;
    overflow-x: auto;
    display: block;
  }

  th, td {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    text-align: left;
    line-height: 40px;
    white-space: nowrap;
  }

  th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
  }

  hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
  }

  a {
    color: #6f81fb;
    text-decoration: none;
    word-break: break-all;

    &:active {
      opacity: 0.7;
    }
  }

  img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
  }

  strong {
    font-weight: 600;
  }
}
