/* 社区 v2 社交页签样式：找搭子 / 消息（通知 + 私信）。
 * 全部选择器使用 cs- 前缀，避免与广场（cm-/studio）和成长模块冲突。 */

.cs-partner,
.cs-message {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #2f3a34;
}

.cs-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #223b31;
}

.cs-panel-sub {
  margin: 0;
  font-size: 12px;
  color: #7b8981;
}

/* ── 找搭子筛选 ── */
.cs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #e2e9e4;
  border-radius: 10px;
  background: #f8faf8;
}

.cs-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
  font-size: 11px;
  color: #75847b;
}

.cs-filter-label {
  padding-left: 1px;
}

.cs-select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #d7e1da;
  border-radius: 7px;
  background-color: #fff;
  font-family: inherit;
  font-size: 13px;
  color: #344d40;
  cursor: pointer;
}

.cs-select:focus-visible {
  outline: 2px solid #9fb9aa;
  outline-offset: 1px;
}

/* ── 通用按钮 ── */
.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cs-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.cs-btn-primary {
  background: #28554a;
  border-color: #28554a;
  color: #fff;
}

.cs-btn-primary:hover:not(:disabled) {
  background: #1f453c;
}

.cs-btn-primary.is-following {
  background: #edf3ee;
  border-color: #c9d9cd;
  color: #4a6455;
}

.cs-btn-ghost {
  background: #fff;
  border-color: #d7e1da;
  color: #3b5444;
}

.cs-btn-ghost:hover:not(:disabled) {
  background: #f2f6f3;
}

.cs-btn-small {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.cs-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: #2f6b52;
  cursor: pointer;
}

.cs-link-btn:disabled {
  color: #a9b5ad;
  cursor: default;
}

/* ── 搭子卡片 ── */
.cs-partner-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-partner-card {
  padding: 16px;
  border: 1px solid #e2e9e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(33, 45, 62, 0.04);
}

.cs-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cs-card-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cs-card-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #223b31;
}

.cs-level {
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ee;
  font-size: 11px;
  line-height: 1.5;
  color: #4c6b57;
  white-space: nowrap;
}

.cs-card-meta {
  margin: 0;
  font-size: 12px;
  color: #7b8981;
}

.cs-card-target {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #55695c;
}

.cs-card-bio {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: #43564a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cs-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cs-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f6f2;
  border: 1px solid #dbe7de;
  font-size: 11px;
  color: #456050;
}

.cs-card-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cs-reason {
  padding: 3px 9px;
  border-radius: 6px;
  background: #fbf6ec;
  border: 1px solid #ecdfc8;
  font-size: 11px;
  color: #8a6a3d;
}

.cs-reason-muted {
  background: #f4f6f4;
  border-color: #e3e9e4;
  color: #8a968e;
}

.cs-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e6ece7;
}

.cs-empty-tip {
  margin: 0;
  padding: 4px 0 0;
  text-align: center;
  font-size: 12px;
  color: #93a097;
}

/* ── 未登录 / 错误 ── */
.cs-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  border: 1px dashed #dbe4dd;
  border-radius: 12px;
  background: #fafcfb;
}

.cs-login-text {
  margin: 0;
  font-size: 13px;
  color: #75847b;
}

.cs-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  border: 1px dashed #e3d9cb;
  border-radius: 12px;
  background: #fdfaf5;
}

.cs-error-text {
  margin: 0;
  font-size: 13px;
  color: #92794f;
}

/* ── 消息页分段 ── */
.cs-seg {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  border: 1px solid #e2e9e4;
  border-radius: 999px;
  background: #f4f7f4;
}

.cs-seg-btn {
  min-width: 84px;
  height: 32px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: #6d7d73;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cs-seg-btn.active {
  background: #fff;
  color: #223b31;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(33, 45, 62, 0.1);
}

.cs-message-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-list-tip {
  margin: 0;
  font-size: 12px;
  color: #93a097;
}

/* ── 通知列表 ── */
.cs-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cs-notice-count {
  font-size: 12px;
  color: #75847b;
}

.cs-notify-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6ece7;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.cs-notify-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2ef;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cs-notify-item:last-child {
  border-bottom: 0;
}

.cs-notify-item:hover {
  background: #fafcfb;
}

.cs-notify-item.is-unread {
  background: #f7fbf8;
}

.cs-notify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef4ee;
  font-size: 15px;
  color: #3f6350;
}

.cs-notify-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.cs-notify-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #33463b;
  overflow-wrap: anywhere;
}

.cs-notify-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-notify-time {
  font-size: 11px;
  color: #94a198;
}

.cs-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c2603f;
}

/* ── 会话列表 ── */
.cs-conv-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e6ece7;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.cs-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #eef2ef;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cs-conv-item:last-child {
  border-bottom: 0;
}

.cs-conv-item:hover {
  background: #fafcfb;
}

.cs-conv-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.cs-conv-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cs-conv-name {
  font-size: 14px;
  font-weight: 600;
  color: #223b31;
}

.cs-conv-time {
  flex: 0 0 auto;
  font-size: 11px;
  color: #9aa69e;
}

.cs-conv-last {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #7b8981;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-conv-badge {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c2603f;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}

/* ── 对话 ── */
.cs-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #e2e9e4;
  border-radius: 12px;
  background: #fbfdfb;
  overflow: hidden;
}

.cs-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #e6ece7;
  background: #fff;
}

.cs-back {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e0e8e2;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  color: #4a6455;
  cursor: pointer;
}

.cs-chat-peer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.cs-chat-name {
  font-size: 14px;
  font-weight: 600;
  color: #223b31;
}

.cs-chat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px;
  max-height: 420px;
  min-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d3cb transparent;
}

.cs-chat-body::-webkit-scrollbar {
  width: 5px;
}

.cs-chat-body::-webkit-scrollbar-thumb {
  background: #c8d3cb;
  border-radius: 5px;
}

.cs-msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 78%;
}

.cs-msg-row.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}

.cs-msg-time {
  align-self: center;
  margin: 8px 0 2px;
  font-size: 10px;
  color: #a1ada5;
}

.cs-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  background: #fff;
  border: 1px solid #e3ebe5;
  font-size: 13px;
  line-height: 1.6;
  color: #33463b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cs-msg-row.is-mine .cs-bubble {
  border-color: #28554a;
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  background: #28554a;
  color: #fff;
}

.cs-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e6ece7;
  background: #fff;
}

.cs-composer-input {
  flex: 1;
  min-height: 36px;
  max-height: 110px;
  padding: 8px 11px;
  border: 1px solid #d7e1da;
  border-radius: 8px;
  background: #fafcfb;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: #33463b;
  resize: vertical;
}

.cs-composer-input:focus-visible {
  outline: 2px solid #9fb9aa;
  outline-offset: 1px;
}

.cs-composer-count {
  flex: 0 0 auto;
  padding-bottom: 9px;
  font-size: 10px;
  color: #9aa69e;
  font-variant-numeric: tabular-nums;
}

.cs-send {
  flex: 0 0 auto;
}

/* ── 空态 / 加载继承共享组件（cm-empty / cm-loading） ── */
.cs-partner-list .cm-empty,
.cs-partner-list .cm-loading,
.cs-message-body .cm-empty,
.cs-message-body .cm-loading,
.cs-chat-body .cm-empty,
.cs-chat-body .cm-loading {
  padding: 34px 16px;
  text-align: center;
  font-size: 13px;
  color: #93a097;
}

/* ── 响应式 ── */
@media (max-width: 720px) {
  .cs-filters {
    padding: 12px;
  }

  .cs-filter-field {
    flex: 1 1 120px;
    min-width: 0;
  }

  .cs-select {
    width: 100%;
  }

  .cs-partner-card {
    padding: 13px;
  }

  .cs-msg-row {
    max-width: 88%;
  }

  .cs-chat-body {
    max-height: 340px;
    padding: 12px 10px;
  }

  .cs-notify-item,
  .cs-conv-item {
    padding: 12px;
  }
}
