:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e6e8eb;
  --text: #1f2329;
  --muted: #8a9099;
  --brand: #2f7d5b;
  --brand-soft: #e8f3ee;
  --cust: #f2f3f5;
  --agent: #2f7d5b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 15px; }
.badge {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 52px);
}
.chat, .sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.avatar {
  width: 38px; height: 38px; border-radius: 8px;
  background: #ffd8b0; color: #7a4a16;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.who { flex: 1; }
.name { font-weight: 600; }
.tag {
  font-size: 11px; color: var(--brand); background: var(--brand-soft);
  padding: 1px 7px; border-radius: 6px; margin-left: 6px; font-weight: 400;
}
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.bubble {
  max-width: 76%; padding: 9px 13px; border-radius: 10px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.bubble.customer { align-self: flex-start; background: var(--cust); }
.bubble.agent { align-self: flex-end; background: var(--agent); color: #fff; }
.composer {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line);
}
.composer input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; outline: none; font-size: 14px;
}
.btn {
  border: none; border-radius: 8px; padding: 8px 14px;
  font-size: 13px; cursor: pointer;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.side-title { font-weight: 600; }
.suggestions { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sg-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  cursor: pointer; line-height: 1.5; transition: border-color .15s, background .15s;
}
.sg-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.sg-card .idx { color: var(--brand); font-weight: 600; margin-right: 6px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.side-foot {
  padding: 12px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); line-height: 1.5;
}
.side-foot code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
