/* 私信 MVP */
.chat-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.chat-head__back {
  color: var(--dxs-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 4px;
}

.chat-head__title {
  flex: 1;
  min-width: 0;
}

.chat-head__title strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head__title span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-goods {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 12px 0;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.chat-goods img,
.chat-goods__ph {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f3ec;
  flex-shrink: 0;
}

.chat-goods__ph {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}

.chat-goods__meta {
  min-width: 0;
  flex: 1;
}

.chat-goods__meta strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-goods__meta span {
  display: block;
  margin-top: 4px;
  color: var(--dxs-seal);
  font-weight: 700;
  font-size: 14px;
}

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

.chat-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  align-self: flex-start;
}

.chat-bubble--mine {
  align-self: flex-end;
  background: #d9f5e8;
  border-color: rgba(12, 61, 46, 0.12);
}

.chat-bubble--system {
  align-self: center;
  max-width: 90%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 4px 8px;
}

.chat-bubble__time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.chat-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 6;
}

.chat-composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 15px;
  background: #f7fbf8;
  color: var(--text);
}

.chat-composer button {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--dxs-ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.chat-composer button:disabled {
  opacity: 0.5;
}

/* 会话列表 */
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 12px 0 80px;
}

.msg-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}

.msg-row:last-child {
  border-bottom: 0;
}

.msg-row__avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #e8f3ec;
  object-fit: cover;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
}

.msg-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-row__main {
  flex: 1;
  min-width: 0;
}

.msg-row__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.msg-row__top strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-row__top time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.msg-row__preview {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.msg-row__preview span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d94848;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

button.me-shortcut {
  position: relative;
}

.me-shortcut__badge {
  position: absolute;
  top: 2px;
  right: 10%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d94848;
  color: #fff;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  display: none;
  place-items: center;
  line-height: 1;
}

.me-shortcut__badge.is-on {
  display: inline-grid;
}
