/* ========== social.css ========== */

/* ===== 通用空状态 ===== */
.social-empty {
  text-align: center;
  padding: 50px 20px;
}
.social-empty svg {
  width: 48px;
  height: 48px;
  stroke: #c7c7cc;
  fill: none;
  stroke-width: 1.2;
  margin-bottom: 14px;
}
.social-empty p {
  font-size: 14px;
  color: #8e8e93;
  line-height: 1.6;
}

/* ===== 分组标签头部 ===== */
.social-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}
.social-tab-title {
  font-size: 17px;
  font-weight: 700;
  color: #1d1d1f;
}
.social-tab-action {
  width: 32px;
  height: 32px;
  border: none;
  background: #f2f2f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.social-tab-action:active { background: #e5e5ea; }
.social-tab-action svg {
  width: 16px;
  height: 16px;
  stroke: #1d1d1f;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

#imsgTabMoments > .social-tab-header {
  display: none !important;
}

/* ===== Group Card ===== */
.group-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ececec;
  margin-bottom: 10px;
  overflow: hidden;
}
.group-card-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background .15s;
}
.group-card-header:active { background: #f9f9fb; }
.group-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f2f2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.group-card-icon svg {
  width: 22px;
  height: 22px;
  stroke: #636366;
  fill: none;
  stroke-width: 1.5;
}
.group-card-info {
  flex: 1;
  min-width: 0;
}
.group-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
}
.group-card-count {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}
.group-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.group-more-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.group-more-btn:active { background: #f2f2f7; }
.group-more-btn svg {
  width: 16px;
  height: 16px;
  stroke: #8e8e93;
  fill: #8e8e93;
  stroke-width: 0;
}
.group-expand-arrow {
  display: flex;
  align-items: center;
  transition: transform .2s;
}
.group-expand-arrow svg {
  width: 16px;
  height: 16px;
  stroke: #c7c7cc;
  fill: none;
  stroke-width: 2;
}
.group-expand-arrow.expanded { transform: rotate(90deg); }

/* ===== Group Char List ===== */
.group-char-list {
  border-top: 1px solid #f2f2f7;
  padding: 6px 0;
}
.group-char-empty {
  padding: 14px 16px;
  text-align: center;
  font-size: 13px;
  color: #c7c7cc;
}
.group-char-item {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 24px;
  gap: 10px;
}
.group-char-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.group-char-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.group-char-av svg {
  width: 18px;
  height: 18px;
  stroke: #8e8e93;
  fill: none;
  stroke-width: 1.5;
}
.group-char-name {
  flex: 1;
  font-size: 14px;
  color: #1d1d1f;
  cursor: pointer;
}
.group-char-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .4;
  transition: opacity .15s;
}
.group-char-remove:active { opacity: 1; }
.group-char-remove svg {
  width: 12px;
  height: 12px;
  stroke: #ff3b30;
  fill: none;
  stroke-width: 2;
}

/* ===== Add Char to Group Modal ===== */
.add-char-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid #f2f2f7;
  transition: background .12s;
}
.add-char-row:active { background: #f2f2f7; }
.add-char-check {
  width: 22px;
  height: 22px;
  border: 2px solid #d1d1d6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.add-char-check.checked {
  background: #1d1d1f;
  border-color: #1d1d1f;
}
.add-char-check svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}
.add-char-check.checked svg { display: block; }
.add-char-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.add-char-av img { width: 100%; height: 100%; object-fit: cover; }
.add-char-av svg { width: 18px; height: 18px; stroke: #8e8e93; fill: none; stroke-width: 1.5; }
.add-char-row span { font-size: 15px; color: #1d1d1f; }

/* ===== Moment Compose Bar ===== */
.moment-compose-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ececec;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .15s;
}
.moment-compose-bar:active { background: #f9f9fb; }
.moment-compose-bar svg {
  width: 28px;
  height: 28px;
  stroke: #8e8e93;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  flex-shrink: 0;
}
.moment-compose-bar span {
  font-size: 15px;
  color: #8e8e93;
}

/* ===== Moment Card ===== */
.moment-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ececec;
  margin-bottom: 12px;
  overflow: hidden;
}
.moment-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 0;
  gap: 10px;
}
.moment-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.moment-av img { width: 100%; height: 100%; object-fit: cover; }
.moment-av svg { width: 22px; height: 22px; stroke: #8e8e93; fill: none; stroke-width: 1.5; }
.moment-meta { flex: 1; min-width: 0; }
.moment-name {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  cursor: pointer;
}
.moment-time {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 1px;
}
.moment-delete-btn {
  width: 24px; height: 24px;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: .3;
  transition: opacity .15s;
}
.moment-delete-btn:active { opacity: .8; }
.moment-delete-btn svg {
  width: 12px; height: 12px;
  stroke: #8e8e93; fill: none; stroke-width: 2;
}
.moment-body {
  padding: 10px 16px 12px;
  font-size: 15px;
  color: #3a3a3c;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.moment-expand-btn {
  border: none;
  background: none;
  color: #636366;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  font-weight: 500;
}
.moment-expand-btn:active { opacity: .6; }

/* ===== Moment Image ===== */
.moment-image {
  padding: 0 16px 12px;
}
.moment-image img {
  width: 100%;
  max-height: 320px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* ===== Moment Actions Bar ===== */
.moment-actions-bar {
  display: flex;
  gap: 16px;
  padding: 0 16px 10px;
}
.moment-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 0;
  color: #3a3a3c;
  transition: all .15s;
}
.moment-action-btn:active { opacity: .6; }
.moment-action-btn svg {
  width: 18px;
  height: 18px;
  stroke: #1d1d1f;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all .2s;
}
.moment-action-btn span {
  font-size: 13px;
  color: #8e8e93;
}
.moment-action-btn.liked svg {
  stroke: #ff3b30;
  fill: #ff3b30;
}
.moment-action-btn.liked span { color: #ff3b30; }

/* ===== Moment Comments ===== */
.moment-comments {
  border-top: 1px solid #f2f2f7;
  padding: 8px 16px;
  background: #fafafa;
}
.moment-comment-item {
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
}
.mci-name {
  font-weight: 600;
  color: #1d1d1f;
  margin-right: 6px;
  cursor: pointer;
}
.mci-text { color: #3a3a3c; }
.moment-comment-input {
  display: none;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  border-top: 1px solid #f2f2f7;
  background: #fafafa;
}
.moment-comment-input input {
  flex: 1;
  border: 1px solid #e5e5ea;
  border-radius: 18px;
  padding: 7px 14px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #1d1d1f;
}
.moment-comment-input button {
  width: 30px;
  height: 30px;
  border: none;
  background: #f2f2f7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.moment-comment-input button:active { background: #e5e5ea; }
.moment-comment-input button svg {
  width: 14px; height: 14px;
}

/* ===== New Moment Modal — 图片类型标签 ===== */
.moment-type-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.moment-type-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  cursor: pointer;
  transition: all .15s;
}
.moment-type-tab svg {
  stroke: #636366;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moment-type-tab.active {
  background: #1d1d1f;
  color: #fff;
  border-color: #1d1d1f;
}
.moment-type-tab.active svg {
  stroke: #fff;
}
.moment-type-tab:active { opacity: .7; }

/* ===== 上传区域 ===== */
.moment-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding: 28px 16px;
  border: 2px dashed #d1d1d6;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.moment-upload-area:active { border-color: #8e8e93; }
.moment-upload-area svg {
  stroke: #8e8e93;
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.moment-upload-area p {
  font-size: 13px;
  color: #8e8e93;
  margin: 0;
}

/* ===== 图片预览 ===== */
.moment-preview {
  position: relative;
  margin-top: 10px;
}
.moment-preview img {
  width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}
.moment-preview-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0,0,0,.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.moment-preview-clear svg {
  width: 10px;
  height: 10px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
}

/* ===== 虚拟图片选择网格 ===== */
.virtual-image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.virtual-image-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .12s;
  text-align: center;
}
.virtual-image-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.virtual-image-item span {
  display: block;
  font-size: 10px;
  color: #636366;
  padding: 3px 0;
  background: #f8f8f8;
}
.virtual-image-item.selected {
  border-color: #1d1d1f;
  transform: scale(.95);
}
.virtual-image-item:active {
  transform: scale(.92);
}

/* ===== New Group / New Moment 模态框通用 ===== */
.social-modal {
  max-width: 320px;
  width: 88%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
  animation: modalZoomIn .22s ease;
  overflow: hidden;
}
.social-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}
.social-modal .modal-header span {
  font-size: 17px;
  font-weight: 700;
  color: #1d1d1f;
}
.social-modal-body {
  padding: 0 20px 20px;
}
.social-modal-body input,
.social-modal-body textarea,
.social-modal-body select {
  width: 100%;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  color: #1d1d1f;
  background: #fafafa;
  font-family: inherit;
  resize: none;
  box-sizing: border-box;
}
.social-modal-body textarea { min-height: 100px; }
.social-modal-body select {
  margin-top: 10px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%238e8e93' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.social-modal-actions {
  display: flex;
  border-top: 1px solid #f2f2f7;
}
.social-modal-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.social-modal-actions button:first-child {
  color: #8e8e93;
  border-right: 1px solid #f2f2f7;
}
.social-modal-actions button:first-child:active { background: #f2f2f7; }
.social-modal-actions button:last-child { color: #1d1d1f; }
.social-modal-actions button:last-child:active { background: #f2f2f7; }

/* ===== Add char to group modal body ===== */
.add-char-modal-body {
  max-height: 300px;
  overflow-y: auto;
}
.add-char-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #f2f2f7;
  text-align: right;
}
.add-char-modal-footer button {
  padding: 8px 20px;
  border: none;
  background: #1d1d1f;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.add-char-modal-footer button:active { opacity: .8; }

/* ===== Group Context Menu ===== */
.group-context-menu {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
  min-width: 160px;
  overflow: hidden;
  opacity: 0;
  transform: scale(.92);
  transform-origin: top right;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.group-context-menu.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.group-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .12s;
  font-size: 14px;
  color: #1d1d1f;
}
.group-context-item:active {
  background: #f2f2f7;
}
.group-context-item + .group-context-item {
  border-top: 1px solid #f2f2f7;
}
.group-context-item svg {
  width: 18px;
  height: 18px;
  stroke: #636366;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.group-context-danger {
  color: #ff3b30;
}
.group-context-danger svg {
  stroke: #ff3b30;
}

/* ===== 聊天右上角三点菜单 ===== */
.chat-dropdown-wrap {
  position: relative;
}
.chat-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1100;
  min-width: 180px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.14), 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
  opacity: 0;
  transform: scale(.92) translateY(-4px);
  transform-origin: top right;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.chat-dropdown.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.chat-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .12s;
  font-size: 14px;
  color: #1d1d1f;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.chat-dropdown-item:active { background: #f2f2f7; }
.chat-dropdown-item + .chat-dropdown-item { border-top: 1px solid #f2f2f7; }
.chat-dropdown-item svg {
  width: 18px; height: 18px;
  stroke: #636366; fill: none;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.chat-dropdown-item.danger { color: #ff3b30; }
.chat-dropdown-item.danger svg { stroke: #ff3b30; }


/* ============================================================
   ★ 虚拟图片交互样式（点击切换渐变/灰底文字）
   ============================================================ */

/* 虚拟图片容器 */
.moment-virtual-img {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.moment-virtual-img img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  transition: opacity .25s ease;
}

/* 文字遮罩层 — 默认隐藏 */
.virtual-text-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e5ea;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transition: opacity .2s ease;
}

.virtual-text-overlay span {
  font-size: 14px;
  font-weight: 500;
  color: #3a3a3c;
  line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
}

/* 点击后显示文字 */
.moment-virtual-img.revealed .virtual-text-overlay {
  display: flex;
}

.moment-virtual-img.revealed > img {
  opacity: 0;
}

/* 点击提示 — 未展开时在右下角显示小图标 */
.moment-virtual-img::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23636366' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 8h10M8 3v10'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  transition: opacity .2s;
}

.moment-virtual-img.revealed::after {
  opacity: 0;
}

/* ★ 发布弹窗中虚拟图片文字输入框 */
.moment-virtual-text-wrap {
  margin-top: 10px;
  margin-bottom: 4px;
}

.moment-virtual-text-wrap input {
  width: 100%;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  color: #1d1d1f;
  background: #fafafa;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .15s;
}

.moment-virtual-text-wrap input:focus {
  border-color: #8e8e93;
}

.moment-virtual-text-wrap input::placeholder {
  color: #c7c7cc;
}
