* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(
    180deg,
    #fff5f0 0%,
    #f5f5f5 62%,
    #f5f5f5 100%
  );
  min-height: 100vh;
  color: #333;
  overflow-x: hidden;
  /* CSS 变量：输入区域实际高度，用于动态计算对话区域高度 */
  --input-area-height: 70px;
  --input-area-height-pc: 80px;
}

/* ========== 移动端优先样式 (≤768px) ========== */

/* 顶部导航栏 */


.navbar .back-btn {
  position: absolute;
  left: 20px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.navbar .title {
  font-size: 18px;
  font-weight: 500;
  color: #333;
}

/* 欢迎区域 */
.welcome-section {
  position: relative;
  height: auto;
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-text h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #ff6600 0%, #cb0000 70%, #cb0000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-text h2 {
  font-size: 16px;
  font-weight: 500;
  background: linear-gradient(90deg, #ff6600 0%, #cb0000 16%, #2a0000 28%, #2a0000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 120px;
  height: 104px;
}

/* 功能说明卡片 */
.feature-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.feature-card .features {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.6;
}

/* 对话区域 */
.dialogue-container {
  display: none;
}

.dialogue-container.active {
  display: block;
}

.dialogue-box {
  /* 动态计算高度：视口高度 - 输入区域高度 - 其他固定偏移（导航栏 + 间距等约 110px） */
  max-height: calc(100vh - var(--input-area-height) - 110px);
  min-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  transition: max-height 0.3s ease;
}

.dialog-item {
  margin-bottom: 20px;
}

.dialog-item.user {
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

.dialog-item.user .dialog-bubble {
  background: #ff6600;
  border-radius: 12px 12px 0 12px;
  width: auto;
  padding: 12px 16px;
  margin: 8px 0 8px auto;
  max-width: 80%;
  font-size: 15px;
  line-height: 1.5;
  color: #ffffff;
  word-wrap: break-word;
  white-space: normal;
  display: flex;
  align-items: center;
  text-align: left;
}

.dialog-item.user .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.aiContent {
  display: flex;
  justify-content: flex-start;
}

.dialog-item.ai .avatar {
  width: 40px;
  height: 40px;
  margin-right: 8px;
  flex-shrink: 0;
}

.dialog-item.ai .avatar-name {
  font-size: 14px;
  color: #666;
}

.dialog-item.ai .dialog-bubble {
  background: #fff;
  border-radius: 12px 12px 12px 0;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 15px;
  line-height: 1.6;
  max-width: 90%;
}

/* 底部输入框 - 移动端 */
.input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 60px;
  width: 100%;
  padding: 10px 0;
  z-index: 1000;
  transition: min-height 0.3s ease;
}

/* 有图片预览时缩小输入区域 */
.input-area.has-images {
  min-height: 50px;
  padding: 6px 0;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  width: calc(100% - 32px);
  max-width: 800px;
  min-height: 42px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 24px;
  border: 2px solid #333333;
  padding: 0 44px;
  transition: min-height 0.3s ease;
}

.input-wrapper .image-btn {
  position: absolute;
  left: 12px;
  bottom: 14px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.input-wrapper textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #333333;
  width: 100%;
  resize: none;
  max-height: 150px;
  min-height: 24px;
  line-height: 1.5;
  padding: 12px 0;
}

.input-wrapper .send-btn {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 24px;
  height: 24px;
  background-color: #ff6600;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.input-wrapper .send-btn img {
  width: 100%;
  height: 100%;
}

.input-wrapper .send-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #ccc;
}

.input-wrapper .image-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-wrapper textarea.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 图片预览 */
.image-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: zoom-out;
}

.image-preview.active {
  display: flex;
}

.image-preview img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
}

/* 图片上传预览 */
.image-upload-preview {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  padding: 8px 16px;
  max-height: 100px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.image-upload-preview .preview-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-upload-preview .preview-container {
  position: relative;
  flex-shrink: 0;
}

.image-upload-preview .preview-container img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
}

.image-upload-preview .remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff4444;
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 用户消息中的图片 */
.dialog-item.user .message-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 8px;
  cursor: pointer;
  object-fit: cover;
}

.dialog-item.user .message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;

}

.dialog-item.user .text-content {
  margin-bottom: 8px;
  background: #FF6600;
  border-radius: 10px 10px 0 10px;
  padding: 10px;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.dialog-item.user .image-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}



/* 顶部导航栏 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6vw 2.267vw;
  background: transparent;
  position: relative;
}

.navbar .back-btn {
  position: absolute;
  left: 2.13vw;
  width: 8vw;
  height: 8vw;
  cursor: pointer;
}

.navbar .title {
  font-size: 4.267vw;
  font-weight: 500;
  color: #333;
}

/* 主要内容区 */
.main-content {
  padding: 2.67vw 0;
  width: 91.47vw;
  margin: 0 auto;
}

/* 欢迎区域 */
.welcome-section {
  position: relative;
  height: 28.267vw;
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-text h1 {
  font-size: 10.67vw;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(
    90deg,
    #ff6600 0%,
    #cb0000 70%,
    #cb0000 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-text h2 {
  font-size: 5.33vw;
  font-weight: 500;
  background: linear-gradient(
    90deg,
    #ff6600 0%,
    #cb0000 16%,
    #2a0000 28%,
    #2a0000 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mascot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 32.4vw;
  height: 28.267vw;
}

/* 功能说明卡片 */
.feature-card {
  background: #fff;
  border-radius: 2.67vw;
  padding: 2.267vw 2.67vw;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.feature-card .features {
  font-size: 4.267vw;
  font-weight: 500;
  color: #333;
  text-align: center;
}

/* 对话区域 */
.dialogue-container {
  display: none;
}

.dialogue-container.active {
  display: block;
}

.dialogue-box {
  /* max-height: 60vh; */
  overflow-y: auto;
  margin-bottom: 16px;
}

.dialog-item {
  margin-bottom: 20px;
}

.dialog-item.user {
  display: flex;
  justify-content: flex-end;
  text-align: left;
}

.dialog-item.user .dialog-bubble {
  background: #ff6600;
  border-radius: 12px 12px 0 12px;
  width: auto;
  padding: 2.67vw;
  margin: 2vw 2.67vw 2vw auto;
  font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
  font-weight: 400;
  font-size: 4vw;
  color: #ffffff;
  font-style: normal;
  text-transform: none;
  word-wrap: break-word;
  white-space: normal;
  display: flex;
  align-items: center;
  text-align: left;
}
.dialog-item.user .user-avatar {
  width: 12vw;
  height: 12vw;
  border-radius: 50%;
}
.aiContent {
  display: flex;
  justify-content: flex-start;
}

.dialog-item.ai .avatar {
  width: 12vw;
  height: 12vw;
  margin-right: 8px;
  flex-shrink: 0;
}

.dialog-item.ai .avatar-name {
  font-size: 14px;
  color: #666;
}

.dialog-item.ai .dialog-bubble {
  background: #fff;
  border-radius: 12px 12px 12px 0;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 15px;
  line-height: 1.6;
}

.dialog-item.ai .dialog-bubble .content_text1,
.dialog-item.ai .dialog-bubble .content_text2 {
  margin-bottom: 12px;
}

.dialog-item.ai .reference-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.dialog-item.ai .reference-box .reference-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

.dialog-item.ai .reference-box .reference-item {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.dialog-item.ai .image-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.dialog-item.ai .image-box .image-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

.dialog-item.ai .image-box img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 8px;
  cursor: pointer;
}

/* 思考过程样式 */
.dialog-item.ai .thinking-box {
  background-color: #f9fafc;
  border-left: 3px solid #a0a4ab;
  padding: 12px 16px;
  margin: 0 0 15px 0;
  border-radius: 6px;
  font-size: 0.85em;
  color: #999999;
  line-height: 1.6;
  white-space: pre-line;
}

.dialog-item.ai .thinking-box .thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}

.dialog-item.ai .thinking-box .thinking-label {
  font-size: 1.176em;
  font-weight: 500;
  color: #8a8f99;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dialog-item.ai .thinking-box .toggle-btn {
  font-size: 1em;
  color: #8a8f99;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.dialog-item.ai .thinking-box .toggle-btn:hover {
  background-color: #e8eaed;
}

.dialog-item.ai .thinking-box .toggle-btn .arrow {
  font-size: 0.8em;
}

.dialog-item.ai .thinking-box .thinking-content {
  color: #999999;
  font-size: 0.85em;
  line-height: 1.6;
  white-space: pre-line;
}

.dialog-item.ai .rusult-content {
  color: #333;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
}

/* 复制按钮样式 */
.dialog-item.ai .copy-btn-wrapper {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
}

.dialog-item.ai .copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s;
}

.dialog-item.ai .copy-btn:hover {
  background: #e8eaed;
  border-color: #d0d0d0;
}

.dialog-item.ai .copy-btn svg {
  width: 16px;
  height: 16px;
}

/* Toast 提示样式 */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* 加载动画 */
.loading-box {
  display: none;
  align-items: center;
  margin-bottom: 20px;
}

.loading-box.active {
  display: flex;
}

.loading-box .avatar-row {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.loading-box .avatar {
  width: 32px;
  height: 32px;
}

.loading-box .avatar-name {
  font-size: 14px;
  color: #666;
  margin-left: 8px;
}

.loading-box .loading-img {
  width: 24px;
  height: 24px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Markdown 样式 */
.dialog-bubble .content_text1,
.dialog-bubble .content_text2 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dialog-bubble :deep(pre) {
  background: #f6f8fa;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  max-width: 100%;
}

.dialog-bubble :deep(code) {
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  word-break: break-word;
}

.dialog-bubble :deep(pre code) {
  background: transparent;
  padding: 0;
}

.dialog-bubble :deep(p) {
  margin-bottom: 8px;
}

.dialog-bubble :deep(ul),
.dialog-bubble :deep(ol) {
  margin: 8px 0;
  padding-left: 20px;
}

.dialog-bubble :deep(table) {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  overflow-x: auto;
  display: block;
}

.dialog-bubble :deep(th),
.dialog-bubble :deep(td) {
  border: 1px solid #ddd;
  padding: 8px;
  word-break: break-word;
}

.dialog-bubble :deep(th) {
  background: #f6f8fa;
}

/* PC 端 Markdown 样式优化 */
@media (min-width: 769px) {
  .dialog-bubble :deep(pre) {
    padding: 16px;
  }

  .dialog-bubble :deep(table) {
    display: table;
  }
}

/* 隐藏类 */
.hide {
  display: none !important;
}
 /* ========== PC 端适配 - 屏幕宽度大于 768px 时 ========== */
 @media (min-width: 769px) {
  body {
    background: linear-gradient(180deg, #fff5f0 0%, #f5f5f5 100%);
  }

  .navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
  }

  .navbar .back-btn {
    width: 40px;
    height: 40px;
    left: 0;
  }

  .navbar .title {
    font-size: 24px;
  }

  .main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
  }

  .welcome-section {
    height: auto;
    max-height: 400px;
  }

  .welcome-text h1 {
    font-size: 48px;
  }

  .welcome-text h2 {
    font-size: 24px;
  }

  .mascot {
    width: 180px;
    height: 160px;
    position: relative;
    right: auto;
    bottom: auto;
  }

  .feature-card {
    padding: 15px 20px;
    margin-bottom: 20px;
  }

  .feature-card .features {
    font-size: 18px;
  }

  .dialogue-box {
    /* 动态计算高度：视口高度 - 输入区域高度 - 其他固定偏移（导航栏 + 间距等约 120px） */
    max-height: calc(100vh - var(--input-area-height-pc) - 120px);
    min-height: 300px;
    transition: max-height 0.3s ease;
  }

  .dialog-item.user .dialog-bubble {
    padding: 16px 20px;
    margin: 12px 0 12px auto;
    max-width: 70%;
    font-size: 16px;
  }

  .dialog-item.user .user-avatar {
    width: 48px;
    height: 48px;
  }

  .dialog-item.ai .avatar {
    width: 48px;
    height: 48px;
  }

  .dialog-item.ai .dialog-bubble {
    padding: 16px 20px;
    max-width: 90%;
    font-size: 16px;
  }

  .input-area {
    min-height: 70px;
    padding: 12px 0;
    transition: min-height 0.3s ease;
  }
  
  /* 有图片预览时缩小输入区域 */
  .input-area.has-images {
    min-height: 55px;
    padding: 8px 0;
  }

  .input-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 48px;
    padding: 0 56px;
    border-width: 2px;
    border-radius: 28px;
    align-items: flex-start;
    transition: min-height 0.3s ease;
  }

  .input-wrapper .image-btn {
    width: 28px;
    height: 28px;
    left: 14px;
    bottom: 16px;
  }

  .input-wrapper textarea {
    font-size: 16px;
  }

  .input-wrapper .send-btn {
    width: 28px;
    height: 28px;
    right: 14px;
    bottom: 16px;
  }

  .input-wrapper .send-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
  }

  .input-wrapper .image-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input-wrapper textarea.disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .image-upload-preview .preview-container img {
    width: 100px;
    height: 100px;
  }

  .dialog-item.user .message-image {
    max-width: 300px;
    max-height: 300px;
  }
}

/* ========== 大屏 PC 适配 (≥1400px) ========== */
@media (min-width: 1400px) {
  #app{
    margin: 0 auto;
    max-width: 1200px;
  }
  .navbar {
    padding: 24px 60px;
  }

  .navbar .back-btn {
    width: 0;
    height: 0;
  }

  .navbar .title {
    font-size: 28px;
  }

  .main-content {
    padding: 0 60px;
  }

  .welcome-text h1 {
    font-size: 56px;
  }

  .welcome-text h2 {
    font-size: 28px;
  }

  .mascot {
    width: 220px;
    height: 180px;
  }

  .feature-card {
    padding: 20px 50px;
    margin-bottom: 20px;
  }

  .feature-card .features {
    font-size: 20px;
  }

  .input-wrapper {
    max-width: 1200px;
    min-height: 64px;
    padding: 0 64px;
    align-items: flex-start;
  }

  .input-wrapper .image-btn {
    width: 32px;
    height: 32px;
    left: 16px;
    bottom: 16px;
  }

  .input-wrapper textarea {
    font-size: 18px;
  }

  .input-wrapper .send-btn {
    width: 32px;
    height: 32px;
    right: 16px;
    bottom: 16px;
  }

  .input-wrapper .send-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
  }

  .input-wrapper .image-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .input-wrapper textarea.disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}