/* Chatbot 容器 */
#chatbot {
  max-width: 650px;
  margin: auto;
  padding: 20px;
  border: none;            /* ❌ 移除外框 */
  border-radius: 0;        /* ❌ 移除圓角 */
  background: #fff;        /*  背景改為純白 */
  box-shadow: none;        /* ❌ 移除陰影，融入網站背景 */
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #333;
}

/* 標題 */
#chatbot h2 {
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  color: #222;
}

/* 對話視窗 */
#chat-window {
  height: 450px;
  overflow-y: auto;
  padding: 15px;
  margin-bottom: 15px;
  background: #fff;
  border-radius: 8px;
}

/* 輸入區 */
/* 輸入區容器 */
.chat-input {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 28px;  /* 圓角 */
  padding: 6px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 輸入框 */
.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 28px;
  background: transparent;  /* 與容器同色 */
}

/* 發送按鈕 */
.chat-input button {
  background: #001d39;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover {
  background: #003d99;
}

/* 按鈕裡的文字縮小一點 */
.chat-input button span {
  font-size: 12px;
}

.chat-input .send-icon {
  font-size: 14px;       /* 箭嘴大小 */
  line-height: 1;
}


/* 對話氣泡樣式 */
#chat-window .user-message,
#chat-window .ai-message {
  border-radius: 12px;
  padding: 8px 12px;         /* ? 減少 padding，單行不會太厚 */
  max-width: 70%;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

#chat-window .user-message {
  background: #e6f0ff;
  border: 1px solid #cce0ff;
}

#chat-window .ai-message {
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Loading dots 動畫 */
.loading-dots::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* === Markdown & 一般文字統一 === */
#chat-window,
#chat-window p,
#chat-window li,
#chat-window div {
  font-size: 13px !important;
  line-height: 1.5;
  color: #333;
  margin: 2px 0;            /* ? 減少多餘間距 */
}

/* Markdown 粗體/斜體 */
#chat-window strong {
  font-weight: 600;
  color: #222;
}

#chat-window em {
  font-style: italic;
}

/* Markdown 清單 */
#chat-window ul,
#chat-window ol {
  padding-left: 20px;
  margin: 4px 0;
}

#chat-window li {
  margin-bottom: 2px;       /* ? 更緊湊 */
}

/* Markdown 標題 */
#chat-window h1,
#chat-window h2,
#chat-window h3 {
  margin: 8px 0 4px;
  font-weight: 600;
  color: #111;
}

#chat-window h1 { font-size: 16px !important; }
#chat-window h2 { font-size: 15px !important; }
#chat-window h3 { font-size: 14px !important; }

/* Markdown code 區塊 */
#chat-window code {
  background: #f4f4f4;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

#chat-window blockquote {
  border-left: 3px solid #ccc;
  padding-left: 10px;
  margin: 4px 0;
  color: #555;
  font-style: italic;
}
