/* ==========================================================================
   私信
   ========================================================================== */
.messages-page { max-width: 980px; padding-bottom: 60px; }
.msg-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
}
.msg-threads {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.thread-item {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 0.16s ease;
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: rgba(var(--ink-rgb), 0.03); }
.thread-item.active { background: rgba(180, 83, 9, 0.08); }
.thread-item .avatar { width: 32px; height: 32px; font-size: 13px; }
.thread-text { min-width: 0; flex: 1; }
.thread-text strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-text em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.thread-unread {
  align-self: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.msg-main {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.msg-head strong { font-size: 15px; }
.msg-head .muted { font-size: 12px; }

.msg-list {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
}
.msg-bubble {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-bubble.mine {
  align-self: flex-end;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.2);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 10.5px;
  color: var(--faint);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.msg-bubble.mine + .msg-time { text-align: right; }

.msg-form {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  align-items: flex-end;
}
.msg-form textarea {
  flex: 1;
  min-height: 56px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}
.msg-form textarea:focus {
  outline: none;
  border-color: rgba(180, 83, 9, 0.5);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}

@media (max-width: 760px) {
  .msg-layout { grid-template-columns: 1fr; }
  .msg-main { min-height: 420px; }
  .msg-bubble { max-width: 88%; }
}

/* 私信里显示对方的待兑换奖品 */
.msg-pending {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(180, 83, 9, 0.06);
}
.msg-pending-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.06em;
}
.msg-pending-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(180, 83, 9, 0.24);
  background: var(--surface);
  font-size: 12.5px;
}
.msg-pending-item strong { font-weight: 700; }
.msg-pending-item .btn { padding: 4px 10px; font-size: 11.5px; }
