/* chat.html 聊天页样式（公共样式见 css/common.css） */
body { padding: 28px 16px; }

.wrap {
  max-width: 820px;
  margin: 0 auto;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 32px;
}

.kb-select-row {
  margin-bottom: 14px;
  font-size: 15px;
  color: #2d3748;
}
.kb-select-row input {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid #d2d6dc;
  border-radius: 10px;
  margin-left: 8px;
}

#messages {
  border: 1px solid #e2e8f0;
  height: 420px;
  overflow-y: auto;
  padding: 18px;
  margin: 10px 0 18px;
  background: #ffffff;
  border-radius: 14px;
}

/* 聊天消息气泡 */
.msg { margin: 12px 0; line-height: 1.7; white-space: pre-wrap; }
.user {
  color: #fff;
  background: #1677ff;
  padding: 12px 16px;
  border-radius: 14px 14px 2px 14px;
  max-width: 90%;
  margin-left: auto;
  width: fit-content;
}
.assistant {
  color: #1f2937;
  background: #f3f4f6;
  padding: 12px 16px;
  border-radius: 14px 14px 14px 2px;
  max-width: 90%;
  margin-right: auto;
  width: fit-content;
}

textarea#question {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d2d6dc;
  border-radius: 12px;
  font-size: 15px;
  resize: vertical;
  transition: 0.22s;
}
textarea:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.15);
}

#sendBtn {
  margin-top: 14px;
  padding: 13px 32px;
  background: linear-gradient(135deg, #1677ff 0%, #4080ff 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.26s ease;
}
#sendBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.3);
  background: linear-gradient(135deg, #0e66e8 0%, #3374ee 100%);
}
#sendBtn:active:not(:disabled) { transform: translateY(1px); }
#sendBtn:disabled {
  background: #b4b8c2;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#status { margin-top: 12px; font-size: 14px; color: #475569; min-height: 20px; }

#messages::-webkit-scrollbar { width: 6px; }
#messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 移动端适配 */
@media (max-width: 640px) {
  .card { padding: 22px 18px; }
  .header-area h2 { font-size: 22px; }
  #messages { height: 340px; }
  #sendBtn { width: 100%; }
  .user, .assistant { max-width: 95%; }
}
