/* Toast 通知 */
.moment-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
  backdrop-filter: blur(6px);
}
.moment-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.moment-toast.is-loading {
  background: rgba(30, 30, 30, 0.85);
}
.moment-toast.is-success {
  background: rgba(34, 139, 34, 0.85);
}
.moment-toast.is-error {
  background: rgba(200, 50, 50, 0.85);
}
.moment-toast .toast-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: toastSpin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes toastSpin {
  to { transform: rotate(360deg); }
}

/* ========================================
   Moments CSS - 朋友圈 / 动态空间
   移动端优先 · iOS-like · 干净轻量
   ======================================== */

:root {
  --moments-bg: #f7f7f8;
  --moments-card-bg: #ffffff;
  --moments-text-main: #1f1f1f;
  --moments-text-sub: #8a8a8a;
  --moments-border: rgba(0, 0, 0, 0.06);
  --moments-soft-bg: #f2f2f3;
  --moments-active: #111111;
  --moments-radius-lg: 18px;
  --moments-radius-md: 12px;
}

/* ======== 页面容器 ======== */
.moments-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--moments-bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.moments-screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* ======== 顶部导航栏 ======== */
.moments-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--moments-border);
  min-height: 44px;
}

.moments-back-btn,
.moments-publish-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.moments-back-btn:active,
.moments-publish-btn:active {
  background: var(--moments-soft-bg);
}

.moments-back-btn svg,
.moments-publish-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--moments-text-main);
}

.moments-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.moments-generate-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.moments-generate-btn:active {
  background: var(--moments-soft-bg);
}

.moments-generate-btn svg {
  width: 19px;
  height: 19px;
  stroke: var(--moments-text-main);
}

.moments-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--moments-text-main);
}

/* ======== 可滚动内容区 ======== */
.moments-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ======== 封面区域 ======== */
.moments-cover {
  position: relative;
  width: 100%;
  height: 200px;
  margin-bottom: 40px;
}

.moments-cover-bg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e0d8 0%, #d4ccc4 50%, #c8bfb5 100%);
  object-fit: cover;
}

.moments-profile {
  position: absolute;
  bottom: -32px;
  right: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.moments-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moments-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moments-profile-avatar svg {
  width: 32px;
  height: 32px;
  stroke: #999;
}

.moments-profile-info {
  padding-bottom: 6px;
  text-align: right;
}

.moments-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin: 0;
}

.moments-profile-signature {
  font-size: 12px;
  color: var(--moments-text-sub);
  margin: 2px 0 0;
}

/* ======== 动态列表 ======== */
.moments-feed {
  padding: 0 0 40px;
}

.moment-item {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--moments-border);
}

.moment-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--moments-soft-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.moment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-avatar-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.moment-avatar svg {
  width: 22px;
  height: 22px;
  stroke: #aaa;
}

.moment-body {
  flex: 1;
  min-width: 0;
}

.moment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.moment-name {
  font-size: 14px;
  font-weight: 600;
  color: #576b95;
}

.moment-time {
  font-size: 11px;
  color: var(--moments-text-sub);
}

.moment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--moments-text-main);
  margin: 0 0 8px;
  word-break: break-word;
}

/* ======== 图片区域 ======== */
.moment-images {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  max-width: 260px;
}

.moment-images[data-count="1"] {
  grid-template-columns: 1fr;
  max-width: 180px;
}

.moment-images[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.moment-images[data-count="3"] {
  grid-template-columns: 1fr 1fr 1fr;
}

.moment-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--moments-soft-bg);
}

.moment-images[data-count="1"] .moment-image {
  aspect-ratio: 4/3;
  border-radius: 10px;
}

.moment-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e4e0 0%, #d8d2cc 100%);
}

/* ======== 操作按钮 ======== */
.moment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 6px 0 8px;
}

.moment-action-btn {
  border: none;
  background: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
}

.moment-action-btn:active {
  background: var(--moments-soft-bg);
}

.moment-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: #999;
  fill: none;
}

.moment-like-btn.is-liked svg {
  stroke: #e74c3c;
  fill: #e74c3c;
}

/* ======== 点赞 & 评论区 ======== */
.moment-social {
  background: var(--moments-soft-bg);
  border-radius: 6px;
  overflow: hidden;
}

.moment-likes {
  padding: 6px 10px;
  font-size: 12px;
  color: #576b95;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.moment-likes-icon {
  width: 12px;
  height: 12px;
  fill: #576b95;
  flex-shrink: 0;
}

.moment-likes + .moment-comments {
  border-top: 1px solid var(--moments-border);
}

.moment-comments {
  padding: 6px 10px;
}

.moment-comment {
  font-size: 12px;
  line-height: 1.6;
  color: var(--moments-text-main);
  margin-bottom: 2px;
}

.moment-comment:last-child {
  margin-bottom: 0;
}

.moment-comment-name {
  font-weight: 600;
  color: #576b95;
}

.moment-comment-reply {
  color: var(--moments-text-sub);
  margin: 0 2px;
}

/* ======== 图片选择弹窗 ======== */
.moments-cover-bg {
  cursor: pointer;
  transition: opacity 0.15s;
}

.moments-cover-bg:active {
  opacity: 0.85;
}

.moments-profile-avatar {
  cursor: pointer;
  transition: transform 0.15s;
}

.moments-profile-avatar:active {
  transform: scale(0.95);
}

.moments-img-picker-mask {
  position: fixed;
  inset: 0;
  z-index: 970;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.moments-img-picker-mask.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.moments-img-picker {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 980;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: calc(100% - 48px);
  max-width: 320px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.moments-img-picker.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.moments-img-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.moments-img-picker-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--moments-text-main);
}

.moments-img-picker-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.moments-img-picker-close:active {
  background: var(--moments-soft-bg);
}

.moments-img-picker-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--moments-text-sub);
}

.moments-img-picker-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.moments-img-picker-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: var(--moments-soft-bg);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--moments-text-main);
  transition: background 0.15s;
  text-align: left;
}

.moments-img-picker-opt:active {
  background: #e8e8e9;
}

.moments-img-picker-opt svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: var(--moments-text-sub);
}

.moments-img-picker-url-input {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.moments-img-url-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--moments-border);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--moments-soft-bg);
  color: var(--moments-text-main);
  transition: border-color 0.15s;
}

.moments-img-url-input:focus {
  border-color: var(--moments-active);
}

.moments-img-url-confirm {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--moments-active);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.moments-img-url-confirm:active {
  opacity: 0.7;
}

/* ======== 角色选择生成面板 ======== */
.moment-generate-mask {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.moment-generate-mask.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.moment-generate-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 960;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.moment-generate-panel.is-visible {
  transform: translateY(0);
}

.moment-generate-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.moment-generate-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--moments-text-main);
}

.moment-generate-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.moment-generate-panel-close:active {
  background: var(--moments-soft-bg);
}

.moment-generate-panel-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--moments-text-sub);
}

.moment-generate-panel-desc {
  font-size: 13px;
  color: var(--moments-text-sub);
  margin: 0 0 14px;
}

.moment-generate-char-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
}

.moment-generate-char-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.moment-generate-char-item:active {
  background: var(--moments-soft-bg);
}

.moment-generate-char-item.is-selected {
  background: var(--moments-soft-bg);
}

.moment-generate-char-item.is-selected::after {
  content: '';
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--moments-active);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

.moment-generate-char-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--moments-soft-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.moment-generate-char-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-generate-char-avatar svg {
  width: 20px;
  height: 20px;
  stroke: #aaa;
}

.moment-generate-char-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--moments-text-main);
}

.moment-generate-char-empty {
  text-align: center;
  color: var(--moments-text-sub);
  padding: 24px 0;
  font-size: 13px;
}

/* 聊天记录条数设置 */
.moment-generate-context-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--moments-border);
  margin-top: 8px;
}
.moment-generate-context-label {
  font-size: 13px;
  color: var(--moments-text-main);
}
.moment-generate-context-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.moment-generate-context-minus,
.moment-generate-context-plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--moments-border);
  background: var(--moments-soft-bg);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--moments-text-main);
  transition: background 0.15s;
}
.moment-generate-context-minus:active,
.moment-generate-context-plus:active {
  background: #e0e0e0;
}
.moment-generate-context-value {
  font-size: 15px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  color: var(--moments-text-main);
}
.moment-generate-context-unit {
  font-size: 12px;
  color: var(--moments-text-sub);
}

.moment-generate-actions {
  padding-top: 10px;
  border-top: 1px solid var(--moments-border);
}

.moment-generate-confirm {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--moments-active);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.moment-generate-confirm:active {
  opacity: 0.7;
}

.moment-generate-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ======== 发布抽屉 ======== */
.moment-compose-mask {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.moment-compose-mask.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.moment-compose-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 960;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 80vh;
  overflow-y: auto;
}

.moment-compose-mask.is-visible + .moment-compose-drawer,
.moment-compose-drawer.is-visible {
  transform: translateY(0);
}

.moment-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.moment-compose-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--moments-text-main);
  margin: 0;
}

.moment-compose-cancel,
.moment-compose-submit {
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.moment-compose-cancel {
  color: var(--moments-text-sub);
}

.moment-compose-submit {
  color: #fff;
  background: var(--moments-active);
  font-weight: 500;
}

.moment-compose-cancel:active,
.moment-compose-submit:active {
  opacity: 0.7;
}

.moment-compose-textarea {
  width: 100%;
  min-height: 100px;
  border: none;
  outline: none;
  resize: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--moments-text-main);
  background: var(--moments-soft-bg);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.moment-compose-textarea::placeholder {
  color: var(--moments-text-sub);
}

/* 添加图片描述按钮 */
.moment-compose-add-image {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px dashed #ccc;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  color: var(--moments-text-sub);
  font-size: 13px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.moment-compose-add-image:active {
  border-color: var(--moments-active);
}

.moment-compose-add-image svg {
  width: 20px;
  height: 20px;
  stroke: #bbb;
  flex-shrink: 0;
}

/* 已添加的图片描述列表 */
.moment-compose-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.moment-compose-img-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--moments-soft-bg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--moments-text-main);
  max-width: 100%;
}

.moment-compose-img-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.moment-compose-img-remove {
  border: none;
  background: none;
  font-size: 16px;
  color: var(--moments-text-sub);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.moment-compose-img-remove:active {
  color: #e53e3e;
}

/* 动态中的图片描述占位 */
.moment-image-desc {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  position: relative;
}

.moment-image-desc span {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.moment-image-desc.is-revealed span {
  opacity: 1;
}

.moment-compose-visibility {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--moments-text-sub);
  margin-bottom: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--moments-border);
}

.moment-compose-visibility-label {
  font-weight: 500;
  color: var(--moments-text-main);
}

.moment-compose-visibility-options {
  display: flex;
  gap: 8px;
}

.moment-compose-visibility-opt {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  background: var(--moments-soft-bg);
  color: var(--moments-text-sub);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.moment-compose-visibility-opt.is-active {
  background: var(--moments-active);
  color: #fff;
}

/* ======== 分组/角色选择面板 ======== */
.moment-select-mask {
  position: fixed;
  inset: 0;
  z-index: 970;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.moment-select-mask.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.moment-select-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 980;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

.moment-select-drawer.is-visible {
  transform: translateY(0);
}

.moment-select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.moment-select-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--moments-text-main);
}

.moment-select-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.moment-select-close:active {
  background: var(--moments-soft-bg);
}

.moment-select-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--moments-text-sub);
}

.moment-select-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 14px;
}

.moment-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.moment-select-item:active {
  background: var(--moments-soft-bg);
}

.moment-select-item.is-checked {
  background: var(--moments-soft-bg);
}

.moment-select-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moment-select-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--moments-soft-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.moment-select-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-select-item-avatar svg {
  width: 20px;
  height: 20px;
  stroke: #aaa;
}

.moment-select-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.moment-select-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--moments-text-main);
}

.moment-select-item-desc {
  font-size: 12px;
  color: var(--moments-text-sub);
}

.moment-select-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.moment-select-item.is-checked .moment-select-check {
  background: var(--moments-active);
}

.moment-select-actions {
  padding-top: 10px;
  border-top: 1px solid var(--moments-border);
}

.moment-select-confirm {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--moments-active);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.moment-select-confirm:active {
  opacity: 0.7;
}

/* ======== 可见范围标签 ======== */
.moment-visibility-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--moments-soft-bg);
  color: var(--moments-text-sub);
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.4;
}

.moment-visibility-tag.private {
  color: #e67e22;
  background: rgba(230, 126, 34, 0.1);
}

.moment-visibility-tag.group {
  color: #2980b9;
  background: rgba(41, 128, 185, 0.1);
}

.moment-visibility-tag.friends {
  color: #8e44ad;
  background: rgba(142, 68, 173, 0.1);
}

/* ======== 评论输入栏 ======== */
.moment-comment-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--moments-border);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.moment-comment-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.moment-comment-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--moments-border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  background: var(--moments-soft-bg);
  color: var(--moments-text-main);
  transition: border-color 0.15s;
}

.moment-comment-input:focus {
  border-color: var(--moments-active);
}

.moment-comment-input::placeholder {
  color: var(--moments-text-sub);
}

.moment-comment-send {
  padding: 8px 16px;
  border: none;
  border-radius: 18px;
  background: var(--moments-active);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.moment-comment-send:active {
  opacity: 0.7;
}

/* ======== 回复目标可点击 ======== */
.moment-reply-target {
  cursor: pointer;
}

.moment-reply-target:active {
  opacity: 0.6;
}

/* 整条评论可点击回复 */
.moment-comment {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  padding: 1px 4px;
  margin: 0 -4px;
}

.moment-comment:active {
  background: rgba(0, 0, 0, 0.04);
}

/* ======== 空状态 ======== */
.moment-select-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--moments-text-sub);
  font-size: 13px;
  line-height: 1.8;
}

.moment-select-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ======== 生成回复按钮 ======== */
.moment-gen-reply-btn svg {
  width: 14px;
  height: 14px;
  stroke: #bbb;
  fill: none;
}

.moment-gen-reply-btn:active svg {
  stroke: var(--moments-active);
}

/* ======== 更多菜单（删除） ======== */
.moment-more-menu {
  z-index: 100;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 4px;
  min-width: 100px;
  animation: momentMenuFadeIn 0.15s ease;
}

@keyframes momentMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.moment-more-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  color: #e53e3e;
  cursor: pointer;
  transition: background 0.15s;
}

.moment-more-menu-item:active {
  background: rgba(229, 62, 62, 0.06);
}

.moment-more-menu-item svg {
  stroke: #e53e3e;
  flex-shrink: 0;
}

/* 可删除评论长按提示 */
.moment-comment.is-deletable {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
  padding: 1px 4px;
  margin: 0 -4px;
}

.moment-comment.is-deletable:active {
  background: rgba(0, 0, 0, 0.04);
}

/* 正在输入提示 */
.moment-typing-indicator {
  color: var(--moments-text-sub);
  font-style: italic;
}

.moment-typing-indicator .moment-comment-name {
  font-style: normal;
}

.typing-dots .dot1,
.typing-dots .dot2,
.typing-dots .dot3 {
  animation: typingBlink 1.4s infinite;
  opacity: 0.2;
}

.typing-dots .dot1 { animation-delay: 0s; }
.typing-dots .dot2 { animation-delay: 0.2s; }
.typing-dots .dot3 { animation-delay: 0.4s; }

@keyframes typingBlink {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}
