/* ========== Chat Widget - Digital Twin (Embedded) ========== */

/* 嵌入式聊天容器 */
.chat-embedded {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: #faf6f1;
  border-radius: 16px;
  border: 1px solid #ede8df;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.chat-embedded-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ede8df;
}

.chat-embedded-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #3e3b33;
  margin-bottom: 0.5rem;
}

.chat-embedded-subtitle {
  font-size: 0.85rem;
  color: #8a7e70;
  margin: 0;
}

/* Messages */
.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 120px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.65;
  word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: #c05845;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #3e3b33;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.chat-msg.bot a {
  color: #c05845;
  text-decoration: underline;
}

.chat-msg.bot strong {
  color: #c05845;
}

.chat-msg.bot ul, .chat-msg.bot ol {
  padding-left: 1.2rem;
  margin: 0.3rem 0;
}

.chat-msg.bot li {
  margin-bottom: 0.15rem;
}

.chat-msg.system {
  align-self: center;
  background: #fff;
  color: #8a7e70;
  font-size: 0.82rem;
  text-align: center;
  max-width: 90%;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Input */
.chat-input-area {
  padding: 1rem;
  border-top: 1px solid #ede8df;
  display: flex;
  gap: 0.5rem;
  background: transparent;
}

.chat-input-area input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1.5px solid #e0dbd2;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #3e3b33;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-area input::placeholder {
  color: #b8b0a4;
}

.chat-input-area input:focus {
  border-color: #c05845;
}

.chat-input-area button {
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  border: none;
  background: #c05845;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.2s;
}

.chat-input-area button:hover {
  background: #a84a3a;
}

/* Quick suggestions */
.chat-suggestions {
  padding: 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chat-suggestions button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid #e0dbd2;
  border-radius: 16px;
  background: #fff;
  color: #6b5e50;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.chat-suggestions button:hover {
  border-color: #c05845;
  color: #c05845;
  background: #fdf5f3;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .chat-embedded {
    margin: 1rem;
    padding: 1rem;
    border-radius: 12px;
  }

  .chat-messages {
    max-height: 300px;
  }
}
