/* Taobao-style customer service chat. */

body.taobao-support {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  background: #eef0f2;
  color: #1f2328;
  font-family: var(--sans);
  color-scheme: light;
}
body.taobao-support::before { display: none; }

.tb-shell {
  display: flex;
  width: min(1280px, 100%);
  height: 100svh;
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0 0 1px #e3e5e8, 0 18px 50px rgba(20, 30, 40, 0.08);
}

.tb-topbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  background: #ff5000;
  color: #ffffff;
}
.tb-brand { display: flex; align-items: baseline; gap: 9px; color: #ffffff; }
.tb-brand-word { font-size: 20px; font-weight: 700; letter-spacing: 0.05em; }
.tb-brand-sub { font-size: 10px; letter-spacing: 0.12em; opacity: 0.82; }
.tb-top-actions { display: flex; align-items: center; gap: 14px; }
.tb-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.94; }
.tb-online i,
.tb-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc84;
}
.taobao-support .lang-switch { border-color: rgba(255, 255, 255, 0.55); color: #ffffff; }
.taobao-support .lang-switch button { color: #ffffff; opacity: 0.78; padding: 5px 9px; }
.taobao-support .lang-switch button[aria-pressed="true"] { background: #ffffff; color: #ff5000; opacity: 1; }
.tb-close {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
}
.tb-close:hover { background: rgba(255, 255, 255, 0.16); }

.tb-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: 244px minmax(0, 1fr);
}

/* ---------- sidebar ---------- */

.tb-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  border-right: 1px solid #e8eaed;
  background: #fafbfc;
  padding: 16px 14px;
}
.tb-shop { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid #eceef1; }
.tb-shop img { border-radius: 4px; }
.tb-shop strong { display: block; font-size: 13px; color: #1f2328; }
.tb-shop span { display: block; margin-top: 2px; font-size: 9px; color: #8b949e; letter-spacing: 0.08em; }

.tb-agent { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #ffe0d3; border-radius: 5px; background: #fff7f3; }
.tb-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ff5000;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}
.tb-avatar-lg { width: 38px; height: 38px; font-size: 15px; }
.tb-agent strong { display: block; font-size: 12px; color: #333333; }
.tb-agent span:not(.tb-avatar) { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 10px; color: #8b949e; }

.tb-agent-list { display: grid; gap: 6px; }
.tb-agent-list button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #3b434b;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tb-agent-list button span { font-size: 10px; color: #9aa3ad; }
.tb-agent-list button:hover { background: #f2f4f6; }
.tb-agent-list button.is-active { border-color: #ffd1bd; background: #fff4ee; color: #ff5000; }
.tb-agent-list button.is-active span { color: #de7350; }

.tb-contact { margin: 2px 0 0; padding-top: 12px; border-top: 1px solid #eceef1; }
.tb-contact div { margin-bottom: 8px; }
.tb-contact dt { font-size: 10px; color: #9aa3ad; }
.tb-contact dd { margin: 2px 0 0; font-size: 11px; color: #4a535c; }
.tb-contact a { color: #4a535c; }

.tb-faq { margin-top: 2px; border-top: 1px solid #eceef1; padding-top: 10px; }
.tb-faq summary { color: #4a535c; font-size: 11px; cursor: pointer; }
.tb-faq p { margin: 8px 0 0; color: #7b858f; font-size: 10px; line-height: 1.6; }

/* ---------- chat ---------- */

.tb-chat {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: #ffffff;
}
.tb-chat-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #eceef1;
  background: #ffffff;
}
.tb-chat-title { display: flex; align-items: center; gap: 9px; }
.tb-chat-title strong { display: block; color: #222222; font-size: 13px; }
.tb-chat-title span:not(.tb-avatar) { display: flex; align-items: center; gap: 5px; margin-top: 2px; color: #8b949e; font-size: 10px; }
.tb-badge { padding: 4px 7px; border: 1px solid #ffd1bd; border-radius: 3px; color: #ff5000; font-size: 10px; }

.tb-product {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px 0;
  padding: 9px 12px;
  border: 1px solid #f0d8cc;
  border-radius: 5px;
  background: #fffaf7;
}
.tb-product img { width: 52px; height: 52px; object-fit: contain; }
.tb-product-info { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.tb-product-info span { color: #b58b78; font-size: 9px; }
.tb-product-info strong { overflow: hidden; color: #333333; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tb-product-info em { color: #ff5000; font-size: 12px; font-style: normal; }
.tb-product-info s { margin-left: 4px; color: #aab2ba; font-size: 10px; }
.tb-product-link { flex: 0 0 auto; color: #ff5000; font-size: 11px; }

.chat-feed {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
  background: #ffffff;
  scroll-behavior: smooth;
}
.chat-row { display: flex; align-items: flex-start; gap: 8px; }
.chat-row-user { flex-direction: row-reverse; }
.chat-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ff5000;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}
.chat-row-user .chat-avatar { background: #d7dde3; color: #ffffff; }
.chat-bubble-wrap { display: flex; max-width: min(72%, 560px); flex-direction: column; align-items: flex-start; gap: 4px; }
.chat-row-user .chat-bubble-wrap { align-items: flex-end; }
.taobao-support .bubble {
  max-width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.65;
  box-shadow: none;
}
.taobao-support .bubble-bot { background: #f4f5f7; color: #30363c; }
.taobao-support .bubble-user { background: #ff5000; color: #ffffff; }
.chat-time { color: #a0a8b0; font-size: 9px; }

.quick-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 18px 10px;
  background: #ffffff;
  scrollbar-width: none;
}
.quick-row::-webkit-scrollbar { display: none; }
.taobao-support .quick {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #ffd1bd;
  border-radius: 999px;
  background: #ffffff;
  color: #d94a1a;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.taobao-support .quick:hover { background: #fff3ed; border-color: #ff5000; }

.tb-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid #eceef1;
  background: #ffffff;
}
.tb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.taobao-support .field label { display: block; margin-bottom: 3px; color: #8b949e; font-size: 10px; }
.taobao-support .field label span { color: #ff5000; }
.taobao-support .field input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e1e5e9;
  border-radius: 3px;
  background: #ffffff;
  color: #333333;
  font: inherit;
  font-size: 11px;
  outline: none;
}
.taobao-support .field input:focus { border-color: #ff5000; box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.1); }
.taobao-support .field input::placeholder { color: #b0b8c0; }
.taobao-support .field-error { min-height: 13px; margin: 2px 0 0; color: #e5482f; font-size: 10px; }

.tb-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  background: #ffffff;
}
.tb-input-row:focus-within { border-color: #ff5000; box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.08); }
.tb-tools { display: flex; flex: 0 0 auto; gap: 6px; padding-bottom: 4px; color: #a0a8b0; font-size: 15px; }
.tb-input-row textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  background: transparent;
  color: #333333;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  outline: none;
}
.tb-input-row textarea::placeholder { color: #aeb6bf; }
.tb-send {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: #ff5000;
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.tb-send:hover { background: #e84800; }
.tb-send:disabled { opacity: 0.5; cursor: default; }
.taobao-support .form-status { min-height: 16px; margin: 0; color: #7b858f; font-size: 10px; }
.taobao-support .form-status[data-state="error"] { color: #e5482f; }
.taobao-support .form-status[data-state="ok"] { color: #289b5a; }

@media (max-width: 860px) {
  .tb-shell { width: 100%; box-shadow: none; }
  .tb-layout { grid-template-columns: 1fr; }
  .tb-sidebar { display: none; }
  .tb-topbar { min-height: 50px; padding: 0 12px; }
  .tb-brand-word { font-size: 17px; }
  .tb-brand-sub { display: none; }
  .tb-online { display: none; }
  .tb-chat-head { min-height: 52px; padding: 0 12px; }
  .tb-product { margin: 9px 12px 0; padding: 7px 9px; }
  .tb-product img { width: 44px; height: 44px; }
  .tb-badge { display: none; }
  .chat-feed { padding: 14px 12px; gap: 12px; }
  .chat-bubble-wrap { max-width: 82%; }
  .quick-row { padding: 4px 12px 8px; }
  .tb-form { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
  .tb-fields { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
}
/* Allow the chat feed to fill the panel; base theme capped it at 220px. */
.taobao-support .chat-feed {
  max-height: none;
}
/* Empty-state guide inside the conversation area. */
.taobao-support .chat-guide {
  max-width: 560px;
  margin-left: 36px;
  padding: 13px 15px 14px;
  border: 1px solid #eceef1;
  border-radius: 6px;
  background: #fbfcfd;
}
.chat-guide-kicker { display: block; color: #ff5000; font-size: 8px; letter-spacing: 0.13em; }
.taobao-support .chat-guide strong { display: block; margin-top: 4px; color: #2c343c; font-size: 12px; font-weight: 500; }
.chat-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #eceef1;
}
.chat-guide-grid b { display: block; color: #303840; font-size: 11px; font-weight: 600; }
.taobao-support .chat-guide-grid small { display: block; margin-top: 3px; color: #8b949e; font-size: 9px; line-height: 1.45; }

@media (max-width: 860px) {
  .taobao-support .chat-guide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 560px) {
  .chat-guide-grid { grid-template-columns: 1fr; gap: 7px; }
}
/* ---------- AI support ---------- */

.tb-role-open {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.tb-role-open:hover { background: rgba(255, 255, 255, 0.16); }
.tb-chat-actions { display: flex; align-items: center; gap: 8px; }
.tb-human {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #ffd1bd;
  border-radius: 3px;
  background: #fff7f3;
  color: #d94a1a;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.tb-human:hover { border-color: #ff5000; background: #ffefe7; }
.tb-human:disabled { opacity: 0.55; cursor: default; }

.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-typing[hidden] { display: none; }
.typing-dots {
  display: inline-flex;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 4px;
  background: #f4f5f7;
}
.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aa3ad;
  animation: tb-typing 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tb-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.tb-mode-hint {
  margin: 0;
  color: #9aa3ad;
  font-size: 9px;
  line-height: 1.5;
}
.taobao-support .chat-system {
  align-self: center;
  max-width: 90%;
  margin: 0 auto;
  padding: 5px 9px;
  border-radius: 3px;
  background: #f7f8fa;
  color: #8b949e;
  font-size: 9px;
  text-align: center;
}

.role-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  padding: 20px;
  border: 1px solid #e3e5e8;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2328;
  box-shadow: 0 24px 70px rgba(20, 30, 40, 0.22);
}
.role-dialog::backdrop { background: rgba(24, 30, 36, 0.35); }
.role-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-dialog-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.role-dialog-close {
  width: 28px;
  height: 28px;
  border: 1px solid #e3e5e8;
  border-radius: 3px;
  background: #ffffff;
  color: #5d6a78;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.role-dialog-copy { margin: 8px 0 10px; color: #7b858f; font-size: 11px; line-height: 1.6; }
.role-dialog textarea {
  width: 100%;
  min-height: 240px;
  padding: 10px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  background: #fbfcfd;
  color: #303840;
  font: inherit;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}
.role-dialog textarea:focus { outline: none; border-color: #ff5000; box-shadow: 0 0 0 2px rgba(255, 80, 0, 0.1); }
.role-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.role-status { min-height: 16px; margin: 0; color: #7b858f; font-size: 10px; }
.role-status[data-state="error"] { color: #e5482f; }
.role-status[data-state="ok"] { color: #289b5a; }
.role-save {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  background: #ff5000;
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.role-save:hover { background: #e84800; }
.role-save:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 860px) {
  .tb-chat-actions { gap: 5px; }
  .tb-human { font-size: 9px; padding: 0 8px; }
}
/* Generic support entry: no product context. */
.tb-product[hidden] { display: none; }
.support-generic {
  margin: 14px 18px 0;
  padding: 16px 18px;
  border: 1px solid #eceef1;
  border-radius: 6px;
  background: #fbfcfd;
}
.support-generic[hidden] { display: none; }
.support-generic-kicker { margin: 0; color: #ff5000; font-size: 8px; letter-spacing: 0.14em; }
.support-generic h2 { margin: 5px 0 4px; color: #1f2328; font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: -0.03em; }
.support-generic p:not(.support-generic-kicker) { margin: 0; color: #7b858f; font-size: 11px; line-height: 1.55; }
.support-segments { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.support-segments button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #ffd1bd;
  border-radius: 3px;
  background: #fff7f3;
  color: #d94a1a;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.support-segments button:hover,
.support-segments button.is-active { border-color: #ff5000; background: #ff5000; color: #ffffff; }

@media (max-width: 860px) {
  .support-generic { margin: 9px 12px 0; padding: 13px; }
  .support-generic h2 { font-size: 18px; }
}
/* Social contact links in the support sidebar. */
.tb-social {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid #eceef1;
}
.tb-social p {
  margin: 0 0 6px;
  color: #9aa3ad;
  font-size: 10px;
}
.tb-social a {
  display: block;
  overflow: hidden;
  color: #4a535c;
  font-size: 9px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-social a:hover { color: #ff5000; }
/* "Guess you like" recommendations in the support sidebar. */
.tb-reco {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid #eceef1;
}
.tb-reco[hidden] { display: none; }
.tb-reco-head span { color: #ff5000; font-size: 8px; letter-spacing: 0.12em; }
.tb-reco-head h2 { margin: 3px 0 0; color: #1f2328; font-family: var(--serif); font-size: 16px; font-weight: 400; letter-spacing: -0.02em; }
.tb-reco-head p { margin: 3px 0 8px; color: #9aa3ad; font-size: 9px; line-height: 1.45; }
.tb-reco-list { display: grid; gap: 6px; }
.tb-reco-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 5px;
  border: 1px solid #eceef1;
  border-radius: 4px;
  background: #ffffff;
}
.tb-reco-card img { width: 38px; height: 38px; object-fit: contain; background: #f5f7f9; }
.tb-reco-info { min-width: 0; }
.tb-reco-info strong { display: block; overflow: hidden; color: #303840; font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.tb-reco-info span { display: block; margin-top: 2px; color: #9aa3ad; font-size: 8px; }
.tb-reco-open {
  width: 100%;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d94a1a;
  font: inherit;
  font-size: 8px;
  text-align: left;
  cursor: pointer;
}
.tb-reco-open:hover { text-decoration: underline; text-underline-offset: 2px; }
.taobao-support .tb-product-stock {
  display: inline-block;
  width: fit-content;
  margin: 2px 0 0;
  padding: 2px 6px;
  border-radius: 2px;
  background: #f2f4f6;
  color: #8b97a3;
  font-size: 9px;
  font-style: normal;
}
.taobao-support .tb-product-stock[hidden] { display: none; }
/* Larger support sidebar + hot product cards. */
.taobao-support .tb-layout { grid-template-columns: 310px minmax(0, 1fr); }
.taobao-support .tb-sidebar { gap: 16px; padding: 18px 16px; }
.taobao-support .tb-reco { margin-top: 4px; padding-top: 14px; }
.taobao-support .tb-reco-head span { font-size: 10px; letter-spacing: 0.14em; }
.taobao-support .tb-reco-head h2 { margin-top: 4px; font-size: 22px; }
.taobao-support .tb-reco-head p { margin: 4px 0 12px; font-size: 11px; line-height: 1.5; }
.taobao-support .tb-reco-list { gap: 10px; }
.taobao-support .tb-reco-card {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border-radius: 5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.taobao-support .tb-reco-card:hover { border-color: #ffb095; background: #fffaf7; }
.taobao-support .tb-reco-card img { width: 70px; height: 70px; }
.taobao-support .tb-reco-info strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #1f2328;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}
.taobao-support .tb-reco-info span { margin-top: 4px; font-size: 10px; line-height: 1.4; }
.taobao-support .tb-reco-open { margin-top: 5px; font-size: 10px; font-weight: 500; }
@media (max-width: 900px) {
  .taobao-support .tb-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .taobao-support .tb-reco-card { grid-template-columns: 58px minmax(0, 1fr); }
  .taobao-support .tb-reco-card img { width: 58px; height: 58px; }
}

@media (max-width: 600px) {
  .taobao-support .tb-layout { grid-template-columns: minmax(0, 1fr); }
  .taobao-support .tb-sidebar { display: none; }
  .taobao-support .tb-main { min-width: 0; }
  .tb-personas { padding: 6px 8px; gap: 6px; }
  .tb-persona { padding: 3px 4px; font-size: 9px; }
  .tb-persona img { width: 26px; height: 26px; }
  .tb-fields { grid-template-columns: 1fr; }
  .chat-bubble-wrap { max-width: 92%; }
  .tb-composer { padding: 8px 10px; }
}

/* ---------- 接待人格切换 ---------- */

.tb-personas {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-bottom: 1px solid #eceef1;
  background: #fffdfb;
  overflow-x: auto;
  scrollbar-width: none;
}
.tb-personas::-webkit-scrollbar { display: none; }
.tb-personas-label {
  flex: 0 0 auto;
  color: #9aa3ad;
  font-size: 10px;
  letter-spacing: 0.08em;
}
.tb-persona-list { display: flex; gap: 8px; }
.tb-persona {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #6b747d;
  font: inherit;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tb-persona img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px #eceef1;
}
.tb-persona:hover { background: #fff4ee; }
.tb-persona.is-active {
  border-color: #ffd1bd;
  background: #fff4ee;
  color: #ff5000;
}
.tb-persona.is-active img { box-shadow: 0 0 0 2px #ff5000; }
.tb-persona-gender {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: #f1f5f9;
}
.tb-persona-gender button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 4px 9px;
  color: #6b747d;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.tb-persona-gender button.is-active {
  background: #ffffff;
  color: #ff5000;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.tb-avatar img,
.chat-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

@media (max-width: 640px) {
  .tb-personas { padding: 6px 12px; }
  .tb-persona { padding: 3px 5px; }
}

/* ---------- 单件购买：确认后才给链接 ---------- */

.chat-buy-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #ff5000;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 80, 0, 0.25);
}
.chat-buy-link:hover { filter: brightness(1.05); }

.buy-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.buy-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #eceef1;
  border-radius: 8px;
  background: #ffffff;
  color: #333333;
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
}
.buy-pick:hover { border-color: #ffb095; background: #fffaf7; }
.buy-pick img { width: 42px; height: 42px; object-fit: contain; flex: 0 0 auto; }
.buy-pick span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}


