/* 基础布局重置 */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* 防止body出现滚动条 */
}

/* 主容器布局 */
.container.sales-chat {
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* 聊天容器布局优化 */
.chat-container {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止容器本身滚动 */
}

/* 消息区域布局优化 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 100px; /* 为输入框留出空间 */
  position: relative;
  height: calc(100% - 80px); /* 减去输入框高度 */
  -webkit-overflow-scrolling: touch; /* iOS滚动优化 */
}

/* 输入区域固定布局 */

/* 消息样式优化 */
.message {
  margin-bottom: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 适配移动设备安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input-area {
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    height: calc(80px + env(safe-area-inset-bottom));
  }

  .chat-messages {
    height: calc(100% - 80px - env(safe-area-inset-bottom));
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  .container.sales-chat {
    padding: 0;
  }

  .chat-messages {
    padding: 10px;
  }

  .chat-input-area {
    padding: 10px;
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .chat-input-area {
    background: #1a1a1a;
    border-top-color: #333;
  }
}
/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  line-height: 1.5;
  background-color: #f5f5f5;
}

/* 容器样式 */
.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 15px;
}

/* 移动端优先的媒体查询 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
}

.sales-chat {
  background: radial-gradient(circle at center, #ffffff, #e1e1e1);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
  min-height: 100%;
}

/* 场景容器 */
.scene-container {
  text-align: center;
  padding: 15px;
}

.scene-intro {
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.65em;
  margin-top: 0vh;
}

.avatar-cell {
  width: 1%;
  vertical-align: top;
}

.avatar-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}

.sales-name {
  font-size: 14px;
  font-weight: 600;
  color: #07c160;
  text-align: center;
}

.intro-cell {
  margin-left: 1em;
  padding: 15px;
  text-align: justify;
}

/* 头像样式 */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 15px;
}

@media (min-width: 768px) {
  .avatar {
    width: 100px;
    height: 100px;
  }
}

/* 按钮组样式 */
.button-group {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  min-width: 120px;
  touch-action: manipulation;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:active {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:active {
  background-color: #545b62;
}

/* 对话容器 */
.chat-container {
  margin-top: 20px;
}

/* 问题容器 */
.question-container {
  margin-bottom: 20px;
  padding: 15px;
}

.question {
  font-size: 16px;
  margin-bottom: 15px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .question {
    font-size: 18px;
  }
}

/* 答案选项 */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 15px 0;
}

.answer-option {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.answer-option:active {
  background-color: #f0f0f0;
}

/* 结果容器 */
.result-container {
  text-align: center;
}

.result-text {
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .result-text {
    font-size: 16px;
  }
}

/* 适配暗色模式 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #fff;
  }

  .sales-chat {
    background: #2d2d2d;
  }

  .answer-option {
    border-color: #404040;
    background-color: #333;
  }

  .answer-option:active {
    background-color: #404040;
  }
}

/* 触摸优化 */
@media (hover: none) {
  .btn {
    -webkit-tap-highlight-color: transparent;
  }

  .answer-option {
    -webkit-tap-highlight-color: transparent;
  }
}

/* 在现有的CSS基础上添加或更新以下样式 */

/* 聊天容器 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100% !important;
  max-height: 600px;
  background: #f5f5f5;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative; /* 添加相对定位 */
}

/* 聊天记录区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f5f5;
  padding-bottom: 150px; /* 添加底部内边距，防止内容被输入框遮挡 */
  margin-bottom: 60px; /* 输入框的高度 */
}

/* 消息样式 */
.message {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.assistant-message {
  justify-content: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 12px;
}

.message-bubble {
  max-width: 90%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.user-message .message-bubble {
  background: #007bff;
  color: white;
  border-bottom-right-radius: 4px;
}

.assistant-message .message-bubble {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 输入区域 */

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 8px 16px;
}

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.4;
  max-height: 100px;
  padding: 8px 0;
  resize: none;
  outline: none;
}

.send-button {
  background: none;
  border: none;
  padding: 8px;
  margin-left: 8px;
  color: #b4b4b4;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.send-button:hover {
  color: #656565;
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
  .chat-container {
    background: #1a1a1a;
  }

  .chat-messages {
    background: #2d2d2d;
  }

  .message-input {
    color: #fff;
  }

  .input-wrapper {
    background: #333;
  }

  .assistant-message .message-bubble {
    background: #383838;
    color: #fff;
  }

  .chat-input-area {
    background: #1a1a1a;
    border-top-color: #333;
  }
}

/* Markdown 样式调整 */
.markdown-body {
  box-sizing: border-box;
  min-width: 200px;
  max-width: 980px;
  margin: 0 auto;
  padding: 45px;
  background: #fff;
  border-radius: 8px;

  text-align: left;
}

@media (max-width: 767px) {
  .markdown-body {
    padding: 0px;
    padding-bottom: 15px;
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .markdown-body {
    background: #2d2d2d;
    color: #fff;
  }

  .markdown-body a {
    color: #58a6ff;
  }

  .markdown-body hr {
    border-color: #444;
  }

  .markdown-body blockquote {
    border-left-color: #444;
  }

  .markdown-body table tr {
    background-color: #2d2d2d;
    border-color: #444;
  }

  .markdown-body table tr:nth-child(2n) {
    background-color: #333;
  }
}

#sales-intro {
  font-size: 13px;
  color: #666;
  line-height: 1.3;
  margin-bottom: 1.2em;
}

/* 加载界面样式 */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: #666;
  font-size: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .loading-screen {
    background: #1a1a1a;
  }

  .loading-spinner {
    border-color: #333;
    border-top-color: #007bff;
  }

  .loading-text {
    color: #fff;
  }
}

/* 淡入动画 */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

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

/* 结果界面样式 */
.result-container {
  padding: 0px;
}

.result-header {
  display: flex;
  align-items: center;

  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.result-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-title {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: 500;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .result-header {
    border-bottom-color: #444;
  }

  .result-title {
    color: #fff;
  }
}

/* 修改主容器样式 */

/* 修改背景遮罩层 */
#main-content::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 1;
}

/* 修改聊天容器样式 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: none;
  background: transparent;
  border-radius: 12px;
  box-shadow: none;
  position: relative;
  z-index: 2;
  padding-bottom: 80px; /* 为底部输入框留出空间 */
}

/* 修改聊天记录区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  margin-bottom: 150px; /* 为底部输入框留出空间 */
}

/* 修改输入区域 */

/* 修改场景容器 */
.scene-container {
  text-align: center;
  padding: 15px;
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 修改消息气泡样式 */
.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
}

.user-message .message-bubble {
  background: rgba(0, 123, 255, 0.9);
  color: white;
  word-wrap: break-word;
}

/* 修改结果容器 */
.result-container {
  position: relative;
  z-index: 2;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  margin: 20px;
}

/* 适配移动端 */
@media (max-width: 768px) {
  .chat-input-area {
    padding: 10px;
  }

  .message-bubble {
    max-width: 90%;
  }

  .result-container {
    margin: 10px;
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  #main-content::before {
    background-color: rgba(0, 0, 0, 0.85);
  }

  .chat-input-area {
    background: rgba(26, 26, 26, 0.95);
  }

  .message-bubble {
    background: rgba(51, 51, 51, 0.9);
  }

  .result-container {
    background: rgba(45, 45, 45, 0.9);
  }
}

/* 修复滚动问题 */
body {
  overflow-x: hidden;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 确保容器居中 */
.container.sales-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  margin: 0 auto;
  max-width: 800px;
  background: transparent;
}

.markdown-body ol,
.markdown-body ul {
  padding-left: 1em !important;
}

/* 邮箱输入界面样式 */
.email-input-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.email-input-box {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
}

.email-input-box h3 {
  margin: 0 0 20px 0;
  color: #333;
}

.email-input-box p {
  margin: 0 0 20px 0;
  line-height: 1.6;
  color: #666;
}

.email-input-box input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 16px;
}

.email-button-group {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 聊天界面相关样式 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 110px; /* 固定栏高度 80px + 额外填充 30px */
  box-sizing: border-box;
}

/* 添加安全区域填充（适配全面屏手机） */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-messages {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }
  .chat-input-area {
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }
}

/* 可视化内容容器 */
.visualization-container {
  padding: 15px;
  margin-bottom: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  margin-bottom: 20px;
}

.mermaid-wrapper {
  margin: 15px 0;
  overflow-x: auto;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 0;
  padding: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.markdown-body .highlight pre,
.markdown-body pre {
  padding: 1px !important;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f6f8fa;
  border-radius: 3px;
}

/* 图表通用容器 */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 趋势图特定样式 */
.trend-chart-container {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 图表响应式布局 */
.trend-chart-container canvas,
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* 图表标题样式 */
.chart-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

/* 图表注释样式 */
.chart-legend {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
  text-align: center;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .chart-container,
  .trend-chart-container {
    background: #2d2d2d;
  }

  .chart-title {
    color: #fff;
  }

  .chart-legend {
    color: #aaa;
  }
}

/* 添加到现有的 CSS 中 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #90949c;
  border-radius: 50%;
  animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.3s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.message.typing .message-bubble {
  min-width: 60px;
  background: #f0f0f0;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px; /* 根据你的输入区域高度调整 */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 删除之前所有的 chat-input-area 相关样式，使用这个统一的版本 */

.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-top: 1px solid #eee;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 8px 16px;
  margin: 0 auto;
  max-width: calc(100% - 30px);
}

/* 确保消息区域有足够的底部间距 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(80px + 30px); /* 输入框高度 + 额外空间 */
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}

/* 适配移动设备安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input-area {
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }

  .chat-messages {
    padding-bottom: calc(80px + 30px + env(safe-area-inset-bottom));
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .chat-input-area {
    padding: 10px;
  }

  .input-wrapper {
    max-width: calc(100% - 20px);
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .chat-input-area {
    background: rgba(26, 26, 26, 0.95);
    border-top-color: #333;
  }

  .input-wrapper {
    background: #333;
  }

  .message-input {
    color: #fff;
  }
}

/* 确保最后一条消息不会被输入框遮挡 */
.message:last-child {
  margin-bottom: 80px; /* 根据输入区域高度调整 */
}

#result-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #fff;
}

#analysis-result {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  padding-bottom: 56px;
  -webkit-overflow-scrolling: touch;
}

.chart-container,
.trend-chart-container {
  height: 400px;
  margin: 20px 0;
  width: 100%;
}

.markdown-body {
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
}

.result-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 100;
}

@media (prefers-color-scheme: dark) {
  #result-container {
    background: #1a1a1a;
    color: #fff;
  }

  .result-actions {
    background: #1a1a1a;
    border-top-color: #333;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #analysis-result {
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  .result-actions {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

.analysis-progress {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  z-index: 100;
  border-bottom: 1px solid #eee;
}

.analysis-section {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

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

.analysis-complete {
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 分析结果样式 */
.analysis-content {
  padding: 20px;
  background: white;
  border-radius: 8px;
  margin: 10px 0;
}

.analysis-header {
  margin-bottom: 20px;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.result-text {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

.result-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
}

.result-title {
  margin: 0;
  color: #333;
  font-size: 20px;
}

/* 加载状态样式 */
.thinking-progress {
  color: #666;
  font-size: 18px;
}

.spinner-border {
  width: 24px;
  height: 24px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.markdown-body pre > code {
  padding: 0;
  margin: 0;
  font-size: 100%;
  word-break: normal;
  white-space: break-spaces !important;
  background: transparent;
  border: 0;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  position: absolute;
  right: 20px;
  font-size: 12px;
  width: 10vh;
  max-width: 10px;
  top: 25px;
  background: #f0f0f0;
  color: #666;
  /* padding: 4px 0px 4px 0px !important; */
}

.analysis-content {
  padding: 0px !important;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0%) !important;
  margin: 0px 0;
}

/* 聊天输入区域的核心样式 */
.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-top: 1px solid #eee;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-start;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  background: #f8f9fa;
  border-radius: 24px;
  padding: 8px 16px;
  margin: 0 auto;
  width: 100%;
  max-width: calc(100% - 30px);
}

#message-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.4;
  min-height: 40px;
  max-height: 150px;
  padding: 8px 40px 8px 0; /* 右侧留出发送按钮的空间 */
  resize: none;
  outline: none;
  word-break: break-word;
}

#send-message {
  position: fixed;
  right: 12px;
  bottom: 50%;
  transform: translateY(50%);
  background: none;
  border: none;
  padding: 8px;
  color: currentColor;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* 确保消息区域有足够的底部间距 */
.chat-messages {
  padding-bottom: calc(80px + 30px);
}

/* 适配移动设备安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input-area {
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
  }

  .chat-messages {
    padding-bottom: calc(80px + 30px + env(safe-area-inset-bottom));
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .chat-input-area {
    background: rgba(26, 26, 26, 0.95);
    border-top-color: #333;
  }

  .input-wrapper {
    background: #333;
  }

  #message-input {
    color: #fff;
  }
}

.footer-link-container {
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
}

.footer-link {
  color: #333;
  text-decoration: none;
  font-size: 18px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-link:hover {
  opacity: 1;
}

.bubble-animation {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  background: rgb(221 17 224 / 90%);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: #fdfdfd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  margin-bottom: 10px;
  white-space: nowrap;
  animation: none;
}

.bubble-animation::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.9);
}

@keyframes bubbleUp {
  0% {
    opacity: 0;
    visibility: visible;
    transform: translate(-50%, 10px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
  }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .footer-link {
    color: #aaa;
    font-size: 18px;
  }
  .bubble-animation {
    background: rgba(51, 51, 51, 0.9);
    color: #fff;
  }

  .bubble-animation::after {
    border-top-color: rgba(51, 51, 51, 0.9);
  }
}

.markdown-body input {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: #000000;
  margin-bottom: 20px;
  width: 100%;
  padding: 5px;
  font-size: 13px;
}

.message-bubble img {
  max-width: 100%; /* 确保图片不会超出气泡宽度 */
  height: auto; /* 保持图片比例 */
  border-radius: 8px; /* 圆角效果 */
  margin: 8px 0; /* 上下间距 */
  display: block; /* 块级显示 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */
  object-fit: cover; /* 保持图片比例填充 */
  background-color: rgba(0, 0, 0, 0.03); /* 图片加载前的背景色 */
  transition: transform 0.2s ease; /* 平滑过渡效果 */
  margin-bottom: 16px;
}

/* 可选: 鼠标悬停效果 */
.message-bubble img:hover {
  transform: scale(1.02); /* 轻微放大效果 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* 增强阴影 */
}

/* 可选: 加载动画 */
.message-bubble img.loading {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.6;
  }
}
.message-bubble ol {
  padding: 10px;
  font-weight: 600;
  line-height: 1.65em;
  color: #333;
}

.message-bubble-with-image {
  width: 100%;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-overlay {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* 针对移动设备的响应式调整 */
@media (max-width: 768px) {
  .message-bubble-with-image {
    min-height: 150px;
  }

  .message-overlay {
    font-size: 14px;
  }
}

.message-bubble {
  border-radius: 12px;
  max-width: 80%;
  word-wrap: break-word;
  margin-bottom: 8px;
  overflow: hidden;
}

.assistant-message .message-bubble {
  background-color: #fff;
  margin-right: auto;
}

@media (max-width: 768px) {
  .message-bubble {
    max-width: 90%;
  }
}

.formatted-question {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.formatted-question-avatar {
  display: flex;
  align-items: center;
}

.formatted-question .fixed-avatar-container {
  position: static !important;
  top: auto;
  left: auto;
  display: inline-flex;
  flex-direction: column;
  padding: 0;
  border-radius: 999px;
  background-color: transparent;
  box-shadow: none;
  align-items: center;
  align-content: center;
  flex-wrap: nowrap;
  justify-content: center;
}

.formatted-question-content {
  flex: 1;
  min-width: 0;
}

.formatted-question .fixed-avatar-img {
  width: 32px;
  height: 32px;
}

.formatted-question .fixed-avatar-name {
  margin: 5px 0 0 0px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  color: #6c7a72;
  display: inline-flex !important;
  align-items: center;
}

@media (max-width: 768px) {
  .formatted-question .fixed-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
  .formatted-question .fixed-avatar-name {
    font-size: 15px;
    color: #07c160;
  }
}

.ai-assist-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 8px 0 12px;
}

.ai-assist-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--wechat-muted);
  min-width: 0;
  margin-bottom: -15px;
  margin-left: 3px;
}

.ai-assist-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ai-assist-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-assist-container .ai-assist-button {
  margin-left: 8px;
  white-space: nowrap;
}

.service-question-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid #e57914;
  border-radius: 6px;
  background: #f28c28;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(194, 93, 11, 0.2);
  cursor: pointer;
}

.service-question-button:hover,
.service-question-button:focus-visible {
  border-color: #d9690a;
  background: #df750f;
  color: #fff;
}

.service-question-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.service-question-icon {
  display: block;
  flex: 0 0 auto;
  color: #fff;
}

.service-question-button.is-loading .service-question-icon {
  animation: service-question-pulse 0.8s ease-in-out infinite alternate;
}

.need-mode-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #08a85d;
  border-radius: 999px;
  background: #fff;
  color: #07894e;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 7px rgba(7, 137, 78, 0.14);
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.need-mode-button:hover,
.need-mode-button:focus-visible,
.need-mode-button.is-active {
  border-color: #07894e;
  background: #08a85d;
  color: #fff;
}

.need-mode-button:active {
  transform: translateY(1px);
}

.need-mode-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.need-mode-button.is-loading .need-mode-icon {
  animation: service-question-pulse 0.8s ease-in-out infinite alternate;
}

.answer-container.need-mode-active .answer-input-block {
  border-color: rgba(8, 168, 93, 0.34);
}

/* 微联创富获客 Vtalk 专属按钮组：有需求、问服务、提问题 */
.ai-assist-container.is-weilian-hcode {
  width: 100%;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: stretch;
}

.ai-assist-container.is-weilian-hcode .need-mode-button,
.ai-assist-container.is-weilian-hcode .service-question-button,
.ai-assist-container.is-weilian-hcode .ai-assist-button {
  flex: 1 1 0;
  min-width: 0;
}

.ai-assist-container.is-weilian-hcode .need-mode-button,
.ai-assist-container.is-weilian-hcode .service-question-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #ef790c;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff9b2f, #f27a0b);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 5px 13px rgba(224, 104, 5, 0.26);
}

.ai-assist-container.is-weilian-hcode .need-mode-button:hover,
.ai-assist-container.is-weilian-hcode .need-mode-button:focus-visible,
.ai-assist-container.is-weilian-hcode .need-mode-button.is-active,
.ai-assist-container.is-weilian-hcode .service-question-button:hover,
.ai-assist-container.is-weilian-hcode .service-question-button:focus-visible {
  border-color: #db6500;
  background: linear-gradient(135deg, #f68b18, #df6500);
  color: #fff;
}

.ai-assist-container.is-weilian-hcode .ai-assist-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-left: 0;
  padding: 7px 12px;
  border: 1px solid #06a955;
  border-radius: 999px;
  background: linear-gradient(135deg, #0dcc6a, #06aa55);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 5px 13px rgba(7, 169, 85, 0.24);
  cursor: pointer;
}

.ai-assist-container.is-weilian-hcode .ai-assist-button:hover,
.ai-assist-container.is-weilian-hcode .ai-assist-button:focus-visible {
  background: linear-gradient(135deg, #0bbd62, #05984c);
}

.vtalk-example-notice {
  position: fixed;
  z-index: 120500;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 16px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 11px;
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 12px 14px 14px;
  border: 1px solid rgba(7, 169, 85, 0.18);
  border-radius: 18px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.98),
    rgba(239, 252, 245, 0.98)
  );
  color: #234236;
  box-shadow: 0 18px 44px rgba(29, 74, 52, 0.22);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}

body.vtalk-cust-guide-open {
  overflow: hidden;
}

.vtalk-cust-guide {
  position: fixed;
  z-index: 120800;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(15, 38, 28, 0.58);
  backdrop-filter: blur(7px);
  animation: vtalk-cust-guide-fade 0.22s ease-out both;
}

.vtalk-cust-guide.is-closing {
  animation: vtalk-cust-guide-fade 0.18s ease-in reverse both;
}

.vtalk-cust-guide-card {
  box-sizing: border-box;
  width: min(410px, 100%);
  padding: 26px 22px 20px;
  border: 1px solid rgba(7, 193, 96, 0.16);
  border-radius: 24px;
  background: linear-gradient(155deg, #ffffff 0%, #f1fff7 100%);
  color: #24382f;
  text-align: center;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  animation: vtalk-cust-guide-rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.vtalk-cust-guide-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #13cf70, #078f4b);
  color: #fff;
  box-shadow: 0 10px 25px rgba(7, 169, 85, 0.26);
}

.vtalk-cust-guide-icon svg {
  width: 30px;
  height: 30px;
}

.vtalk-cust-guide-card h2 {
  margin: 0 0 11px;
  color: #087d49;
  font-size: 21px;
  font-weight: 800;
}

.vtalk-cust-guide-card p {
  margin: 0;
  color: #687a71;
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
}

.vtalk-cust-guide-complete {
  width: 100%;
  margin-top: 20px;
  padding: 12px 18px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #12c96b, #079a50);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 22px rgba(7, 154, 80, 0.25);
}

@keyframes vtalk-cust-guide-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes vtalk-cust-guide-rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.vtalk-example-notice.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.vtalk-example-notice-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #12cb6b, #079c51);
  color: #fff;
  box-shadow: 0 7px 16px rgba(7, 156, 81, 0.25);
}

.vtalk-example-notice-icon svg {
  width: 23px;
  height: 23px;
}

.vtalk-example-notice-copy {
  align-self: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.vtalk-example-notice-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 60, 42, 0.07);
  color: #698077;
  font-size: 20px;
  line-height: 28px;
  cursor: pointer;
}

@keyframes service-question-pulse {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .ai-assist-user-avatar {
    width: 26px;
    height: 26px;
  }
  .ai-assist-user-name {
    max-width: 90px;
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .ai-assist-container {
    gap: 6px;
    flex-wrap: wrap;
  }

  .ai-assist-user-name {
    max-width: 58px;
  }

  .service-question-button {
    padding: 5px 7px;
  }

  .need-mode-button {
    padding: 5px 7px;
  }
}

/* ===== WeChat-inspired compact refresh ===== */
:root {
  --wechat-bg: #f2f6f3;
  --wechat-card: #ffffff;
  --wechat-text: #1f2a24;
  --wechat-muted: #6c7a72;
  --wechat-brand: #07c160;
  --wechat-brand-strong: #06a956;
  --wechat-border: rgba(15, 41, 26, 0.08);
  --wechat-shadow: 0 10px 30px rgba(16, 40, 28, 0.08);
  --wechat-glass: rgba(255, 255, 255, 0.88);
}

body {
  font-family:
    "PingFang SC", "HarmonyOS Sans", "Noto Sans SC", "Microsoft YaHei",
    sans-serif;
  background: var(--wechat-bg);
  color: var(--wechat-text);
}

#main-content {
  background: linear-gradient(
    160deg,
    rgb(255 255 255 / 0%) 0%,
    rgba(232, 243, 236, 0.9) 100%
  );
  margin-top: 0;
}

#main-content::before {
  background-color: rgba(255, 255, 255, 0.55);
}

.container.sales-chat {
  max-width: 780px;
  margin: 0 auto;
  padding: 0;
}

.chat-container {
  background: transparent;
  box-shadow: none;
  padding-bottom: 96px;
}

.chat-messages {
  padding: 18px 18px 140px;
  gap: 8px;
}

.message {
  margin-bottom: 12px;
}

.message-avatar {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-bubble {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  background: var(--wechat-glass);
  border: 1px solid var(--wechat-border);
  box-shadow: 0 6px 16px rgba(20, 48, 32, 0.08);
}

.assistant-message .message-bubble {
  background: var(--wechat-card);
  color: var(--wechat-text);
}

.user-message .message-bubble {
  background: var(--wechat-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(7, 193, 96, 0.25);
}

.scene-container {
  padding: 12px 16px;
}

.scene-intro {
  margin-bottom: 14px;
}

#sales-intro {
  font-size: 13px;
  color: var(--wechat-muted);
}

.avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 0;
}

.button-group {
  gap: 8px;
  margin: 16px 0;
}

.btn {
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 22px;
  min-width: 104px;
  box-shadow: 0 8px 16px rgba(16, 40, 28, 0.12);
}

.btn-primary {
  background: var(--wechat-brand);
}

.btn-primary:active {
  background: var(--wechat-brand-strong);
}

.btn-secondary {
  background: #e9efeb;
  color: #3b4b42;
}

.btn-secondary:active {
  background: #dfe7e1;
}

.chat-input-area {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--wechat-border);
  box-shadow: 0 -10px 25px rgba(16, 40, 28, 0.08);
  padding: 12px 14px;
}

.input-wrapper {
  background: #f7faf8;
  border: 1px solid rgba(15, 41, 26, 0.08);
  border-radius: 18px;
  padding: 6px 12px;
}

#message-input {
  font-size: 14px;
  line-height: 1.5;
  min-height: 36px;
}

#send-message {
  color: var(--wechat-brand);
}

#send-message:hover {
  color: var(--wechat-brand-strong);
}

.result-container {
  background: var(--wechat-card);
  border-radius: 16px;
  margin: 14px;
  box-shadow: var(--wechat-shadow);
  flex-direction: column;
}

#result-container .result-text {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 10px;
  margin-bottom: 0;
}

.result-header {
  border-bottom: 1px solid var(--wechat-border);
  padding-bottom: 12px;
}

.result-title {
  font-size: 17px;
  color: var(--wechat-text);
}

.result-text {
  color: var(--wechat-text);
}

.markdown-body {
  background: transparent;
  padding: 18px;
  border-radius: 14px;
}

.result-text.result-is-loading {
  display: none !important;
}

.result-links-container {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e5ece8;
}

.result-links-container .links-title {
  margin: 0 0 18px;
  color: #07c160;
  font-size: 24px;
  font-weight: 700;
}

.result-links-container .links-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
}

.result-links-container .link-wrapper {
  display: flex;
  flex: 1 1 168px;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.result-links-container .link-prompt {
  display: block;
  color: #7d8581;
  line-height: 1.7;
}

.result-links-container .result-action-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid #bce8cc;
  border-radius: 10px;
  background: #eaf8ef;
  color: #087d3d !important;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: none;
  box-sizing: border-box;
}

.result-links-container .link-item-image {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}

.result-links-container .link-image {
  display: block;
  max-width: 100%;
  height: auto;
}

.result-links-container .result-action-button:hover,
.result-links-container .result-action-button:focus {
  background: #dcf3e5;
  border-color: #9eddb6;
  color: #066b34 !important;
  text-decoration: none !important;
  transform: none;
}

.free-member-result-tip {
  display: block;
  margin: 0 0 12px;
  color: #07c160 !important;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
}

a.free-member-result-tip {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-buttons {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex: 0 0 68px;
  min-height: 68px;
  max-height: 68px;
  margin: 0;
  padding: 10px;
  gap: 0;
  border: 0 !important;
  box-sizing: border-box;
}

.result-buttons #finish-form {
  width: 100%;
  min-height: 48px;
  max-height: 48px;
  height: 48px;
  padding: 0 16px;
  line-height: 48px;
  margin: 0;
}

.result-buttons #send-email {
  display: none !important;
}

.result-container.result-loading-state {
  min-height: calc(100dvh - 28px);
}

.result-container.result-loading-state .result-buttons {
  margin-top: auto;
}

.analysis-loading {
  background: #f6fbf8;
  border: 1px dashed rgba(7, 193, 96, 0.25);
}

.footer-link {
  color: var(--wechat-muted);
  font-size: 16px;
}

.bubble-animation {
  background: rgba(7, 193, 96, 0.95);
}

@media (max-width: 768px) {
  .chat-messages {
    padding: 14px 12px 130px;
  }

  .message-bubble {
    max-width: 90%;
    font-size: 13.5px;
  }

  .btn {
    min-width: 96px;
    padding: 9px 16px;
  }

  .avatar {
    width: 64px;
    height: 64px;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #0f1412;
    color: #eef4f0;
  }

  #main-content::before {
    background-color: rgba(10, 14, 12, 0.7);
  }

  .chat-input-area {
    background: rgba(16, 22, 19, 0.95);
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .input-wrapper {
    background: rgba(22, 30, 26, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
  }

  .assistant-message .message-bubble {
    background: rgba(22, 30, 26, 0.95);
    color: #eef4f0;
    border-color: rgba(255, 255, 255, 0.06);
  }

  .result-container {
    background: rgba(19, 26, 22, 0.96);
  }

  .footer-link {
    color: #9bb0a5;
  }
}

:root {
  color-scheme: light;
}

body {
  background: #fff;
  color: #111;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #fff !important;
    color: #111 !important;
  }

  #main-content::before {
    background-color: rgba(255, 255, 255, 0.08) !important;
  }

  .chat-input-area,
  .input-wrapper,
  .assistant-message .message-bubble,
  .result-container {
    background: #fff !important;
    color: #111 !important;
    border-color: #e6e6e6 !important;
  }

  .footer-link {
    color: #1f2a24 !important;
  }
}

#result-container {
  gap: 0 !important;
}

#result-container #analysis-result {
  padding-bottom: 10px !important;
  margin-bottom: 0 !important;
}

#result-container .result-buttons {
  flex: 0 0 68px !important;
  min-height: 68px !important;
  max-height: 68px !important;
  padding: 10px !important;
  margin: 0 !important;
  gap: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

#result-container #finish-form {
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 0 16px !important;
  margin: 0 !important;
  line-height: 48px !important;
}

#result-container #send-email {
  display: none !important;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #result-container #analysis-result {
    padding-bottom: 10px !important;
  }
}

#send-result-modal .send-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

#send-result-modal .send-result-actions .btn {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  min-width: 96px !important;
  height: auto !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
}
