* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #1f2329;
  background: #f5f6f8;
}
button { font: inherit; cursor: pointer; }
.bx { display: flex; height: 100vh; }

.bx-chat {
  width: 380px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e5e6eb;
  position: relative;
}
.bx-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid #f0f1f3;
}
.bx-brand { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.bx-logo { color: #3370ff; }
.bx-x { color: #8f959e; font-weight: 400; }
.bx-who { margin-left: auto; color: #646a73; font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-who.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34c724; margin-right: 6px; vertical-align: middle; }
.bx-icon { border: 0; background: none; color: #8f959e; font-size: 12px; padding: 4px 6px; border-radius: 6px; }
.bx-icon:hover { background: #f2f3f5; color: #1f2329; }

.bx-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 8px; }
.bx-empty { color: #646a73; }
.bx-hello { line-height: 1.7; margin: 8px 0 14px; }
.bx-sugs { display: flex; flex-wrap: wrap; gap: 8px; }
.bx-sugs button {
  border: 1px solid #e5e6eb; background: #fff; color: #1f2329;
  border-radius: 16px; padding: 6px 12px; font-size: 13px;
}
.bx-sugs button:hover { border-color: #3370ff; color: #3370ff; }

.bx-msg { margin: 0 0 14px; display: flex; flex-direction: column; }
.bx-msg.user { align-items: flex-end; }
.bx-bubble { max-width: 92%; line-height: 1.7; word-break: break-word; }
.bx-msg.user .bx-bubble { background: #3370ff; color: #fff; padding: 8px 12px; border-radius: 12px 12px 2px 12px; white-space: pre-wrap; }
.bx-msg.assistant .bx-bubble { color: #1f2329; }
.bx-bubble p { margin: 0 0 6px; }
.bx-bubble p:last-child { margin-bottom: 0; }
.bx-bubble ul, .bx-bubble ol { margin: 4px 0 6px; padding-left: 20px; }
.bx-bubble code { background: #f2f3f5; padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.bx-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bx-step { font-size: 12px; color: #8f959e; background: #f7f8fa; border-radius: 10px; padding: 2px 8px; }
.bx-step.fail { color: #f54a45; }
.bx-panel-chip {
  align-self: flex-start; margin-top: 6px;
  border: 1px solid #d6e4ff; background: #f0f5ff; color: #3370ff;
  border-radius: 8px; padding: 5px 10px; font-size: 13px;
}
.bx-panel-chip:hover { background: #e1eaff; }
.bx-typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: #8f959e; }
@keyframes blink { 50% { opacity: 0; } }
.bx-err { color: #f54a45; }

.bx-input {
  display: flex; gap: 8px; align-items: flex-end;
  margin: 8px 12px 12px; padding: 8px;
  border: 1px solid #e5e6eb; border-radius: 12px; background: #fff;
}
.bx-input:focus-within { border-color: #3370ff; }
.bx-input textarea {
  flex: 1; border: 0; outline: none; resize: none; font: inherit; line-height: 1.6;
  max-height: 140px; padding: 2px 4px;
}
.bx-input button {
  flex: none; border: 0; background: #3370ff; color: #fff; border-radius: 8px; padding: 6px 14px;
}
.bx-input button:disabled { background: #bacefd; cursor: default; }
.bx-login-tip {
  position: absolute; left: 12px; right: 12px; bottom: 72px;
  background: #fff7e8; color: #b26a00; border: 1px solid #ffe4ba; border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
}

.bx-work { flex: 1; min-width: 0; position: relative; }
.bx-work iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

@media (max-width: 900px) {
  .bx { flex-direction: column-reverse; }
  .bx-chat { width: 100%; height: 45vh; border-right: 0; border-top: 1px solid #e5e6eb; }
  .bx-work { height: 55vh; }
}
