* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --feishu-blue: #3370ff;
  --bg: #f5f6f7;
  --bubble-user: #3370ff;
  --bubble-ai: #ffffff;
  --text: #1f2329;
  --text-sub: #8f959e;
  --border: #e5e6eb;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--feishu-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
}

.user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  max-width: 50%;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
  gap: 8px;
  max-width: 82%;
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg .bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user .bubble {
  background: var(--bubble-user);
  color: #fff;
  border-top-right-radius: 3px;
}

.msg.ai .bubble {
  background: var(--bubble-ai);
  border: 1px solid var(--border);
  border-top-left-radius: 3px;
}

.msg .side {
  min-width: 30px;
  text-align: center;
}

.msg .side .avatar {
  width: 30px;
  height: 30px;
}

.msg .side .initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--feishu-blue);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-sub);
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-bar textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  max-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.input-bar textarea:focus {
  border-color: var(--feishu-blue);
}

.input-bar button {
  border: none;
  background: var(--feishu-blue);
  color: #fff;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
}

.input-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: #fff4e0;
  color: #6b4e00;
  font-size: 13px;
  z-index: 9;
  text-align: center;
}

.hint-line {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  padding: 8px 0;
}
