/* ============================================================
   WeChatSimulator - 微信风格样式
   配色：#07C160(微信绿) #FFFFFF #EDEDED
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  overflow: hidden;
}
body {
  font-family: "HarmonyOS Sans SC", "HarmonyOS Sans", "HarmonyOSSansSC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #101010;
  color: #1A1A1A;
  font-size: 16px;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#app {
  position: relative;
  max-width: 430px;
  height: 100%;
  margin: 0 auto;
  background: #EDEDED;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px rgba(0,0,0,.18);
}

/* ---------- 顶部状态栏 ---------- */
#statusbar {
  flex: none;
  height: 26px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  padding-top: env(safe-area-inset-top, 0);
  z-index: 100;
}
.sb-right { display: flex; align-items: center; gap: 5px; }
.sb-ico { display: block; }
.sb-bat {
  position: relative;
  width: 24px; height: 12px;
  border: 1.2px solid rgba(0,0,0,.4);
  border-radius: 3px;
  padding: 1px;
  margin-left: 2px;
}
.sb-bat i {
  display: block; height: 100%;
  background: #07C160;
  border-radius: 1px;
  width: 88%;
  transition: width .3s;
}
.sb-bat::after {
  content: '';
  position: absolute; right: -4px; top: 2.5px;
  width: 2px; height: 5px;
  background: rgba(0,0,0,.4);
  border-radius: 0 2px 2px 0;
}
#batPct { font-size: 12px; font-weight: 600; margin-left: 1px; }

/* ---------- 主视图区 ---------- */
#view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #EDEDED; }

/* ---------- 顶部标题栏 ---------- */
.hdr {
  flex: none;
  height: 44px;
  background: #fff;
  border-bottom: 1px solid #E5E5E5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 90;
}
.hdr-title { font-size: 17px; font-weight: 600; }
.hdr-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  border: none; background: none; font-size: 21px;
  width: 34px; height: 34px; line-height: 34px;
  color: #111; cursor: pointer; border-radius: 6px;
}
.icon-btn:active { background: #EEEEEE; }
.hdr-back {
  display: inline-flex; align-items: center; gap: 2px;
  border: none; background: none; font-size: 15px; color: #111;
  padding: 6px 8px 6px 0; cursor: pointer;
}
.hdr-back svg { width: 22px; height: 22px; }
.hdr-sub { flex: 1; text-align: left; margin-left: 2px; min-width: 0; }
.hdr-sub .t1 { font-size: 16px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-sub .t2 { font-size: 11px; color: #999; line-height: 1.2; }
.hdr-center { position: absolute; left: 44px; right: 44px; text-align: center; font-size: 17px; font-weight: 600; }

/* ---------- 通用列表行 ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  border-bottom: 1px solid #EBEBEB;
  cursor: pointer;
  position: relative;
}
.row:active { background: #ECECEC; }
.row-name { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; font-size: 12px; color: #999; margin-top: 3px; }
.chev { color: #C8C8C8; font-size: 20px; font-weight: 400; }

/* ---------- 头像 ---------- */
.avwrap {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  user-select: none;
}
.avchar { font-size: 19px; }
.avimg { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 会话列表（首页） ---------- */
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-name { font-size: 16px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 12px; color: #B2B2B2; flex: none; }
.conv-msg { font-size: 13px; color: #999; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  flex: none;
  min-width: 17px; height: 17px;
  padding: 0 5px;
  background: #FA5151; color: #fff;
  border-radius: 9px;
  font-size: 11px; line-height: 17px;
  text-align: center;
}

/* ---------- 状态标签 / 按钮 ---------- */
.tag {
  flex: none;
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  color: #07C160;
  border: 1px solid #07C160;
  border-radius: 4px;
  background: #fff;
}
.tag.gray { color: #999; border-color: #CCC; }
.btn-green {
  flex: none;
  border: none;
  background: #07C160;
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 5px;
  cursor: pointer;
}
.btn-green:active { opacity: .85; }
.btn-plain {
  flex: none;
  border: 1px solid #D6D6D6;
  background: #fff;
  color: #333;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
}
.big-btn {
  display: block;
  width: 88%;
  margin: 26px auto 12px;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: #07C160;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.big-btn:active { opacity: .85; }

/* ---------- 新的朋友列表（拖拽排序） ---------- */
.section-title {
  padding: 9px 14px 6px;
  font-size: 13px;
  color: #777;
  background: transparent;
}
.req { cursor: grab; }
.req[draggable="true"]:active { cursor: grabbing; }
.req.drag-over { box-shadow: inset 0 3px 0 #07C160, inset 0 -3px 0 #07C160; }
.drag-ico { color: #C8C8C8; font-size: 18px; flex: none; user-select: none; }
.req-tools { display: flex; flex-direction: column; gap: 3px; margin-left: auto; flex: none; }
.req-tools button {
  border: 1px solid #DDD; background: #fff;
  width: 26px; height: 17px; line-height: 15px;
  font-size: 10px; color: #666; border-radius: 4px; cursor: pointer;
}
.req-tools button:disabled { opacity: .35; }

/* ---------- 勾选框（搜索页 朋友圈/视频号） ---------- */
.srow { align-items: flex-start; padding: 12px 14px; }
.srow-main { flex: 1; min-width: 0; }
.srow-top { display: flex; align-items: center; gap: 6px; }
.srow-name { font-size: 16px; font-weight: 600; cursor: pointer; }
.srow-name:active { opacity: .6; }
.s-edit {
  border: none; background: #F2F2F2; color: #666;
  font-size: 12px; width: 24px; height: 24px; line-height: 24px;
  border-radius: 5px; cursor: pointer;
}
.srow-phone { font-size: 13px; color: #999; margin: 3px 0 6px; }
.srow-flags { display: flex; gap: 26px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: #333; cursor: pointer; user-select: none; }
.chk input { display: none; }
.chk i {
  width: 18px; height: 18px;
  border: 1.5px solid #CCC;
  border-radius: 4px;
  position: relative;
  background: #fff;
  transition: all .15s;
}
.chk input:checked + i { background: #07C160; border-color: #07C160; }
.chk input:checked + i::after {
  content: '';
  position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- 搜索页 ---------- */
.search-wrap { background: #EDEDED; }
.search-hdr { padding: 10px 4px 8px; display: flex; align-items: center; gap: 4px; background: #fff; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: #F0F0F0; border-radius: 6px;
  margin: 0 10px; padding: 7px 10px;
}
.search-box svg { width: 16px; height: 16px; flex: none; }
.search-box input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 15px;
}
.search-cancel { border: none; background: none; color: #07C160; font-size: 15px; padding: 0 10px 0 0; cursor: pointer; white-space: nowrap; }
.search-empty { text-align: center; color: #999; font-size: 14px; padding: 60px 0; }

/* ---------- 通过验证页 ---------- */
.accept-card { background: #fff; padding: 26px 0 14px; text-align: center; }
.accept-card .avwrap { margin: 0 auto 10px; }
.accept-name { font-size: 19px; font-weight: 600; }
.accept-phone { font-size: 13px; color: #999; margin-top: 4px; }
.accept-hint { text-align: center; font-size: 12px; color: #AAA; padding: 8px 24px 4px; line-height: 1.6; }
.flow-card { background: #fff; margin: 10px 12px; border-radius: 8px; padding: 12px; }
.flow-title { font-size: 13px; color: #07C160; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.flow-item { display: flex; justify-content: flex-end; margin: 6px 0; }
.flow-item .bubble { max-width: 80%; }
.flow-time { text-align: center; color: #999; font-size: 12px; margin: 4px 0 2px; }
.flow-actions { display: flex; gap: 12px; justify-content: center; padding: 16px 0 22px; }

/* ---------- 聊天界面 ---------- */
.chat-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 8px; background: #EDEDED; }
.msg { display: flex; align-items: flex-end; margin-bottom: 14px; gap: 6px; }
.msg.out { justify-content: flex-end; }
.msg .mt { font-size: 10px; color: #B9B9B9; flex: none; margin-bottom: 2px; }
.bubble {
  position: relative;
  max-width: 64%;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
}
.msg.in .bubble { background: #fff; }
.msg.out .bubble { background: #95eb68; }
.bubble.img { padding: 4px; background: transparent; box-shadow: none; }
.bubble.img img { max-width: 150px; max-height: 180px; border-radius: 6px; display: block; }
.img-tile {
  width: 150px; height: 112px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; border-radius: 6px;
}
.shake-bubble {
  background: linear-gradient(135deg, #95EC69, #5ED193) !important;
  font-weight: 600;
}
.shake-anim { animation: wxShake .55s ease-in-out 2; }
@keyframes wxShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-2deg); }
  40% { transform: translateX(7px) rotate(2deg); }
  60% { transform: translateX(-5px) rotate(-1deg); }
  80% { transform: translateX(5px) rotate(1deg); }
}
.sys {
  text-align: center; color: #999; font-size: 12px;
  margin: 10px 0; line-height: 1.7;
}
.chatbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  background: #F7F7F7;
  border-top: 1px solid #E2E2E2;
}
.cbar-btn {
  border: none; background: none; font-size: 22px;
  width: 30px; height: 34px; line-height: 34px;
  color: #333; cursor: pointer;
}
.cbar-ico { display: inline-block; }
#chatInput {
  flex: 1; min-width: 0;
  height: 36px; padding: 0 10px;
  border: none; border-radius: 5px;
  font-size: 16px; background: #fff; outline: none;
}
/* 第 3 页输入栏：可点可输，不受整页 touch-action:none 影响 */
#chatBar.chat-bar {
  background: #ededed !important;
}
#chatInputDupCap {
  background: #ededed;
}
#chatBar.chat-bar,
#chatBar.chat-bar * {
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}
#chatBar .tbtn { -webkit-user-select: none; user-select: none; }
#chatBar .chat-send-wrap { overflow: visible; }
#chatBar .chat-action-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-shrink: 0;
  margin-left: 4px;
}
#chatBar #chatEmojiBtn {
  flex: none;
  flex-shrink: 0;
  overflow: hidden;
  margin-right: 4px;
}
.chat-send-wrap {
  flex: none;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}
#chatBar .chat-bar-ico {
  font-size: 54px;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex: none;
}

/* 第 3 页发出绿气泡：右缘贴绿三角；超宽换行左缘对齐对方白三角竖线；高度随行数下延 */
.chat-out-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
/* 气泡灰底遮罩可盖过头像列，头像须压在遮罩之上，否则自定义头像会被盖住 */
#ovl [data-e^="ravatar:"],
#ovl [data-e^="lavatar:"] {
  z-index: 3;
}
.chat-out-img-wrap {
  display: block;
  overflow: hidden;
  box-sizing: border-box;
}
.chat-out-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
  background: #ededed;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.chat-out-text {
  color: inherit;
  display: block;
  font-weight: 400;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  letter-spacing: 1.5px;
  /* 轻微加粗：极细描边，观感略厚但不像 500/600 */
  -webkit-text-stroke: 0.28px currentColor;
  paint-order: stroke fill;
  box-sizing: border-box;
}
.chat-out-alnum {
  /* 整段数字/字母两侧各 +1px；段内（4 与 s）跟汉字字距一样 1.5px */
  margin: 0 1px;
  padding: 0;
}
.chat-call-ico {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.chat-out-bubble {
  position: relative;
  display: block;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: visible;
  margin: 0;
  box-sizing: border-box;
  text-align: left;
}
.chat-out-tail {
  position: absolute;
  /* 向左叠进绿底 2px，消掉接缝；顶对齐首行（多行不居中） */
  right: 2px;
  top: 22px;
  transform: translateX(100%);
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
  z-index: 1;
  object-fit: fill;
  -webkit-user-drag: none;
  user-select: none;
}

/* 微信表情面板 */
.wx-emoji-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100050;
  max-height: min(48vh, 420px);
  display: flex;
  flex-direction: column;
  background: #f7f7f7;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  padding-bottom: env(safe-area-inset-bottom, 0);
  touch-action: manipulation;
  pointer-events: auto;
}
.wx-emoji-panel.hidden { display: none; }
.wx-emoji-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  font-size: 15px;
  font-weight: 600;
  color: #111;
}
.wx-emoji-close {
  border: 0;
  background: transparent;
  color: #576b95;
  font-size: 14px;
  padding: 6px 8px;
  cursor: pointer;
}
.wx-emoji-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 8px 14px 12px;
}
.wx-emoji-item {
  border: 0;
  background: #fff;
  border-radius: 12px;
  padding: 14px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 1px #eee inset;
}
.wx-emoji-item:active { background: #f0f0f0; }
.wx-emoji-face { font-size: 36px; line-height: 1.15; }
.wx-emoji-face-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.wx-emoji-name { display: none; }
img.wx-em {
  width: 48px;
  height: 48px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin: 0 1px;
}
.wx-emoji-foot {
  display: flex;
  gap: 10px;
  padding: 8px 14px 12px;
  border-top: 1px solid #e5e5e5;
  background: #f7f7f7;
}
.wx-emoji-del,
.wx-emoji-send {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
.wx-emoji-del { background: #fff; color: #333; box-shadow: 0 0 0 1px #ddd inset; }
.wx-emoji-send { background: #07C160; color: #fff; }
body.wcs-emoji #pageNav { opacity: .35; pointer-events: none; }

/* ---------- 第 3 页加号面板（相册/拍摄等 8 项） ---------- */
#chatPlusPanel {
  position: absolute;
  left: 0;
  top: var(--chat-plus-panel-top, 1313px);
  width: 1088px;
  height: var(--chat-plus-panel-h, 1087px);
  z-index: 125;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  display: none;
  object-fit: cover;
  object-position: top center;
}
#chatPlusPanel.hidden { display: none !important; }
/* 加号：与表情同排，透明底完整圆圈（sprite 右半居中，勿加灰底/圆角裁剪） */
#chatPlusBtn {
  position: relative;
  left: auto;
  bottom: auto;
  transform: translate(5px, 5px);
  margin: 0;
  width: 74px;
  height: 74px;
  min-width: 74px;
  z-index: 3;
  border: 0;
  background: transparent url('../img/chat-plus-btn.png') no-repeat -62px center / 132px 74px;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  overflow: visible;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  flex-shrink: 0;
  align-self: center;
}
#chatPlusBtn img {
  display: none;
}
/* 相机：在加号原位（发送按钮正上方） */
#chatBar .chat-send-wrap #chatAlbumBtn.chat-album-float {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  width: 104px;
  height: 104px;
  z-index: 2;
  background: #ededed !important;
  border-radius: 14px;
  font-size: 62px;
}
#phone.wcs-chat-shift #chatShiftWrap {
  transform: translateY(calc(-1 * var(--chat-scroll-shift, 0px)));
  transition: transform 0.22s ease;
}
#phone.wcs-chat-shift #chatBodyCap,
#phone.wcs-chat-shift #chatInputDupCap {
  display: block !important;
}
#phone.wcs-chat-plus #chatPlusPanel { display: block; }
#phone.wcs-chat-plus #chatShiftWrap {
  transform: translateY(calc(-1 * var(--chat-scroll-shift, 0px)));
}
#phone.wcs-chat-plus #chatBodyCap,
#phone.wcs-chat-plus #chatInputDupCap { display: block !important; }
#phone.wcs-chat-plus #chatBar .tbtn:not(#chatPlusBtn),
#phone.wcs-chat-plus #chatInput,
#phone.wcs-chat-plus #chatSend,
#phone.wcs-chat-plus #chatAlbumBtn {
  display: none !important;
}
#phone.wcs-chat-plus #chatBar {
  background: transparent !important;
  pointer-events: none;
}
#phone.wcs-chat-plus #chatPlusBtn {
  position: absolute;
  left: var(--chat-plus-btn-open-x, 927px) !important;
  top: var(--chat-plus-btn-open-y, 1320px) !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  width: 88px !important;
  height: 88px !important;
  opacity: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  z-index: 132;
}
#phone.wcs-chat-plus #chatHeaderCap { display: block !important; }
/* 顶栏遮罩只挡上移的消息，不盖住已编辑的昵称/状态栏时间/电量 */
#phone.wcs-chat-plus #ovl > .ovl[data-e="time"],
#phone.wcs-chat-plus #ovl > .ovl[data-e="battery"],
#phone.wcs-chat-plus #ovl > .ovl[data-e^="name:"],
#phone.wcs-chat-plus #ovl > .bat-hw[data-e="battery"] {
  z-index: 120 !important;
}
#phone.wcs-chat-plus .bottom-nav-cap { display: none !important; }
body.wcs-chat-plus #pageNav { opacity: .35; pointer-events: none; }

.send-btn {
  border: none; background: #07C160; color: #fff;
  height: 32px; padding: 0 14px; border-radius: 5px;
  font-size: 14px; cursor: pointer;
}
.send-btn[hidden] { display: none; }

/* ---------- 底部菜单（+号弹层） ---------- */
.plus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 18px;
  padding: 20px 10px 26px;
  background: #F7F7F7;
  border-radius: 14px 14px 0 0;
}
.plus-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; color: #333; cursor: pointer; user-select: none;
}
.plus-item:active { opacity: .6; }
.plus-ico {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: #E4E4E4;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px;
}

/* ---------- 名片页 ---------- */
.card-top { background: #fff; padding: 22px 0 16px; text-align: center; }
.card-top .avwrap { margin: 0 auto 10px; }
.card-name { font-size: 20px; font-weight: 600; }
.card-tel { font-size: 13px; color: #999; margin-top: 3px; }
.card-actions { display: flex; justify-content: center; gap: 14px; padding: 12px 0 16px; background: #fff; border-bottom: 1px solid #EBEBEB; }
.card-act {
  width: 76px; padding: 8px 0;
  border: none; border-radius: 7px;
  background: #F5F5F5; color: #333;
  font-size: 14px; cursor: pointer;
}
.card-act:active { background: #E7E7E7; }
.card-act b { display: block; font-size: 18px; margin-bottom: 2px; }

/* ---------- 开关（名片页 朋友圈/视频号） ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0;
  background: #DCDCDC; border-radius: 13px;
  transition: background .2s; cursor: pointer;
}
.switch i::after {
  content: '';
  position: absolute; left: 2px; top: 2px;
  width: 22px; height: 22px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left .2s;
}
.switch input:checked + i { background: #07C160; }
.switch input:checked + i::after { left: 22px; }

/* ---------- 朋友圈 ---------- */
.fx-cover {
  height: 168px;
  background: linear-gradient(135deg, #4FC3F7, #0288D1);
  position: relative;
}
.fx-cover .big-char {
  position: absolute; right: 20px; bottom: 18px;
  width: 62px; height: 62px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
  color: #333; font-size: 28px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.fx-name {
  position: absolute; right: 20px; bottom: 92px;
  color: #fff; font-size: 19px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.fx-body { padding: 4px 10px 16px; background: #EDEDED; }
.mpost { background: #fff; border-radius: 6px; padding: 12px; margin: 8px 0; }
.mpost-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.mpost-name { font-size: 15px; font-weight: 600; color: #576B95; }
.mpost-text { font-size: 15px; line-height: 1.55; margin-bottom: 8px; }
.mpost-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mpost-imgs .tile {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.mpost-imgs img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; display: block; }
.mpost-meta { margin-top: 8px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #999; }
.mpost-meta span { display: inline-flex; align-items: center; gap: 3px; }
.mpost-comments { margin-top: 8px; background: #F5F5F5; border-radius: 4px; padding: 6px 8px; font-size: 13px; line-height: 1.7; color: #333; }
.mpost-comments em { font-style: normal; color: #576B95; }

/* ---------- 视频号 ---------- */
.v-banner { background: #fff; padding: 18px 16px 14px; display: flex; align-items: center; gap: 12px; }
.v-title { font-size: 18px; font-weight: 700; }
.v-desc { font-size: 12px; color: #999; margin-top: 3px; }
.vcard { background: #fff; border-radius: 6px; margin: 8px 0; overflow: hidden; }
.v-cover {
  height: 150px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.v-cover .play {
  position: absolute;
  width: 46px; height: 46px;
  background: rgba(0,0,0,.45);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.v-info { padding: 10px 12px 12px; }
.v-info .t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.v-info .d { font-size: 13px; color: #666; margin-bottom: 4px; }
.v-info .m { font-size: 12px; color: #999; display: flex; justify-content: space-between; }

/* ---------- 我 / 发现 / 设置 列表 ---------- */
.listrow { align-items: center; }
.listrow .ico {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex: none;
}
.me-card { background: #fff; padding: 20px 16px; display: flex; align-items: center; gap: 14px; }
.me-name { font-size: 20px; font-weight: 600; }
.me-sub { font-size: 13px; color: #999; margin-top: 4px; }
.slider-row { padding: 4px 14px; }
.slider-row input[type="range"] { width: 100%; accent-color: #07C160; }
.note { padding: 10px 14px; font-size: 12px; color: #999; line-height: 1.6; }

/* ---------- 底部导航 ---------- */
#tabbar {
  flex: none;
  height: 52px;
  background: #fff;
  border-top: 1px solid #E5E5E5;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 90;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  color: #6F6F6F;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: #07C160; }
.tab:active { background: #F3F3F3; }

/* ---------- 弹层 ---------- */
#overlay, #sheet { position: fixed; inset: 0; pointer-events: none; z-index: 260; }
#sheet { z-index: 300; }
.mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); pointer-events: auto; }
.modal {
  position: absolute;
  left: 16px; right: 16px; top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 10px;
  pointer-events: auto;
  max-height: 82%;
  overflow-y: auto;
  animation: popIn .18s ease;
}
@keyframes popIn { from { transform: translateY(-46%) scale(.96); opacity: .4; } to { transform: translateY(-50%) scale(1); opacity: 1; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto; animation: slideUp .22s ease; }
@keyframes slideUp { from { transform: translateY(40%); } to { transform: translateY(0); } }

.md-title { padding: 14px 16px 6px; font-size: 16px; font-weight: 600; }
.md-body { padding: 8px 16px 10px; }
.inp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F0F0F0; }
.inp > span { font-size: 14px; color: #666; flex: none; }
.inp input { flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; text-align: right; background: none; }
.inp-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F0F0F0; }
.inp-row > span { font-size: 14px; color: #666; flex: none; }
.inp-row input { flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; text-align: right; background: none; }
.av-preview { flex: none; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.sw {
  width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
}
.sw.on { border-color: #111; transform: scale(1.12); }
.md-btns { display: flex; gap: 10px; padding: 8px 0; }
.md-btns .btn {
  flex: 1; border: 1px solid #DDD; background: #fff;
  border-radius: 6px; height: 34px; font-size: 13px; cursor: pointer;
}
.md-btns .btn.danger { color: #FA5151; border-color: #F3C1C1; }
.md-foot { display: flex; border-top: 1px solid #F0F0F0; }
.md-foot button {
  flex: 1; height: 46px; border: none; background: none;
  font-size: 16px; cursor: pointer;
}
.md-foot .btn-cancel { color: #666; border-right: 1px solid #F0F0F0; }
.md-foot .btn-ok { color: #07C160; font-weight: 600; }
.md-textarea { width: 100%; border: 1px solid #E2E2E2; border-radius: 6px; padding: 8px; font-size: 14px; resize: none; outline: none; min-height: 74px; margin-top: 6px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; top: 46%;
  transform: translate(-50%, -50%) scale(.92);
  background: rgba(0,0,0,.72);
  color: #fff; font-size: 14px;
  padding: 10px 18px; border-radius: 8px;
  z-index: 500; pointer-events: none;
  opacity: 0; transition: all .18s;
  max-width: 76%; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 杂项 ---------- */
.empty { text-align: center; color: #999; font-size: 14px; padding: 70px 20px; line-height: 1.8; }
.none { display: none; }
button { font-family: inherit; }
::placeholder { color: #B9B9B9; }

/* ============ 方案B：六页直达 & 数据区 ============ */
.qgrid { display:flex; flex-wrap:wrap; gap:8px; padding:12px 0 4px; }
.qbtn { flex:1 1 45%; border:1px solid #ddd; background:#fff; color:#333; border-radius:10px;
  padding:10px 6px; font-size:14px; text-align:center; cursor:pointer; font-family:inherit;
  box-shadow:0 1px 2px rgba(0,0,0,.05); }
.qbtn:active { background:#f2f2f2; }
.qbtn::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%;
  background:var(--qc,#07C160); margin-right:6px; vertical-align:1px; }
.row-sub { display:block; font-size:11px; color:#999; font-weight:400; margin-top:2px; }

/* ============ 方案C：真实截图模式（华为 Mate50 1088x2400） ============ */
#viewStage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}
#phoneScaler {
  flex: none;
  position: relative;
  overflow: hidden;
  line-height: 0;
}
#phone {
  position: absolute;
  left: 0;
  top: 0;
  width: 1088px;
  height: 2400px;
  background: #000;
  overflow: hidden;
  transform-origin: top left;
  margin: 0;
  box-shadow: 0 0 60px rgba(0,0,0,.65);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
#bgImg {
  position: absolute;
  left: 0; top: 0;
  width: 1088px;
  height: 2400px;
  object-fit: cover;
  user-select: none;
  pointer-events: auto;
  -webkit-user-drag: none;
}
#ovl {
  position: absolute;
  left: 0; top: 0;
  width: 1088px;
  height: 2400px;
  overflow: hidden;
  pointer-events: none;   /* 覆盖层默认不挡交互 */
}
#ovl .ovl, #ovl input, #ovl button { pointer-events: auto; }

/* 浮动工具栏：叠在截图之上，不占用截图高度 */
#uiChrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  pointer-events: none;
  padding: 0 env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
#uiBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  pointer-events: none;
}
#uiBar > * { pointer-events: auto; flex: none; }
#toolToggle {
  background: rgba(7,193,96,.94);
  color: #fff;
  border: 0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
#toolMenu {
  position: absolute;
  right: 14px;
  bottom: 100%;
  margin-bottom: 6px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  min-width: 196px;
  pointer-events: auto;
}
#toolMenu.open { display: flex; }
#toolMenu button {
  border: 0;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
#toolMenu button:active { background: #e8e8e8; }
#toolMenu label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
  padding: 8px 10px;
  cursor: pointer;
}
#toolMenu input[type=checkbox] { width: 18px; height: 18px; }
#pageLabel {
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 14px;
  letter-spacing: 1px;
}

/* 屏幕中间两侧：上一页 / 下一页 */
#pageNav {
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
}
#pagePrev,
#pageNext {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  padding: 14px 6px;
  border: 0;
  border-radius: 14px;
  background: rgba(0,0,0,.48);
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
}
#pagePrev { left: max(8px, env(safe-area-inset-left, 0px)); }
#pageNext { right: max(8px, env(safe-area-inset-right, 0px)); }
#pagePrev:active,
#pageNext:active { background: rgba(7,193,96,.9); }
#pagePrev:disabled,
#pageNext:disabled {
  opacity: .28;
  cursor: default;
  box-shadow: none;
}

/* ============ v5：直接点击编辑（无需开关） ============ */
#ovl [data-e] {
  cursor: pointer;
  transition: background .12s;
}
#ovl [data-e].dragging {
  transition: none;
  will-change: transform;
}
#ovl [data-e]:active {
  background: rgba(7,193,96,.12);
}
#ovl [data-e].dragging {
  outline: 3px solid #07C160;
  outline-offset: 3px;
  opacity: .9;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(7,193,96,.4);
  cursor: move;
}
#ovl [data-e].selected {
  outline: 2px dashed #07C160;
  outline-offset: 2px;
  z-index: 40;
}
#ovl .chat-out-wrap.selected {
  outline: none;
}
#selOverlay {
  position: absolute;
  pointer-events: none;
  z-index: 55;
  box-sizing: border-box;
}
#selOverlay.hidden { display: none; }
#selOverlay .sel-frame {
  position: absolute;
  inset: 0;
  border: 2px dashed #07C160;
  border-radius: 4px;
  background: rgba(7,193,96,.06);
}
#selOverlay .sel-handle {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 32px;
  height: 32px;
  background: #07C160;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  pointer-events: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
#selOverlay .sel-handle::after {
  content: '⇲';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
#selOverlay .sel-info {
  position: absolute;
  top: -30px;
  left: 0;
  background: #07C160;
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}
#nudgePad {
  position: fixed;
  left: 50%;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
  top: auto;
  transform: translateX(-50%);
  z-index: 320;
  width: 132px;
  height: 152px;
  background: rgba(0,0,0,.45);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
  display: grid;
  grid-template-columns: 40px 40px 40px;
  grid-template-rows: 16px 40px 40px 40px;
  gap: 5px;
  justify-content: center;
  align-content: center;
  padding: 6px 8px 10px;
  box-sizing: border-box;
}
#nudgePad.nudge-has-bubble {
  width: 196px;
  height: auto;
  min-height: 152px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 16px 40px 40px 40px auto;
  padding-bottom: 8px;
}
#nudgePad.nudge-top {
  top: max(12px, calc(env(safe-area-inset-top) + 8px));
  bottom: auto;
}
#nudgePad.hidden { display: none; }
#nudgePad .nudge-title {
  grid-column: 1 / 4;
  grid-row: 1;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: 10px;
  line-height: 16px;
  pointer-events: none;
}
#nudgePad .nudge-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #07C160;
  color: #fff;
  font-size: 18px;
  line-height: 40px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.26);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
  position: static;
  justify-self: center;
}
#nudgePad .nudge-btn:active {
  background: #05964b;
  transform: scale(.94);
}
#nudgePad .nudge-up { grid-column: 2; grid-row: 2; }
#nudgePad .nudge-left { grid-column: 1; grid-row: 3; }
#nudgePad .nudge-undo { grid-column: 2; grid-row: 3; background: #3D8BFF; font-size: 18px; font-weight: 700; }
#nudgePad .nudge-undo:active { background: #2c6fd4; }
#nudgePad .nudge-undo.off,
#nudgePad .nudge-undo:disabled {
  background: rgba(255,255,255,.22);
  color: rgba(255,255,255,.45);
  box-shadow: none;
  cursor: default;
  transform: none;
}
#nudgePad .nudge-right { grid-column: 3; grid-row: 3; }
#nudgePad .nudge-down { grid-column: 2; grid-row: 4; }
#nudgePad .nudge-bubble-actions {
  grid-column: 1 / 4;
  grid-row: 5;
  display: flex;
  gap: 6px;
  justify-content: stretch;
  margin-top: 2px;
}
#nudgePad .nudge-bubble-actions.hidden { display: none; }
#nudgePad .nudge-act {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #07C160;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 34px;
  padding: 0 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.26);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
#nudgePad .nudge-act[data-act="nudge-del"],
#nudgePad .nudge-act-del { background: #FA5151; }
#nudgePad .nudge-act:active { transform: scale(.96); opacity: .92; }
#nudgePad .nudge-act:disabled {
  background: rgba(255,255,255,.22);
  color: rgba(255,255,255,.45);
  box-shadow: none;
  cursor: default;
  transform: none;
}
.em-row input[type="color"] {
  width: 72px;
  height: 44px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.em-color-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}
.em-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ddd;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.em-color-hex {
  font-size: 13px;
  color: #666;
  font-family: Consolas, monospace;
  min-width: 72px;
}
.em-dropper {
  border: 1px solid #07C160;
  background: #E8F8EF;
  color: #07C160;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.em-dropper:active { background: #D4F2E1; }
body.wcs-picking #phone { cursor: none; }
body.wcs-picking #toolToggle,
body.wcs-picking #toolMenu,
body.wcs-picking #pageLabel,
body.wcs-picking #pageNav,
body.wcs-picking #uiChrome,
body.wcs-picking #uiBar { opacity: .35; pointer-events: none; }

/* 图片双击放大预览 */
#imgZoom {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
#imgZoom.hidden { display: none !important; }
.img-zoom-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
}
.img-zoom-pic {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1088px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  -webkit-user-drag: none;
  user-select: none;
  cursor: zoom-out;
}
.img-zoom-bar {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.img-zoom-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  background: rgba(255,255,255,.14);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.img-zoom-btn[data-act="edit"] { background: rgba(7,193,96,.92); }
.img-zoom-btn:active { opacity: .85; }
body.wcs-imgzoom { overflow: hidden; }
body.wcs-imgzoom #pageNav,
body.wcs-imgzoom #uiChrome { pointer-events: none; opacity: .25; }
#pickHint {
  display: none;
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  z-index: 950;
  background: rgba(7,193,96,.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  pointer-events: none;
  align-items: center;
  gap: 10px;
}
#pickHint.show { display: flex; }
#pickHint .pick-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #fff;
  flex: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
#pickHint .pick-hex {
  font-family: Consolas, 'Courier New', monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  min-width: 78px;
}
#pickHint .pick-tip {
  opacity: .9;
  font-size: 13px;
}
#pickLoupe {
  display: none;
  position: fixed;
  z-index: 960;
  width: 140px;
  height: 140px;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
}
#pickLoupe.show { display: block; }
#pickLoupe .loupe-canvas {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 3px solid #07C160;
  box-sizing: border-box;
  background: #111;
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#pickLoupe .loupe-cross {
  position: absolute;
  left: 50%;
  top: 64px;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#pickLoupe .loupe-cross::before,
#pickLoupe .loupe-cross::after {
  content: '';
  position: absolute;
  background: #07C160;
  box-shadow: 0 0 0 1px rgba(255,255,255,.85);
}
#pickLoupe .loupe-cross::before {
  left: 50%; top: 0; bottom: 0;
  width: 1.5px; margin-left: -0.75px;
}
#pickLoupe .loupe-cross::after {
  top: 50%; left: 0; right: 0;
  height: 1.5px; margin-top: -0.75px;
}
#pickLoupe .loupe-dropper {
  position: absolute;
  right: 0;
  bottom: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
}
#pickLoupe .loupe-label {
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.78);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-family: Consolas, 'Courier New', monospace;
  font-weight: 700;
}
#pickLoupe .loupe-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid #fff;
  flex: none;
}
#pickReticle {
  display: none;
  position: fixed;
  z-index: 961;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
#pickReticle.show { display: block; }
#pickReticle i {
  position: absolute;
  background: #07C160;
  box-shadow: 0 0 0 1px rgba(255,255,255,.9);
}
#pickReticle i:first-child {
  left: -8px; top: -0.75px;
  width: 16px; height: 1.5px;
}
#pickReticle i:nth-child(2) {
  left: -0.75px; top: -8px;
  width: 1.5px; height: 16px;
}
#pickReticle b {
  position: absolute;
  left: -3px; top: -3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1.5px solid #07C160;
  background: rgba(255,255,255,.35);
  box-sizing: border-box;
}
#editModal { position: fixed; inset: 0; z-index: 100000; }
#editModal.hidden { display: none; }
.em-mask { position: absolute; inset: 0; background: rgba(0,0,0,.22); }
.em-card {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  top: auto;
  transform: translateX(-50%);
  width: min(340px, 88vw);
  max-height: 78vh;
  background: #fff;
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.24);
  animation: emIn .16s ease;
}
@keyframes emIn {
  from { transform: translateX(-50%) translateY(12px); opacity: .4; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.em-title { padding: 10px 14px 4px; font-size: 14px; font-weight: 700; color: #191919; }
.em-body { padding: 2px 14px 8px; }
.em-row {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 7px 0; border-bottom: 1px solid #F0F0F0;
}
.em-row > span:first-child { font-size: 12px; color: #666; flex: none; width: 52px; line-height: 28px; }
.em-row > .em-hint {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #888;
  line-height: 1.4;
  padding: 4px 0;
  word-break: break-word;
}
.em-row input,
.em-row textarea {
  flex: 1; min-width: 0;
  border: 0; outline: none;
  font-size: 16px;                 /* ≥16px，防止手机聚焦时页面缩放 */
  padding: 4px 2px; color: #191919;
  background: transparent;
  font-family: inherit;
}
.em-row textarea {
  min-height: 48px;
  max-height: 88px;
  line-height: 1.4;
  resize: vertical;
  touch-action: manipulation;
}
.em-chips { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.em-chip {
  border: 1px solid #ddd; background: #fff; color: #333;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.em-chip:active { background: #f2f2f2; }
.em-btns { display: flex; gap: 6px; flex: 1; }
.em-choice {
  flex: 1;
  border: 1px solid #ddd; background: #fff; color: #333;
  border-radius: 8px; padding: 6px 0; font-size: 13px; cursor: pointer;
}
.em-choice[data-on="1"] {
  background: #07C160; border-color: #07C160; color: #fff; font-weight: 600;
}
.em-sws { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.em-sw {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
}
.em-sw.on { border-color: #111; transform: scale(1.08); }
.em-foot { display: flex; border-top: 1px solid #F0F0F0; }
.em-foot .em-btn {
  flex: 1; height: 40px; border: 0; background: none;
  font-size: 15px; cursor: pointer; font-family: inherit;
}
.em-foot .em-btn:first-child { color: #666; border-right: 1px solid #F0F0F0; }
.em-foot .em-ok { color: #07C160; font-weight: 700; }

/* �ֻ�����Ԥ������������� / ���� */
#savePreview {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
}
#savePreview .sp-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
}
#savePreview .sp-card {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  max-height: 92vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: flex; flex-direction: column; gap: 10px;
  animation: spUp .2s ease;
}
@keyframes spUp {
  from { transform: translateY(24px); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}
#savePreview .sp-title {
  font-size: 17px; font-weight: 700; color: #191919; text-align: center;
}
#savePreview .sp-tip {
  font-size: 13px; line-height: 1.55; color: #666;
  background: #F7F7F7; border-radius: 10px; padding: 10px 12px;
}
#savePreview .sp-imgbox {
  flex: 1; min-height: 0; overflow: auto;
  text-align: center; background: #111; border-radius: 10px;
  -webkit-user-select: none; user-select: none;
}
#savePreview .sp-imgbox img {
  max-width: 100%; height: auto; display: block; margin: 0 auto;
  -webkit-touch-callout: default;
}
#savePreview .sp-btns { display: flex; gap: 10px; }
#savePreview .sp-btns button {
  flex: 1; height: 46px; border: 0; border-radius: 10px;
  font-size: 16px; font-family: inherit; cursor: pointer;
}
#savePreview .sp-share { background: #07C160; color: #fff; font-weight: 700; }
#savePreview .sp-close { background: #F2F2F2; color: #333; }

#savePreview .sp-imgbox.sp-pulse {
  animation: spPulse .9s ease 2;
  outline: 3px solid #07C160;
  outline-offset: 2px;
}
@keyframes spPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* 第 2 页：长按增删「新的朋友」列表组 */
.crm-wrap {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end; justify-content: center;
}
.crm-wrap.hidden { display: none; }
.crm-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
.crm-card {
  position: relative; z-index: 1;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px;
}
.crm-title { font-size: 16px; font-weight: 700; color: #191919; }
.crm-hint { font-size: 13px; color: #888; margin-bottom: 4px; }
.crm-btn {
  height: 48px; border: 0; border-radius: 10px;
  background: #F6F6F6; color: #191919;
  font-size: 16px; font-family: inherit; cursor: pointer;
}
.crm-btn:active:not(:disabled) { background: #ebebeb; }
.crm-btn:disabled { opacity: 0.38; cursor: default; }
.crm-del { color: #e54d42; background: #fff5f4; }
.crm-cancel { background: #fff; color: #666; border: 1px solid #eee; }
