/* ===== 仿微信 UI · 重制版 ===== */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

:root {
  --wx-green:       #07c160;
  --wx-green-dark:  #06ad56;
  --wx-bg:          #f5f5f5;
  --wx-white:       #ffffff;
  --wx-topbar:      #ededed;
  --wx-bubble-me:   #95ec69;
  --wx-bubble-them: #ffffff;
  --wx-text:        #191919;
  --wx-sub:         #888888;
  --wx-border:      #e5e5e5;
  --wx-red:         #fa5151;
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #ccc;
  color: var(--wx-text);
  font-size: 16px;
  overflow: hidden;
}

#app {
  height: 100%;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  background: var(--wx-bg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.15);
}

/* ── 屏幕切换 ── */
.screen { position:absolute; inset:0; display:none; flex-direction:column; }
.screen.active { display:flex; }

/* ========================================================
   登录页
   ======================================================== */
#loginScreen {
  background: #fff;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 100%;
  background: #fff;
  min-height: 100vh;
  padding: 0 32px;
  position: relative;
  text-align: center;
  color: #191919;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-box--compact {
  gap: 18px;
}

.login-close {
  position: absolute;
  left: 16px;
  top: 50px;
  font-size: 28px;
  color: #000;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  line-height: 1;
}

.login-title {
  font-size: 20px;
  font-weight: 400;
  color: #191919;
  text-align: center;
  padding: 0;
  margin: 0;
}

.footer-tip {
  font-size: 14px;
  line-height: 1.6;
  color: #888;
}

.login-form {
  padding: 0 32px;
}

.form-group {
  margin-bottom: 28px;
}

.form-group label {
  display: block;
  font-size: 15px;
  color: #191919;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 0;
  font-size: 16px;
  outline: none;
  background: transparent;
  color: #191919;
}

.form-input::placeholder {
  color: #b2b2b2;
}

.form-input:focus {
  border-bottom-color: #07c160;
}

.login-tip {
  font-size: 13px;
  color: #b2b2b2;
  margin: 20px 0 12px;
}

.login-link {
  font-size: 15px;
  color: #576b95;
  text-decoration: none;
  display: inline-block;
}

.login-checkbox {
  padding: 30px 32px 40px;
}

.login-checkbox label {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #191919;
  cursor: pointer;
}

.login-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #07c160;
}

.btn-login {
  display: block;
  width: calc(100% - 64px);
  margin: 0 32px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: #07c160;
  color: #fff;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  transition: opacity .15s;
}

.btn-login:active {
  opacity: .8;
}

.login-footer {
  text-align: center;
  padding: 30px 0 20px;
}

.footer-link {
  font-size: 15px;
  color: #576b95;
  text-decoration: none;
  padding: 0 4px;
}

.footer-sep {
  color: #d9d9d9;
  padding: 0 6px;
}

.login-err {
  color: #fa5151;
  font-size: 13px;
  text-align: center;
  margin-top: 16px;
  min-height: 18px;
}

/* 隐藏旧样式元素 */
.login-logo, .login-sub, .login-input, .btn-primary, .btn-secondary { display: none; }

/* ========================================================
   顶栏
   ======================================================== */
.topbar {
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  background: #ededed;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  border-bottom: none;
  z-index: 5;
}
.topbar-title {
  font-size: 17px;
  font-weight: 600;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title .chat-sub {
  font-size: 12px;
  font-weight: 400;
  color: #888;
  margin-left: 4px;
}
.topbar-title .dot-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #07c160;
  margin-left: 4px;
  vertical-align: middle;
}
.presence-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #07c160;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.topbar-btn {
  position: absolute;
  top: calc(var(--safe-top) + 22px);
  transform: translateY(-50%);
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  font-size: 26px;
  color: #000;
  padding: 8px 14px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  font-weight: 400;
}
.topbar-btn-left { left: 0; }
.topbar-btn-right { right: 0; }
#backBtn, #dmDetailBack, #profileBack, #applyBack, #giBack, #rpBack, #rpDetailBack { font-size: 28px; }
#membersBtn, #newGroupBtn { font-size: 22px; }
#homeAddBtn { font-size: 26px; font-weight: 400; color: #000; }

/* 有人@我按钮 */
.mention-me-btn {
  position: absolute;
  top: calc(var(--safe-top) + 22px);
  right: 50px;
  transform: translateY(-50%);
  background: #fff9e6;
  border: 1px solid #ffd966;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  color: #8a6d00;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-weight: 500;
}
.mention-me-icon {
  font-size: 12px;
  transform: rotate(180deg);
  display: inline-block;
}

/* @ 消息闪烁动画 */
@keyframes mention-flash {
  0%, 100% { box-shadow: 0 0 0 1px #ffd966 inset; }
  50% { box-shadow: 0 0 0 3px #ffa726 inset; }
}

/* 搜索框 */
.search-bar {
  background: #ededed;
  padding: 8px 12px 12px;
  flex-shrink: 0;
}
.search-input-wrapper {
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.search-icon {
  width: 16px;
  height: 16px;
  opacity: 0.4;
  flex-shrink: 0;
  display: block;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #000;
  background: transparent;
}
.search-input::placeholder {
  color: #999;
}

/* ========================================================
   主页布局(listScreen)
   ======================================================== */
#listScreen.active { display:flex; }
.tab-panel { display:none; flex:1; flex-direction:column; overflow-y:auto; }
.tab-panel.active { display:flex; }

/* ── 会话列表 / 好友列表 公用行 ── */
.group-list {
  list-style: none;
  background: #fff;
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  cursor: pointer;
  position: relative;
}
/* 分割线:从头像右侧开始(48+12+16 = 76px) */
.group-item::after {
  content: '';
  position: absolute;
  left: 76px; right: 0; bottom: 0;
  height: .5px;
  background: #e5e5e5;
}
.group-item:active { background: #ececec; }

/* 头像 */
.group-ava, .group-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #5b8cc4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  font-weight: 600;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.group-ava { position: relative; }
.ava-text { display: inline-block; }
.has-img .ava-text { opacity: 0; }

/* 文字区 */
.group-meta, .group-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.group-name {
  font-size: 17px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
}
.group-sub, .group-last {
  font-size: 14px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧时间 + 角标 */
.conv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.conv-time {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}
.conv-badge {
  background: var(--wx-red);
  color: #fff;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  text-align: center;
}

.empty-tip {
  text-align: center;
  color: var(--wx-sub);
  font-size: 14px;
  padding: 60px 20px;
}

/* ── 通讯录区块 ── */
.contacts-label {
  font-size: 13px;
  color: var(--wx-sub);
  padding: 8px 16px 6px;
  background: var(--wx-bg);
}
/* 通讯录好友请求行复用 member-item */

/* ── "我"页面 ── */
.me-head {
  background: #fff;
  padding: 30px 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.me-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #07c160;
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}
.me-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.me-nick {
  font-size: 22px;
  font-weight: 500;
  color: #000;
}
.me-id {
  font-size: 14px;
  color: #888;
}
.me-actions {
  background: #fff;
}
.me-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: .5px solid #e5e5e5;
  cursor: pointer;
  font-size: 16px;
  color: #000;
}
.me-action-row:last-child { border-bottom: none; }
.me-action-row:active { background: #ececec; }
.me-action-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}
.me-action-arrow {
  margin-left: auto;
  color: #c8c8c8;
  font-size: 18px;
}

/* ── 底部 Tab 栏 ── */
.tabbar {
  display: flex;
  border-top: .5px solid #d1d1d6;
  background: #f7f7f7;
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0 4px;
  font-size: 10px;
  color: #000;
  cursor: pointer;
  gap: 2px;
  position: relative;
  transition: color .15s;
}
.tab-item.active { color: var(--wx-green); }
.tab-icon {
  width: 24px;
  height: 24px;
  display: block;
}
.tab-ico { font-size: 24px; line-height: 1; }

.tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 24px);
  background: var(--wx-red);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
}

/* ── 会话列表:头像右上角未读角标 ── */
.group-ava, .group-avatar {
  position: relative;
}
.unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #fa5151;
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
/* 免打扰:只显示小红点,不显示数字 */
.unread-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fa5151;
  pointer-events: none;
}

/* ── 底部 tab 微信图标上方的未读角标 ── */
.unread-tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 26px);
  background: #fa5151;
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}

/* ========================================================
   聊天页
   ======================================================== */
#chatScreen .topbar {
  background: #fff;
  border-bottom: .5px solid #e5e5e5;
}

.mute-banner {
  background: #fffbe6;
  color: #8a6d00;
  text-align: center;
  padding: 5px 12px;
  font-size: 12px;
  border-bottom: .5px solid #f0dfa0;
  flex-shrink: 0;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 6px;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
}

/* ── 单条消息行 ── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 12px;
}
.msg.me { flex-direction: row-reverse; }

.msg-ava {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #aaa;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.msg.me .msg-ava { background: var(--wx-green); }

.msg-col {
  display: flex;
  flex-direction: column;
  max-width: 68%;
}
.msg.me .msg-col { align-items: flex-end; }

.msg-name {
  font-size: 12px;
  color: var(--wx-sub);
  margin-bottom: 3px;
  padding: 0 2px;
  display: none;
}

.msg-date-separator {
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 9px 12px 5px;
  color: #a6a6a6;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

/* ── 气泡 ── */
.bubble {
  position: relative;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  word-break: break-word;
  box-shadow: none;
  background: #fff;
  border-radius: 8px;
}
.msg.me .bubble {
  background: #95ec69;
  border-radius: 8px;
}

/* @ 提及样式 */
.mention-tag {
  color: #576b95;
  font-weight: 500;
}
.bubble.mentioned {
  background: #fff9e6 !important;
  box-shadow: 0 0 0 1px #ffd966 inset;
}
.msg.me .bubble.mentioned {
  background: #95ec69 !important;
  box-shadow: none;
}

/* 移除小三角 */
.bubble::before {
  display: none;
}
.msg.me .bubble::before {
  display: none;
}

.bubble img, .bubble video {
  max-width: 200px;
  max-height: 260px;
  border-radius: 6px;
  display: block;
}
.bubble.media { padding: 3px; }
.bubble.media::before { display: none; }

.bubble.emoji-only {
  background: none !important;
  box-shadow: none;
  font-size: 52px;
  padding: 0 2px;
  border-radius: 0;
}
.bubble.emoji-only::before { display: none; }

/* 阅后即焚 */
.bubble.burn {
  background: #1f1f1f !important;
  color: #fff;
  cursor: pointer;
}
.bubble.burn.burn-placeholder {
  display: inline-flex;
  align-items: center;
  min-width: 128px;
  justify-content: center;
}
.burn-ico {
  font-size: 18px;
  line-height: 1;
}
.bubble.burn::before { border-right-color: #1f1f1f; }
.msg.me .bubble.burn::before { border-left-color: #1f1f1f; border-right-color: transparent; }

.bubble.burned {
  background: #d8d8d8 !important;
  color: #999;
  font-style: italic;
}
.bubble.burned::before { border-right-color: #d8d8d8; }
.msg.burning { opacity: 0; transform: scale(0.95); transition: opacity 0.25s ease, transform 0.25s ease; }
.msg.me .bubble.burned::before { border-left-color: #d8d8d8; border-right-color: transparent; }

/* ============ 语音消息气泡 ============ */
.voice-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 60px;
  cursor: pointer;
}
.voice-dur {
  font-size: 15px;
  color: #000;
}
/* 声波图标(SVG):实心点 + 三条同心弧线,朝右(发出方) */
.voice-wave {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
}

/* 播放中:弧线依次亮起 */
.bubble.voice.playing .vw-arc { opacity: 0.25; }
.bubble.voice.playing .vw-arc1 { animation: vwPlay 1.2s infinite;        }
.bubble.voice.playing .vw-arc2 { animation: vwPlay 1.2s infinite 0.4s;   }
.bubble.voice.playing .vw-arc3 { animation: vwPlay 1.2s infinite 0.8s;   }
@keyframes vwPlay {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

.sys-msg { text-align: center; padding: 10px 0; }
.sys-msg span {
  display: inline-block;
  background: #dcdcdc;
  color: #888;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
}

/* ── 语音浮条 ── */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  flex-shrink: 0;
}
.voice-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wx-green);
  animation: pulse 1.2s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.voice-hangup {
  margin-left: auto;
  background: var(--wx-red);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

/* ========================================================
   输入区
   ======================================================== */
.input-area {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: #f5f5f5;
  border-top: .5px solid #d9d9d9;
  flex-shrink: 0;
}
.io-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  color: #000;
}
.io-btn:active { opacity: .6; }
.io-icon {
  width: 28px;
  height: 28px;
  display: block;
}

/* 按住说话按钮 */
.hold-talk {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 16px;
  background: #fff;
  color: #000;
  cursor: pointer;
  height: 38px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.hold-talk.recording {
  background: #d0d0d0;
}

/* ============ 录音浮层(按住说话) ============ */
.rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rec-overlay.hidden { display: none; }

/* 中间绿色语音气泡 */
.rec-bubble {
  position: relative;
  background: #95ec69;
  border-radius: 12px;
  padding: 26px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}
.rec-bubble.hidden { display: none; }
.rec-bubble-tail {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 10px solid #95ec69;
}

/* 波形动画 */
.rec-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}
.rec-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: #2b2b2b;
  animation: recWave 0.9s ease-in-out infinite;
}
.rec-wave span:nth-child(1)  { animation-delay: 0.0s; }
.rec-wave span:nth-child(2)  { animation-delay: 0.18s; }
.rec-wave span:nth-child(3)  { animation-delay: 0.35s; }
.rec-wave span:nth-child(4)  { animation-delay: 0.12s; }
.rec-wave span:nth-child(5)  { animation-delay: 0.42s; }
.rec-wave span:nth-child(6)  { animation-delay: 0.28s; }
.rec-wave span:nth-child(7)  { animation-delay: 0.05s; }
.rec-wave span:nth-child(8)  { animation-delay: 0.5s; }
.rec-wave span:nth-child(9)  { animation-delay: 0.22s; }
.rec-wave span:nth-child(10) { animation-delay: 0.38s; }
.rec-wave span:nth-child(11) { animation-delay: 0.1s; }
.rec-wave span:nth-child(12) { animation-delay: 0.45s; }
.rec-wave span:nth-child(13) { animation-delay: 0.3s; }
.rec-wave span:nth-child(14) { animation-delay: 0.15s; }
.rec-wave span:nth-child(15) { animation-delay: 0.4s; }
@keyframes recWave {
  0%, 100% { height: 6px; }
  50%      { height: 24px; }
}

/* 上滑取消图标 */
.rec-cancel-ico {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #b0b0b0;
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-cancel-ico.hidden { display: none; }

/* 底部提示文字 */
.rec-tip {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 15px;
  letter-spacing: 2px;
}
.rec-tip.cancel { color: #fa5151; }
.rec-slidehint {
  position: fixed;
  bottom: 34px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}
.rec-slidehint.hidden { display: none; }

.msg-input {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 16px;
  resize: none;
  max-height: 96px;
  outline: none;
  font-family: inherit;
  background: #fff;
  color: #000;
  line-height: 1.4;
}
.msg-input::placeholder { color: #999; }

.btn-send {
  background: var(--wx-green);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background .15s;
}
.btn-send:active { background: var(--wx-green-dark); }

/* ========================================================
   表情 & 功能面板
   ======================================================== */
.panel {
  background: var(--wx-topbar);
  border-top: .5px solid #d0d0d0;
  padding: 12px;
  max-height: 230px;
  overflow-y: auto;
  flex-shrink: 0;
}

#emojiPanel { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-cell {
  font-size: 30px;
  cursor: pointer;
  width: 14%;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
}
.emoji-cell:active { background: rgba(0,0,0,.08); }

.plus-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  padding: 14px 10px;
}
.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #444;
  cursor: pointer;
}
.plus-ico {
  width: 56px;
  height: 56px;
  background: var(--wx-white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.plus-item:active .plus-ico { background: #eee; }

/* ========================================================
   @ 提及选人面板
   ======================================================== */
.mention-panel {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--wx-white);
  border-top: .5px solid #d0d0d0;
  max-height: 60vh;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.mention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: .5px solid #e5e5e5;
  flex-shrink: 0;
}
.mention-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}
.mention-close {
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.mention-search {
  padding: 10px 16px;
  border-bottom: .5px solid #e5e5e5;
  flex-shrink: 0;
}
.mention-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  background: #f7f7f7;
}
.mention-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
  min-height: 150px;
  -webkit-overflow-scrolling: touch;
}
.mention-group-label {
  padding: 8px 16px 4px;
  font-size: 13px;
  color: #999;
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
.mention-item:active {
  background: #f0f0f0;
}
.mention-ava {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #5b8cc4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.mention-name {
  flex: 1;
  font-size: 16px;
  color: #333;
}

/* ========================================================
   红包气泡
   ======================================================== */
.redpacket {
  width: 250px;
  background: linear-gradient(135deg, #ff8c3a 0%, #ffb347 100%);
  border-radius: 8px;
  color: #fff;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 140, 58, 0.4);
  position: relative;
  padding: 16px 16px 10px;
}
.msg.me .redpacket { border-radius: 8px; }
/* 红包不需要三角箭头 */
.msg .redpacket ~ .bubble::before,
.msg:has(.redpacket) .bubble::before { display:none; }

.rp-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rp-ico {
  width: 38px;
  height: 48px;
  background: #e14b3b;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
/* 红包封口的分割线 */
.rp-ico::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}
/* 金色圆形 ¥ 币 */
.rp-coin {
  width: 19px;
  height: 19px;
  background: linear-gradient(135deg, #ffe08a 0%, #f3b845 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #e14b3b;
  position: relative;
  z-index: 1;
}
.rp-bless {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  flex: 1;
}
.rp-bot {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}
.redpacket.finished {
  background: linear-gradient(135deg, #d4af88 0%, #e0c7a8 100%);
  box-shadow: 0 2px 8px rgba(212, 175, 136, 0.4);
}

/* ========================================================
   右侧抽屉(群管理 / 聊天设置)
   ======================================================== */
.drawer { position:absolute; inset:0; display:none; z-index:20; }
.drawer.open { display:block; }
.drawer-mask { position:absolute; inset:0; background:rgba(0,0,0,.45); }

.drawer-body {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 78%;
  max-width: 320px;
  background: var(--wx-bg);
  overflow-y: auto;
  padding: calc(16px + var(--safe-top)) 0 calc(20px + var(--safe-bottom));
}

.drawer-body h3 {
  font-size: 16px;
  font-weight: 600;
  padding: 0 16px 14px;
  border-bottom: .5px solid var(--wx-border);
  margin-bottom: 10px;
}
.drawer-body h4 {
  font-size: 13px;
  color: var(--wx-sub);
  padding: 8px 16px 4px;
}

/* 抽屉中每行 */
.drawer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--wx-white);
  padding: 13px 16px;
  font-size: 15px;
  border-bottom: .5px solid var(--wx-border);
}
.drawer-row:first-of-type { border-top: .5px solid var(--wx-border); }

.mini-input {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}
.mini-btn {
  background: var(--wx-green);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 6px;
}

/* ── 成员列表 ── */
.member-list { list-style: none; }
.member-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--wx-white);
  padding: 12px 16px;
  border-bottom: .5px solid var(--wx-border);
}
.member-ava {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: #5b8cc4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.member-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-name {
  font-size: 16px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #333;
}
.member-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 20px;
}
.member-ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  font-weight: 500;
}
.tag.owner { background: #fff4d6; color: #a06000; }
.tag.muted  { background: #ffe0e0; color: #c00; }
.tag.offline { background: #eee; color: #999; }

.member-mute-btn, .member-kick-btn {
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid #ddd;
  background: var(--wx-white);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  color: #576b95;
  transition: all 0.2s;
}
.member-mute-btn:hover, .member-kick-btn:hover {
  background: #f7f7f7;
  border-color: #576b95;
}
.member-mute-btn:active, .member-kick-btn:active {
  background: #ececec;
  padding: 4px 10px;
  border: 1px solid #ccc;
  background: var(--wx-white);
  border-radius: 4px;
  cursor: pointer;
}
.member-kick-btn { color: var(--wx-red); border-color: var(--wx-red); }

/* 危险按钮(退群/删好友) */
.btn-danger {
  width: calc(100% - 32px);
  margin: 20px 16px 0;
  padding: 13px;
  background: var(--wx-white);
  color: var(--wx-red);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  border: .5px solid var(--wx-border);
}
.btn-danger:active { background: #fef0f0; }

/* 私聊管理区按钮 */
#dmManage .btn-primary {
  display: block;
  width: calc(100% - 32px);
  margin: 16px 16px 0;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: var(--wx-white);
  color: var(--wx-green);
  font-size: 16px;
  cursor: pointer;
  border: .5px solid var(--wx-border);
}

/* 邀请好友进群按钮 */
#inviteBtn {
  display: block;
  width: calc(100% - 32px);
  margin: 10px 16px 0;
  padding: 13px;
  background: var(--wx-white);
  color: var(--wx-green);
  border: .5px solid var(--wx-border);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

/* ── 开关 toggle ── */
.switch { position:relative; width:48px; height:28px; display:inline-block; flex-shrink:0; }
.switch input { display:none; }
.slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 28px;
  transition: background .2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--wx-green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ============ 私聊:聊天详情页 ============ */
#dmDetailScreen .topbar { background: #ededed; border-bottom: none; }
.detail-body {
  position: absolute;
  top: calc(48px + var(--safe-top));
  left: 0; right: 0; bottom: 0;
  background: #ededed;
  overflow-y: auto;
  padding-bottom: calc(20px + var(--safe-bottom));
}

/* 头像区 */
.detail-avatars {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #fff;
  padding: 16px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.detail-avatars::-webkit-scrollbar { display: none; }
.detail-ava-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 54px;
}
.detail-ava {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #07c160;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.detail-ava-add {
  background: transparent;
  color: #c8c8c8;
  border: 1px dashed #c8c8c8;
  font-size: 28px;
  font-weight: 300;
}
.detail-ava-name {
  margin-top: 6px;
  font-size: 12px;
  color: #888;
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 分组卡片 */
.detail-group {
  background: #fff;
  margin-bottom: 10px;
}
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 16px;
  color: #000;
  border-bottom: .5px solid #eee;
  cursor: pointer;
}
.detail-row:last-child { border-bottom: none; }
.detail-row-center { justify-content: center; }
.detail-arrow { color: #c8c8c8; font-size: 18px; }

/* ── 好友在线/离线指示 ── */
.friend-online, .friend-offline {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 5px;
  vertical-align: middle;
}
.friend-online  { background: var(--wx-green); }
.friend-offline { background: #ccc; }

/* 好友请求按钮 */
.req-btns { display:flex; gap:8px; flex-shrink:0; }
.req-accept {
  background: var(--wx-green);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.req-reject {
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* ========================================================
   弹窗 Modal
   ======================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.modal.open { display:flex; }
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 1;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--wx-white);
  border-radius: 14px;
  padding: 20px 20px 16px;
  width: 84%;
  max-width: 320px;
  z-index: 10;
}
.modal-box h3 {
  text-align: center;
  font-size: 17px;
  margin-bottom: 16px;
}

/* 朋友圈操作菜单 */
.moment-action-modal-box {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 6px;
  padding: 0;
  width: auto;
  max-width: none;
  position: fixed;
  transition: opacity 0.2s;
}

.moment-action-menu {
  display: flex;
  gap: 0;
}

.moment-action-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 80px;
  gap: 6px;
  transition: background 0.2s;
}

.moment-action-menu-item:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.moment-action-menu-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.moment-action-menu-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.moment-action-menu-text {
  font-size: 13px;
  color: #fff;
  line-height: 1;
}

.modal.msg-actions-open {
  align-items: flex-start;
  justify-content: flex-start;
}
.modal.msg-actions-open .modal-mask {
  background: rgba(0, 0, 0, 0.18);
}
.msg-actions-shell {
  position: fixed;
  inset: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: auto;
  max-width: none;
  pointer-events: none;
  box-shadow: none;
}
.msg-actions-panel {
  position: fixed;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72px;
  gap: 8px;
  padding: 12px;
  background: rgba(62, 62, 62, 0.96);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
}
.msg-actions-panel::after {
  content: '';
  position: absolute;
  left: var(--tail-left);
  bottom: -8px;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(62, 62, 62, 0.96);
}
.msg-actions-panel.below::after {
  top: -8px;
  bottom: auto;
  border-top: none;
  border-bottom: 8px solid rgba(62, 62, 62, 0.96);
}
.msg-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 68px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 8px 4px;
  appearance: none;
  -webkit-appearance: none;
}
.msg-action-btn:active {
  background: rgba(255, 255, 255, 0.08);
}
.msg-action-btn.danger {
  color: #fff;
}
.msg-action-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.msg-action-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msg-action-label {
  font-size: 14px;
  line-height: 1;
}
.msg-action-target .bubble {
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.18);
}
.burn-modal-box {
  padding: 0;
  width: 86%;
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
}
.burn-modal {
  position: relative;
  padding: 20px 20px 24px;
  text-align: center;
}
.burn-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b6b6b6;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.burn-modal-fire {
  width: 128px;
  height: 128px;
  margin: 8px auto 14px;
  border-radius: 50%;
  background: #edf2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}
.burn-modal-title {
  font-size: 28px;
  color: #ff7a2f;
  font-weight: 600;
}
.burn-modal-sub {
  margin-top: 10px;
  font-size: 15px;
  color: #999;
}
.burn-modal-body {
  margin-top: 18px;
  background: #f7f8fa;
  border-radius: 12px;
  padding: 14px;
}
.burn-modal-text {
  font-size: 16px;
  color: #222;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}
.burn-modal-media {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}
.burn-modal-audio {
  width: 100%;
}
.burn-modal-btn {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: #18a8e3;
  color: #fff;
  font-size: 18px;
  padding: 14px 16px;
  cursor: pointer;
}
.burn-modal-btn:active {
  opacity: 0.9;
}
.modal-box label {
  display: block;
  font-size: 13px;
  color: var(--wx-sub);
  margin: 10px 0 5px;
}
.modal-box input {
  width: 100%;
  padding: 10px 12px;
  border: .5px solid #ddd;
  border-radius: 7px;
  font-size: 15px;
  outline: none;
  background: #fafafa;
}
.modal-box input:focus { border-color: var(--wx-green); }

.modal-btns { display:flex; gap:10px; margin-top:20px; }
.modal-btns button { flex:1; padding:12px; border:none; border-radius:8px; font-size:15px; cursor:pointer; }
.modal-cancel { background:#f0f0f0; color:#444; }
.modal-ok { background:var(--wx-green); color:#fff; font-weight:600; }
.action-sheet { padding:0; background:transparent; box-shadow:none; }
.action-sheet-title { padding:14px 16px; font-size:13px; color:#888; text-align:center; background:#fff; border-radius:14px 14px 0 0; border-bottom:1px solid #f0f0f0; }
.action-sheet-item { display:block; width:100%; padding:16px; background:#fff; border:none; border-bottom:1px solid #f0f0f0; font-size:16px; color:#222; text-align:center; cursor:pointer; }
.action-sheet-item.cancel { border-bottom:none; border-radius:0 0 14px 14px; margin-top:8px; }
.action-sheet-item.danger { color:#fa5151; }
.modal-ok:active { background: var(--wx-green-dark); }

/* ── 来电浮层 ── */
#incomingCall .modal-box { text-align: center; padding: 28px 20px 20px; }

/* ── 通话中弹层 ── */
.call-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  overflow: hidden;
}
.call-overlay-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 82%, rgba(255, 70, 70, 0.26), transparent 34%),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(48, 48, 48, 0.96), rgba(28, 28, 28, 0.96));
  filter: blur(0);
}
.call-overlay-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding:
    calc(18px + var(--safe-top))
    24px
    calc(40px + var(--safe-bottom));
  color: #fff;
}
.call-overlay-top {
  width: 100%;
  display: flex;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}
.call-overlay-timer {
  letter-spacing: 1px;
  font-weight: 500;
}
.call-overlay-center {
  margin-top: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.call-overlay-members {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: min(320px, 86vw);
  margin-bottom: 18px;
}
.call-overlay-members.size-2 { grid-template-columns: repeat(2, 1fr); }
.call-overlay-members.size-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.call-overlay-members.size-9 { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.call-overlay-members.size-16 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.call-from-avatar,
.call-member-ava {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.call-from-avatar {
  width: 84px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 8px;
  font-size: 34px;
  border-radius: 18px;
}
.call-overlay-members.size-2 .call-member-ava { font-size: 42px; border-radius: 16px; }
.call-overlay-members.size-4 .call-member-ava { font-size: 34px; border-radius: 14px; }
.call-overlay-members.size-9 .call-member-ava { font-size: 24px; border-radius: 12px; }
.call-overlay-members.size-16 .call-member-ava { font-size: 18px; border-radius: 10px; }
.call-overlay-avatar {
  width: 108px;
  height: 108px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.call-overlay-name {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 500;
}
.call-overlay-status {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255,255,255,.78);
}
.call-overlay-actions {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}
.call-overlay-btn {
  width: 90px;
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.call-overlay-btn-ico {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}
.call-overlay-btn span:last-child {
  font-size: 14px;
  line-height: 1.3;
  color: rgba(255,255,255,.92);
}
.call-overlay-btn-danger .call-overlay-btn-ico {
  background: #e85a54;
  color: #fff;
}
.call-overlay-btn.is-off .call-overlay-btn-ico {
  background: rgba(0,0,0,.42);
  color: #fff;
}

/* ========================================================
   媒体查看器
   ======================================================== */
.viewer {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 40;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: #000;
}
.viewer.open { display: flex; }
.viewer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.96); }
.viewer-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.viewer-close:active { background: rgba(0,0,0,.75); }
.viewer-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: calc(54px + env(safe-area-inset-top, 0px)) 8px 8px;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}
.viewer-content img, .viewer-content video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  object-fit: contain;
}
.viewer-content img {
  transform-origin: center center;
  will-change: transform;
  -webkit-user-drag: none;
}
.viewer-toolbar {
  position: relative;
  z-index: 2;
  display: none;
  flex: none;
  justify-content: center;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  background: rgba(0,0,0,.86);
}
.viewer-download {
  display: inline-flex;
  min-width: 88px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.viewer-download:active { background: rgba(255,255,255,.28); }
.viewer-download:disabled { opacity: .55; cursor: default; }
.viewer-download-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.viewer-download:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.viewer-tip {
  display: block;
  margin-top: 8px;
  color: rgba(255,255,255,.7);
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}
@media (orientation: landscape) and (max-height: 520px) {
  .viewer-content { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .viewer-toolbar { padding-top: 6px; padding-bottom: calc(6px + var(--safe-bottom)); }
}

/* ========================================================
   Toast
   ======================================================== */
.toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(17,17,17,.78);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  max-width: 80%;
  text-align: center;
  white-space: pre-wrap;
}
.toast.show { opacity: 1; }

/* ========================================================
   右上角浮动菜单(＋)
   ======================================================== */
.add-menu {
  position: absolute;
  top: calc(44px + var(--safe-top) + 4px);
  right: 8px;
  background: #3d3d3d;
  border-radius: 8px;
  padding: 4px 0;
  min-width: 148px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.add-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 13px;
  border: 6px solid transparent;
  border-bottom-color: #3d3d3d;
  border-top: 0;
}
.add-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}
.add-menu-item:active { background: rgba(255,255,255,.08); }
.add-menu-img {
  width: 24px;
  height: 24px;
  display: block;
}
.add-menu-ico { font-size: 19px; width: 22px; text-align: center; }

/* ========================================================
   工具类 & 权限类
   ======================================================== */
.hidden { display: none !important; }
.owner-only { display: none; }
body.is-manager .owner-only { display: inline-flex; }
/* 整行的 owner-only(群管理入口 / 全员禁言行)要保持整行 flex,
   否则会被上面的 inline-flex 压塌成内容宽度,看起来像"禁言功能没了" */
body.is-manager .detail-row.owner-only,
body.is-manager .drawer-row.owner-only { display: flex; }

/* ========================================================
   添加朋友:搜索页 / 资料页 / 申请页
   ======================================================== */
/* 搜索栏(顶部:输入框 + 取消) */
.af-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ededed;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  flex-shrink: 0;
}
.af-search-input-wrapper {
  flex: 1;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.af-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: #000;
  background: transparent;
}
.af-search-input::placeholder { color: #999; }
.af-search-clear {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c6c6c6;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.af-cancel {
  background: none;
  border: none;
  color: #576b95;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
}

/* "搜索：xxx" 结果行 */
.af-result { background: #fff; flex: 1; }
.af-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: .5px solid #e5e5e5;
}
.af-result-row:active { background: #ececec; }
.af-result-ico {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--wx-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.af-result-text { font-size: 16px; color: #000; }
.af-result-kw { color: var(--wx-green); word-break: break-all; }

/* 资料页 */
#userProfileScreen .topbar { background: #fff; border-bottom: none; }
.profile-body {
  flex: 1;
  overflow-y: auto;
  background: #ededed;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  padding: 22px 20px;
  border-bottom: .5px solid #e5e5e5;
}
.profile-ava {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--wx-green);
  color: #fff;
  font-size: 30px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.profile-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.profile-name {
  font-size: 22px;
  font-weight: 600;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-id { font-size: 15px; color: #999; }
.profile-action {
  background: #fff;
  margin-top: 10px;
  border-top: .5px solid #e5e5e5;
  border-bottom: .5px solid #e5e5e5;
}
.profile-action-btn {
  text-align: center;
  padding: 15px;
  font-size: 17px;
  color: #576b95;
  cursor: pointer;
}
.profile-action-btn:active { background: #f2f2f2; }
.profile-action-btn.disabled { color: #b2b2b2; cursor: default; }

/* 申请页 */
#applyFriendScreen .topbar { background: #ededed; border-bottom: none; }
.apply-body {
  flex: 1;
  overflow-y: auto;
  background: #ededed;
  padding: 20px 16px;
}
.apply-label { font-size: 13px; color: #999; margin-bottom: 8px; }
.apply-input-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
}
.apply-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  font-family: inherit;
  color: #000;
  background: transparent;
  line-height: 1.5;
}
.apply-send {
  display: block;
  width: 60%;
  max-width: 260px;
  margin: 40px auto 0;
  padding: 12px;
  border: none;
  border-radius: 6px;
  background: var(--wx-green);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.apply-send:active { background: var(--wx-green-dark); }

/* 好友请求打招呼内容 */

/* ============ 发红包页面 ============ */
#redPacketScreen .topbar { background: #ededed; border-bottom: none; }
.rp-field-hint, .rp-fee-hint { color: #999; font-size: 12px; padding: 8px 14px 0; }
.rp-tier { color: #8b4513; font-size: 12px; margin-top: 4px; }
.rp-fee { margin-left: 8px; opacity: .8; }
.rp-detail-tier { color: rgba(255,255,255,.82); font-size: 14px; margin-top: 8px; }
.rp-body {
  flex: 1;
  overflow-y: auto;
  background: #ededed;
  padding: 0;
}
.rp-type {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.rp-type-text {
  font-size: 16px;
  color: #d9903e;
}
.rp-type-arrow {
  font-size: 18px;
  color: #d9903e;
}
.rp-card {
  background: #fff;
  margin-bottom: 10px;
  padding: 0 20px;
}
.rp-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 0.5px solid #e5e5e5;
}
.rp-row:last-child {
  border-bottom: none;
}
.rp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #000;
  min-width: 120px;
}
.rp-icon {
  font-size: 20px;
}
.rp-tag {
  display: inline-block;
  background: #d9903e;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.rp-currency {
  font-size: 16px;
  color: #000;
  margin-right: 4px;
}
.rp-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  text-align: right;
  color: #000;
  background: transparent;
}
.rp-input::placeholder {
  color: #c7c7cc;
}
.rp-unit {
  font-size: 16px;
  color: #000;
  margin-left: 8px;
}
.rp-hint {
  padding: 8px 20px;
  font-size: 13px;
  color: #999;
}
.rp-blessing-row {
  border-bottom: none;
  padding: 12px 0;
}
.rp-blessing-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #000;
  background: transparent;
}
.rp-blessing-input::placeholder {
  color: #c7c7cc;
}
.rp-emoji {
  font-size: 24px;
  cursor: pointer;
}
.rp-preview {
  text-align: center;
  padding: 60px 20px 40px;
}
.rp-preview-amount {
  font-size: 64px;
  font-weight: 300;
  color: #000;
  margin-bottom: 40px;
  letter-spacing: -2px;
}
.rp-send-btn {
  width: 80%;
  max-width: 320px;
  padding: 14px;
  background: linear-gradient(135deg, #ff6b45 0%, #ff4757 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
  transition: all 0.2s;
}
.rp-send-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}
.rp-footer-hint {
  margin-top: 20px;
  font-size: 13px;
  color: #999;
}

/* ============ 发红包页面样式优化 ============ */
#redPacketScreen {
  background: #ededed;
}
#redPacketScreen .topbar {
  height: 52px;
  background: #ededed;
  color: #191919;
  border-bottom: 0;
  box-shadow: none;
}
#redPacketScreen .topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: #191919;
}
#redPacketScreen .topbar-btn {
  color: #191919;
  font-size: 28px;
  font-weight: 300;
}
#redPacketScreen .rp-body {
  padding: 16px 15px 34px;
  background: #ededed;
}
#redPacketScreen .rp-type {
  display: flex;
  min-height: 52px;
  box-sizing: border-box;
  padding: 0 17px;
  margin: 0 0 16px;
  border-radius: 9px;
  background: #fff;
}
#redPacketScreen .rp-type-text {
  color: #202020;
  font-size: 16px;
}
#redPacketScreen .rp-type-arrow {
  color: #b6b6b6;
  font-size: 25px;
  line-height: 1;
}
#redPacketScreen .rp-card {
  margin: 0 0 16px;
  padding: 0 17px;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}
#redPacketScreen .rp-row {
  min-height: 52px;
  box-sizing: border-box;
  padding: 0;
  border-bottom: 0;
}
#redPacketScreen .rp-label {
  min-width: 92px;
  gap: 0;
  color: #202020;
  font-size: 16px;
  font-weight: 400;
}
#redPacketScreen .rp-label .rp-tag,
#redPacketScreen .rp-label .rp-icon {
  display: none;
}
#redPacketScreen .rp-input,
#redPacketScreen .rp-unit {
  color: #202020;
  font-size: 16px;
}
#redPacketScreen .rp-currency,
#redPacketScreen .rp-field-hint {
  display: none;
}
#redPacketScreen .rp-input::placeholder,
#redPacketScreen .rp-blessing-input::placeholder {
  color: #b9b9b9;
}
#redPacketScreen .rp-card:has(.rp-blessing-row) {
  min-height: 76px;
}
#redPacketScreen .rp-blessing-row {
  min-height: 76px;
  padding: 0;
}
#redPacketScreen .rp-blessing-input {
  font-size: 16px;
}
#redPacketScreen .rp-emoji {
  color: #9b9b9b;
  font-size: 23px;
}
#redPacketScreen .rp-hint,
#redPacketScreen .rp-field-hint,
#redPacketScreen .rp-fee-hint {
  padding: 0 4px 12px;
  color: #999;
  font-size: 12px;
}
#redPacketScreen .rp-member-hint {
  margin: -8px 0 12px;
  padding-left: 4px;
  color: #999;
  font-size: 12px;
}
#redPacketScreen .rp-preview {
  padding: 48px 0 28px;
}
#redPacketScreen .rp-preview-amount {
  margin-bottom: 30px;
  color: #171717;
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -1px;
}
#redPacketScreen .rp-send-btn {
  width: 196px;
  max-width: none;
  padding: 14px 10px;
  border-radius: 7px;
  background: #ff5257;
  box-shadow: none;
  font-size: 16px;
}
#redPacketScreen .rp-send-btn:active {
  box-shadow: none;
}
#redPacketScreen .rp-footer-hint {
  margin-top: 18px;
  color: #aaa;
  font-size: 12px;
}

/* ============ 会话长按菜单 ============ */
.context-menu {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.context-menu.hidden { display: none; }
.context-menu-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.context-menu-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  min-width: 200px;
  z-index: 1;
  overflow: hidden;
  animation: contextScale 0.2s ease;
}
@keyframes contextScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.context-menu-item {
  text-align: center;
  padding: 16px 20px;
  font-size: 17px;
  color: #000;
  cursor: pointer;
  border-bottom: 0.5px solid #e5e5e5;
}
.context-menu-item:last-child {
  border-bottom: none;
}
.context-menu-item:active {
  background: #f2f2f2;
}

/* ============ 退出登录弹窗（底部操作表） ============ */
.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.action-sheet.hidden { display: none; }
.action-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.action-sheet-content {
  position: relative;
  width: 100%;
  padding: 0 8px 8px;
  z-index: 1;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.action-sheet-item {
  background: #fff;
  text-align: center;
  padding: 16px;
  font-size: 17px;
  color: #000;
  cursor: pointer;
  border-radius: 12px;
  margin-bottom: 0;
}
.action-sheet-item:first-child {
  border-radius: 12px 12px 0 0;
}
.action-sheet-item:active {
  background: #f2f2f2;
}
.action-sheet-gap {
  height: 8px;
}
.action-sheet-cancel {
  border-radius: 12px !important;
  font-weight: 500;
}

/* 红包类型底部单选面板 */
.rp-currency-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
#redPacketScreen .rp-currency-trigger {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 52px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #202020;
  font-size: 16px;
  cursor: pointer;
}
#redPacketScreen .rp-currency-trigger:focus-visible {
  outline: 2px solid #ff9f69;
  outline-offset: -2px;
  border-radius: 6px;
}
.rp-currency-chevron { color: #b6b6b6; font-size: 24px; line-height: 1; }
#rpCurrencySheet .action-sheet-mask { background: rgba(0, 0, 0, .45); }
#rpCurrencySheet .action-sheet-content {
  width: min(100%, 560px);
  padding: 0 0 env(safe-area-inset-bottom);
  border-radius: 22px 22px 0 0;
  background: #fff;
  overflow: hidden;
}
.rp-currency-sheet-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 66px;
  color: #161616;
  font-size: 19px;
}
.rp-currency-sheet-head strong { font-weight: 600; }
.rp-currency-sheet-close {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 38px;
  height: 38px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #202020;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
.rp-currency-options {
  display: grid;
  gap: 10px;
  padding: 0 16px 14px;
}
.rp-currency-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: #f8f8f8;
  color: #222;
  text-align: left;
  cursor: pointer;
}
.rp-currency-option:active { background: #f0f0f0; }
.rp-currency-option:focus-visible { outline: 2px solid #ff9f69; outline-offset: -2px; }
.rp-currency-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}
.rp-currency-option-icon.green { background: #38b8e8; }
.rp-currency-option-icon.labor { background: #4bcf58; }
.rp-currency-option-icon.feed { background: #f1a34b; }
.rp-currency-option-name { flex: 1; margin-left: 15px; font-size: 17px; }
.rp-currency-radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid #ddd;
  border-radius: 50%;
  color: transparent;
  font-size: 15px;
  font-weight: 700;
}
.rp-currency-option.selected .rp-currency-radio {
  border-color: #f3bf8a;
  background: #f3bf8a;
  color: #fff;
}
.rp-currency-sheet-cancel {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 14px;
  padding: 13px;
  border: 0;
  border-radius: 9px;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
  cursor: pointer;
}
.req-greeting { font-size: 12px; color: #999; }

/* ============ 红包封面(点开前) ============ */
.rp-cover {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
}
.rp-cover.open { display: flex; }
.rp-cover-inner {
  width: 300px; height: 440px; border-radius: 14px;
  background: linear-gradient(180deg, #f5654a 0%, #f5654a 62%, #ee4c30 62%, #ee4c30 100%);
  position: relative; text-align: center; color: #f7d9a0;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.rp-cover-from {
  margin-top: 56px; font-size: 17px; color: #fbe6c0; font-weight: 500;
}
.rp-cover-ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px; background: #fff; color: #f5654a;
  font-size: 13px; font-weight: 700; vertical-align: middle; margin-right: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.rp-cover-bless {
  margin-top: 22px; font-size: 24px; font-weight: 600; color: #fbe6c0;
  padding: 0 30px; line-height: 1.4;
}
.rp-cover-open {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  width: 96px; height: 96px; border-radius: 50%; border: none;
  background: radial-gradient(circle at 50% 40%, #f6e2b3, #e8c682);
  color: #6b4a1f; font-size: 40px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.rp-cover-open:active { transform: translateX(-50%) scale(.94); }
.rp-cover-open.spin { animation: rpSpin .6s linear infinite; }
@keyframes rpSpin { to { transform: translateX(-50%) rotate(360deg); } }
.rp-cover-detail {
  position: absolute; left: 0; right: 0; bottom: 40px;
  font-size: 14px; color: #fbe6c0; cursor: pointer;
}
.rp-cover-close {
  position: absolute; left: 50%; bottom: -56px; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #f7d9a0;
  background: transparent; color: #f7d9a0; font-size: 18px; cursor: pointer;
}

/* ============ 红包领取详情页 ============ */
#rpDetailScreen .rp-detail-bar {
  background: #ee503a; border-bottom: none;
  display: flex; align-items: center; justify-content: space-between;
}
#rpDetailScreen .rp-detail-bar .topbar-btn { color: #fff; }
#rpDetailBack { left: 0; font-size: 28px; }
.rp-detail-more { right: 0; font-size: 20px; letter-spacing: 1px; }
.rp-detail-body {
  flex: 1; overflow-y: auto; background: #fff;
}
.rp-detail-head {
  background: #ee503a; color: #fbe6c0; text-align: center;
  padding: 8px 20px 34px; border-radius: 0 0 50% 50% / 0 0 24px 24px;
}
.rp-detail-from {
  font-size: 17px; color: #fff; font-weight: 500;
}
.rp-detail-ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px; background: #fff; color: #ee503a;
  font-size: 13px; font-weight: 700; vertical-align: middle; margin-right: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.rp-detail-bless {
  margin-top: 8px; font-size: 14px; color: #f7c9a0;
}
.rp-detail-mine { margin-top: 22px; display: none; }
.rp-detail-amount {
  font-size: 46px; font-weight: 700; color: #fff;
}
.rp-detail-yuan { color: #fff; font-size: 20px; margin-left: 4px; }
.rp-detail-wallet {
  margin-top: 12px; font-size: 13px; color: #f7c9a0;
}
.rp-detail-emojibtn {
  display: inline-block; margin-top: 16px; padding: 10px 26px;
  background: rgba(255,255,255,.15); border-radius: 8px; font-size: 14px; color: #fbe6c0;
}
.rp-detail-count {
  color: #999; font-size: 13px; padding: 16px 18px 8px;
}
.rp-detail-list { list-style: none; }
.rp-detail-item {
  display: flex; align-items: center; padding: 12px 18px;
}
.rp-detail-iava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 5px; background: #f5654a; color: #fff;
  font-size: 17px; font-weight: 600; flex: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.rp-detail-info { flex: 1; margin-left: 12px; min-width: 0; }
.rp-detail-inick { color: #333; font-size: 15px; }
.rp-detail-itime { color: #b0b0b0; font-size: 12px; margin-top: 3px; }
.rp-detail-iamount {
  color: #333; font-size: 15px; text-align: right; white-space: nowrap;
}
.rp-detail-best {
  display: inline-block; margin-left: 8px; padding: 1px 6px;
  background: #fef0d0; color: #d79b3c; font-size: 11px; border-radius: 3px;
}
.rp-detail-footer {
  text-align: center; color: #999; font-size: 13px; padding: 30px 18px;
}

/* ========== 发起群聊:多选好友整页 ========== */
#newGroupScreen { background: #ededed; }
.ng-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 12px; background: #ededed;
  padding-top: env(safe-area-inset-top);
}
.ng-title { font-size: 17px; font-weight: 600; color: #000; }
.ng-cancel {
  border: none; background: none; font-size: 16px; color: #000;
  padding: 6px 4px; cursor: pointer;
}
.ng-done {
  border: none; background: #07c160; color: #fff; font-size: 15px;
  padding: 6px 14px; border-radius: 5px; cursor: pointer;
}
.ng-done:disabled { background: #9be6b4; color: #f2fff7; cursor: default; }

.ng-selbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #fff; margin: 8px 12px; border-radius: 6px;
  min-height: 44px;
}
.ng-selected { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
.ng-sel-ava {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 5px;
  background: #07c160; color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 15px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.ng-search {
  flex: 1; min-width: 60px; border: none; outline: none; background: none;
  font-size: 15px; color: #333;
}
.ng-search::placeholder { color: #b2b2b2; }

.ng-list { flex: 1; overflow-y: auto; background: #fff; }
.ng-empty { text-align: center; color: #999; font-size: 14px; padding: 40px 20px; }
.ng-group-label {
  padding: 4px 16px; font-size: 13px; color: #888; background: #f5f5f5;
}
.ng-item {
  display: flex; align-items: center; padding: 8px 16px; cursor: pointer;
}
.ng-item:active { background: #f2f2f2; }
.ng-check {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  border: 1px solid #ccc; margin-right: 12px; box-sizing: border-box;
  position: relative;
}
.ng-check.on { background: #07c160; border-color: #07c160; }
.ng-check.on::after {
  content: ''; position: absolute; left: 7px; top: 3px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ng-ava {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 5px;
  background: #07c160; color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 16px; margin-right: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.ng-name { font-size: 16px; color: #000; }

/* ============================================================
   群聊信息页:行右侧值 / 二维码
   ============================================================ */
.detail-val {
  display: flex; align-items: center; gap: 4px;
  max-width: 60%; overflow: hidden;
}
.detail-val-text {
  color: #888; font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-val-gray { color: #b0b0b0; }
.detail-qr { color: #888; font-size: 18px; }

/* ============================================================
   发现页面
   ============================================================ */
.discover-list {
  background: #fff;
}
.discover-item {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  position: relative;
  gap: 12px;
}
.discover-item::after {
  content: '';
  position: absolute;
  left: 56px; right: 0; bottom: 0;
  height: .5px;
  background: #e5e5e5;
}
.discover-item:active {
  background: #ececec;
}
.discover-item-icon {
  width: 32px;
  height: 32px;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.discover-item-text {
  flex: 1;
  font-size: 16px;
  color: #191919;
}
.discover-item-arrow {
  font-size: 20px;
  color: #c0c0c0;
}

/* ============================================================
   朋友圈时间线页面
   ============================================================ */
.moments-header {
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  z-index: 10;
}
.moments-header .topbar-title {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}
.moments-header .topbar-btn {
  color: #fff;
  font-size: 22px;
}

#momentsScreen {
  overflow-y: auto;
}

.moments-profile {
  position: relative;
  height: 280px;
  flex-shrink: 0;
  cursor: pointer;
  transition: height 0.3s ease;
  overflow: hidden;
}

/* 封面展开状态 - 显示完整图片 */
.moments-profile.cover-expanded {
  height: 60vh;
}

.moments-profile.cover-expanded .moments-profile-bg {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  background-color: #fff;
}
.moments-profile-bg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}

.moments-change-cover-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}

.moments-change-cover-btn:hover {
  background: rgba(0,0,0,0.7);
}

.moments-change-cover-btn:active {
  background: rgba(0,0,0,0.8);
}

.moments-profile-info {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.moments-profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  border: 2px solid #fff;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.moments-profile-name {
  font-size: 16px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  font-weight: 500;
}

.moments-list {
  background: #f5f5f5;
  position: relative;
}

/* 下拉刷新 */
.moments-refresh-indicator {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  transition: transform 0.3s;
}
.moments-refresh-indicator.visible {
  transform: translateY(60px);
}
.moments-refresh-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #07c160;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状态 */
.moments-empty {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}
.moments-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.moments-empty-text {
  font-size: 15px;
  color: #999;
  margin-bottom: 8px;
}
.moments-empty-hint {
  font-size: 13px;
  color: #b2b2b2;
}
.moments-empty-btn {
  margin-top: 24px;
  padding: 10px 24px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.moments-empty-btn:active {
  opacity: 0.8;
}

/* 互动消息列表 */
.moments-notifications-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.notification-item {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  position: relative;
}
.notification-item:active {
  background: #f5f5f5;
}

.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5b8cc4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 12px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-user {
  font-size: 15px;
  color: #191919;
  font-weight: 500;
  margin-bottom: 4px;
}

.notification-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.notification-action-icon {
  font-size: 16px;
}

.notification-text {
  font-size: 14px;
  color: #888;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: #b2b2b2;
}

.notification-thumb {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: #f0f0f0;
  flex-shrink: 0;
  margin-left: 12px;
  overflow: hidden;
}

.notification-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 朋友圈单条动态 */
.moment-item {
  background: #fff;
  padding: 16px;
  margin-bottom: 8px;
  position: relative;
}
.moment-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.moment-content {
  position: relative;
}

.moment-menu-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 8px;
}

.moment-menu-btn {
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.moment-menu-btn:active {
  opacity: 0.6;
}
.moment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #5b8cc4;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.moment-info {
  flex: 1;
  min-width: 0;
}
.moment-name {
  font-size: 15px;
  font-weight: 600;
  color: #576b95;
  margin-bottom: 4px;
}
.moment-time {
  font-size: 13px;
  color: #999;
}

.moment-content {
  margin-left: 52px;
}
.moment-text {
  font-size: 16px;
  line-height: 1.5;
  color: #191919;
  margin-bottom: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* 图片网格 */
.moment-images {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.moment-images.count-1 {
  grid-template-columns: repeat(1, 1fr);
  max-width: 200px;
}
.moment-images.count-2,
.moment-images.count-4 {
  grid-template-columns: repeat(2, 1fr);
}
.moment-images.count-3,
.moment-images.count-5,
.moment-images.count-6,
.moment-images.count-7,
.moment-images.count-8,
.moment-images.count-9 {
  grid-template-columns: repeat(3, 1fr);
}
.moment-image {
  width: 100%;
  padding-bottom: 100%;
  background: #f0f0f0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.moment-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 语音消息 */
.moment-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 6px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.moment-audio:active {
  background: #efefef;
}

.moment-audio-icon {
  width: 24px;
  height: 24px;
  color: #576b95;
}

.moment-audio-duration {
  font-size: 14px;
  color: #666;
}

/* 语音播放动画 */
.moment-audio.playing .ma-dot {
  animation: ma-pulse 0.8s ease-in-out infinite;
}

.moment-audio.playing .ma-arc1 {
  animation: ma-wave 1.2s ease-in-out infinite;
}

.moment-audio.playing .ma-arc2 {
  animation: ma-wave 1.2s ease-in-out 0.15s infinite;
}

.moment-audio.playing .ma-arc3 {
  animation: ma-wave 1.2s ease-in-out 0.3s infinite;
}

@keyframes ma-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes ma-wave {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 点赞和评论区域 */
.moment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
  margin-left: 52px;
}
.moment-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
}
.moment-action-btn:active {
  opacity: 0.6;
}
.moment-action-icon {
  font-size: 16px;
}
.moment-liked .moment-action-icon {
  color: #fa5151;
}

/* 点赞列表 */
.moment-interactions {
  background: #f7f7f7;
  padding: 8px 12px;
  margin: 8px 0 0 0;
  border-radius: 4px;
}

.moment-likes {
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
}
.moment-like-user {
  color: #576b95;
  margin-right: 4px;
}

/* 评论列表 */
.moment-comments {
  background: transparent;
  padding: 0;
  margin: 0;
  border-radius: 0;
  border-top: 1px solid #e5e5e5;
  padding-top: 8px;
  margin-top: 8px;
}
.moment-comment {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.moment-comment:last-child {
  margin-bottom: 0;
}
.moment-comment-user {
  color: #576b95;
  font-weight: 500;
}
.moment-comment-text {
  color: #191919;
}
.moment-comment-images {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.moment-comment-image {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: #e0e0e0;
  overflow: hidden;
  cursor: pointer;
}
.moment-comment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.moment-comment-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 4px;
  margin-top: 4px;
  cursor: pointer;
  font-size: 13px;
}

/* ============================================================
   发布朋友圈页面
   ============================================================ */
.publish-moment-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}
.publish-moment-textarea {
  width: 100%;
  min-height: 150px;
  border: none;
  outline: none;
  font-size: 16px;
  line-height: 1.5;
  color: #191919;
  resize: none;
  font-family: inherit;
}
.publish-moment-textarea::placeholder {
  color: #b2b2b2;
}

.publish-moment-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.publish-image-item {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}
.publish-image-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.publish-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.publish-moment-audio {
  margin: 16px 0;
}
.publish-audio-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f7f7f7;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.publish-audio-item:active {
  background: #efefef;
}

.publish-audio-icon {
  width: 24px;
  height: 24px;
  color: #576b95;
}

.publish-audio-info {
  flex: 1;
  font-size: 14px;
  color: #666;
}

.publish-audio-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

/* 发布页语音播放动画 */
.publish-audio-item.playing .pa-dot {
  animation: ma-pulse 0.8s ease-in-out infinite;
}

.publish-audio-item.playing .pa-arc1 {
  animation: ma-wave 1.2s ease-in-out infinite;
}

.publish-audio-item.playing .pa-arc2 {
  animation: ma-wave 1.2s ease-in-out 0.15s infinite;
}

.publish-audio-item.playing .pa-arc3 {
  animation: ma-wave 1.2s ease-in-out 0.3s infinite;
}

.publish-moment-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid #f0f0f0;
}
.publish-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: #f7f7f7;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #191919;
}
.publish-action-btn:active {
  background: #e8e8e8;
}
.publish-action-icon {
  font-size: 28px;
}

.publish-moment-privacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid #f0f0f0;
}
.publish-privacy-label {
  font-size: 15px;
  color: #191919;
}
.publish-privacy-value {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  color: #888;
  cursor: pointer;
}
.publish-privacy-arrow {
  font-size: 18px;
  color: #c0c0c0;
}

/* 发布朋友圈顶部栏 */
.publish-moment-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}

.publish-cancel-btn {
  background: none;
  border: none;
  color: #191919;
  font-size: 17px;
  padding: 0;
  cursor: pointer;
  line-height: 44px;
}

.publish-cancel-btn:active {
  opacity: 0.6;
}

.publish-submit-btn {
  background: #07c160;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.publish-submit-btn:hover {
  background: #06ad56;
}

.publish-submit-btn:active {
  background: #059048;
}

.publish-submit-btn:disabled {
  background: #c0c0c0;
  cursor: not-allowed;
}

.publish-submit {
  color: #576b95;
  font-size: 16px;
  font-weight: 500;
}
.publish-submit:disabled {
  opacity: 0.4;
}

/* ============================================================
   朋友圈详情页
   ============================================================ */
.moment-detail-body {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  padding-bottom: 80px;
}
.moment-detail-content {
  padding: 16px;
}

/* 详情页动态样式 */
.moment-detail-content .moment-item {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

.moment-detail-content .moment-header {
  margin-bottom: 12px;
}

.moment-detail-content .moment-content {
  margin-left: 0;
}

.moment-detail-content .moment-text {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 12px;
  margin-left: 52px;
}

.moment-detail-content .moment-images {
  margin-bottom: 12px;
  margin-left: 52px;
}

.moment-detail-content .moment-audio {
  margin-left: 52px;
}

.moment-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #999;
  margin: 12px 0;
  margin-left: 52px;
  padding-top: 8px;
  position: relative;
}

.moment-detail-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.moment-detail-meta-right {
  position: relative;
}

.moment-detail-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.moment-detail-toggle-btn {
  padding: 4px 8px;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
}

.moment-detail-toggle-btn:active {
  background: #e5e5e5;
}

.moment-detail-actions-popup {
  position: absolute;
  right: 0;
  top: 36px;
  background: #4c4c4c;
  border-radius: 6px;
  padding: 8px;
  display: none;
  flex-direction: row;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.moment-detail-actions-popup.show {
  display: flex;
}

.moment-detail-actions-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 8px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #4c4c4c;
}

.moment-detail-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.moment-detail-action:active {
  opacity: 0.6;
}

.moment-detail-action-icon {
  font-size: 16px;
}

.moment-detail-action.liked .moment-detail-action-icon {
  color: #fa5151;
}

/* 点赞和评论交互栏 */
.moment-detail-interaction-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #e5e5e5;
  margin-top: 12px;
  position: relative;
}

.moment-detail-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.moment-detail-icon-btn:active {
  opacity: 0.6;
}

.moment-detail-icon {
  font-size: 20px;
}

.moment-detail-icon-img {
  width: 20px;
  height: 20px;
  display: block;
}

.moment-detail-comment-icon {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.moment-detail-like-avatars {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 0 8px;
}

.moment-detail-like-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* 评论区域 */
.moment-comments-area {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid #e5e5e5;
}

.moment-comments-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.moment-comments-section {
  padding: 0 16px 16px 16px;
}

.moment-comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 评论输入框 */
/* ============================================================
   朋友圈详情 - 评论输入区
   ============================================================ */
/* 评论附件预览区 */
.comment-attachments-preview {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  padding: 8px 16px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  display: none;
  z-index: 99;
}

.comment-attachments-preview.has-content {
  display: block;
}

.comment-preview-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.comment-preview-image {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
}

.comment-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.comment-preview-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
}

.comment-preview-audio:hover {
  background: #ececec;
}

.comment-preview-audio-icon {
  width: 24px;
  height: 24px;
  color: #576b95;
  flex-shrink: 0;
}

.comment-preview-audio.playing .cpa-dot {
  animation: pulse 1s ease-in-out infinite;
}

.comment-preview-audio.playing .cpa-arc1 {
  animation: wave1 1.2s ease-in-out infinite;
}

.comment-preview-audio.playing .cpa-arc2 {
  animation: wave2 1.2s ease-in-out infinite;
}

.comment-preview-audio.playing .cpa-arc3 {
  animation: wave3 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes wave1 {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes wave2 {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

@keyframes wave3 {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.6; }
}

.comment-preview-audio-duration {
  font-size: 14px;
  color: #666;
}

.comment-preview-audio-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
}

.moment-comment-input-area {
  line-height: 8vh;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #f7f7f7;
  border-top: 1px solid #d9d9d9;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  padding: 0 16px;
  box-sizing: border-box;
  z-index: 100;
  flex-wrap: nowrap !important;
}

.moment-comment-input {
  flex: 0 1 auto;
  width: calc(100% - 220px);
  height: 36px;
  line-height: 20px;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #ffffff;
  font-size: 15px;
  color: #191919;
  box-sizing: border-box;
  outline: none;
  margin-right: 10px;
}

.moment-comment-input::placeholder {
  color: #c0c0c0;
}

.moment-comment-input:focus {
  border-color: #07c160;
}

.moment-comment-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0 3px;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
  vertical-align: middle;
}

.moment-comment-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.moment-comment-icon-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.moment-comment-icon-btn img {
  width: 26px;
  height: 26px;
  display: block;
}

/* 评论录音弹窗 */
.comment-recording-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.comment-recording-modal.show {
  display: flex;
}

.comment-recording-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.comment-recording-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 84%;
  max-width: 320px;
  text-align: center;
  z-index: 10;
}

.comment-recording-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 16px 0;
  color: #191919;
}

.comment-recording-timer {
  font-size: 32px;
  font-weight: 600;
  color: #576b95;
  margin: 20px 0;
}

.comment-recording-btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.comment-recording-cancel,
.comment-recording-done {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.comment-recording-cancel {
  background: #f5f5f5;
  color: #191919;
}

.comment-recording-done {
  background: #07c160;
  color: #fff;
}

.comment-recording-cancel:active,
.comment-recording-done:active {
  opacity: 0.8;
}

/* 删除评论确认弹窗 */
.delete-comment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.delete-comment-modal.show {
  display: flex;
}

.delete-comment-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.delete-comment-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 84%;
  max-width: 320px;
  text-align: center;
  z-index: 10;
}

.delete-comment-message {
  font-size: 16px;
  color: #191919;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

.delete-comment-btns {
  display: flex;
  gap: 12px;
}

.delete-comment-cancel,
.delete-comment-ok {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.delete-comment-cancel {
  background: #f5f5f5;
  color: #191919;
}

.delete-comment-ok {
  background: #fa5151;
  color: #fff;
}

.delete-comment-cancel:active,
.delete-comment-ok:active {
  opacity: 0.8;
}

.moment-comment-send-btn {
  height: 36px;
  padding: 0 16px;
  margin-left: 6px;
  border: none;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 34px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: 4px;
  transition: all 0.2s;
}

.moment-comment-send-btn:hover {
  background: #06ad56;
}

.moment-comment-send-btn:active {
  background: #06ad56;
  opacity: 0.8;
}
.moment-comment-send:active {
  background: #06ad56;
}

/* ========================================================
   评论语音和图片样式
   ======================================================== */

/* 评论语音 */
.moment-comment-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  margin: 4px 0;
  transition: background 0.2s;
}

.moment-comment-audio:hover {
  background: #e0e0e0;
}

.moment-comment-audio.playing {
  background: #07c160;
  color: white;
  animation: voice-wave 1s infinite;
}

@keyframes voice-wave {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.moment-comment-audio > span:first-child {
  font-size: 16px;
}

/* 评论图片 */
.moment-comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
}

.moment-comment-image {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.moment-comment-image:hover {
  opacity: 0.8;
}

.moment-comment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.moment-comment-send:disabled {
  opacity: 0.4;
}

/* 评论表情选择器 */
.comment-emoji-picker {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 240px;
  background: #f7f7f7;
  border-top: 1px solid #d9d9d9;
  overflow-y: auto;
  z-index: 99;
  padding: 12px;
  box-sizing: border-box;
}

.comment-emoji-picker .emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.comment-emoji-picker .emoji-item {
  font-size: 28px;
  text-align: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
  user-select: none;
}

.comment-emoji-picker .emoji-item:hover {
  background: #e0e0e0;
}

.comment-emoji-picker .emoji-item:active {
  background: #d0d0d0;
}

/* ========================================================
   模态框样式
   ======================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}
