/* ================================================================
   WeChat 1:1 Clone CSS
   Colors: 绿 #07C160, 灰底 #EDEDED, Tab白 #F7F7F7, 文字 #191919/#888
   ================================================================ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body {
  width:100%; height:100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #191919; background: #EDEDED;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
  overflow: hidden;
}
input, button { font-family: inherit; font-size: inherit; outline: none; border: none; }
button { cursor: pointer; background: none; }

/* ---------- Screen ---------- */
.screen { display: none; position: fixed; inset: 0; z-index: 1; background: #EDEDED; overflow: hidden; }
.screen.active { display: flex; }

/* ---------- Auth ---------- */
#auth-screen { flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.auth-bg { width: 100%; max-width: 340px; padding: 20px; }
.auth-logo { width: 80px; height: 80px; margin: 0 auto 30px; }
.auth-logo svg { width: 100%; height: 100%; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 30px; border-radius: 8px; overflow: hidden; border: 1px solid #07C160; }
.auth-tab { flex: 1; padding: 10px; text-align: center; background: #fff; color: #07C160; font-size: 16px; border: none; }
.auth-tab.active { background: #07C160; color: #fff; }
.auth-form { display: none; }
.auth-form.active { display: block; }
.af-row { margin-bottom: 16px; }
.af-row input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; }
.af-row input:focus { border-color: #07C160; }
.af-btn { width: 100%; padding: 12px; background: #07C160; color: #fff; font-size: 17px; font-weight: 600; border-radius: 8px; border: none; margin-top: 8px; }
.af-err { color: #e74c3c; font-size: 14px; margin-top: 10px; text-align: center; min-height: 20px; font-weight: 500; }
.af-err.shake { animation: shake .4s; }
.af-btn:disabled { opacity: .8; cursor: not-allowed; }
.btn-loading { display: inline-block; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

/* ---------- Main App Layout ---------- */
#main-app { flex-direction: column; }
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; background: #F7F7F7; border-top: 1px solid #ddd;
  padding: 4px 0 env(safe-area-inset-bottom, 4px);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 0; color: #888; position: relative; transition: color .15s;
}
.tab-item.active { color: #07C160; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-size: 10px; margin-top: 2px; }
.tab-badge {
  position: absolute; top: -2px; right: 50%; transform: translateX(22px);
  background: #e74c3c; color: #fff; font-size: 10px; padding: 1px 5px;
  border-radius: 10px; min-width: 16px; text-align: center; line-height: 1.4;
}
.tab-dot {
  position: absolute; top: 2px; right: 50%; transform: translateX(22px);
  width: 8px; height: 8px; background: #e74c3c; border-radius: 50%;
}

.tab-pages {
  flex: 1; overflow: hidden; position: relative;
  padding-bottom: 50px; /* tab bar height */
  height: calc(100vh - 0px);
}
.tab-page {
  display: none; position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden; background: #EDEDED;
}
.tab-page.active { display: flex; flex-direction: column; }

/* ---------- Nav Bar (微信导航栏) ---------- */
.nav-bar {
  display: flex; align-items: center; justify-content: center;
  height: 44px; background: #EDEDED; position: relative; flex-shrink: 0;
  padding: 0 16px;
}
.nav-title { font-size: 17px; font-weight: 600; color: #191919; }
.nav-title-white { font-size: 17px; font-weight: 600; color: #fff; }
.nav-right { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.nav-btn { font-size: 20px; padding: 4px 8px; color: #191919; }
.nav-btn-white { font-size: 20px; padding: 4px 8px; color: #fff; }
.nav-back {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 22px; padding: 4px 8px; color: #191919; font-weight: 300;
}
.nav-back-white { color: #fff; }
.nav-unread {
  background: #e74c3c; color: #fff; font-size: 11px; padding: 0 6px;
  border-radius: 10px; margin-left: 6px; vertical-align: middle; line-height: 1.6;
}
.nav-bar-chat { background: #EDEDED; }
.nav-bar-dark { background: #2c2c2c; }
.nav-title-chat { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Search Bar ---------- */
.search-bar {
  padding: 8px 12px; flex-shrink: 0; background: #EDEDED;
}
.search-bar.pad { padding: 12px; }
.search-wrap {
  display: flex; align-items: center; background: #fff;
  border-radius: 6px; padding: 6px 12px;
}
.sw-icon { font-size: 14px; margin-right: 6px; opacity: .4; }
.search-wrap input { flex: 1; font-size: 15px; border: none; background: transparent; }

/* ---------- +号 下拉菜单 ---------- */
.add-drop {
  position: absolute; top: 48px; right: 8px; z-index: 200;
  background: #4a4a4a; border-radius: 6px; padding: 4px 0; min-width: 140px;
}
.add-drop div {
  padding: 10px 16px; color: #fff; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.add-drop div:active { background: rgba(255,255,255,.1); }

/* ---------- Chat List (消息列表) ---------- */
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; padding: 12px 16px; background: #fff;
  border-bottom: 1px solid #f0f0f0; position: relative; cursor: pointer;
}
.chat-item:active { background: #ECECEC; }
.chat-item.unread { background: #fff; }
.ci-avatar {
  width: 48px; height: 48px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: #fff; margin-right: 12px;
}
.ci-content { flex: 1; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ci-name { font-size: 16px; color: #191919; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { font-size: 12px; color: #b0b0b0; flex-shrink: 0; }
.ci-bottom { display: flex; justify-content: space-between; align-items: center; }
.ci-last { font-size: 13px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ci-unread {
  background: #e74c3c; color: #fff; font-size: 11px; min-width: 18px;
  height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px;
  margin-left: 6px; flex-shrink: 0;
}
.empty { text-align: center; color: #999; padding: 60px 20px; font-size: 14px; }

/* ---------- Contacts ---------- */
.contacts-top { background: #fff; margin-bottom: 0; }
.contacts-top > div {
  display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.contacts-top > div:active { background: #ECECEC; }
.ct-avatar {
  width: 36px; height: 36px; border-radius: 4px; margin-right: 12px;
  display: flex; align-items: center; justify-content: center; background: #07C160;
}
.ct-avatar span { font-size: 18px; }
.contacts-top > div > span:nth-child(2) { flex: 1; font-size: 15px; }
.ct-badge { background: #e74c3c; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; text-align: center; line-height: 18px; padding: 0 4px; }
.ct-arrow { color: #ccc; font-size: 18px; }

.contact-list-wrap { position: relative; flex: 1; overflow: hidden; }
.contact-list { overflow-y: auto; height: 100%; padding-bottom: 20px; }
.contact-letter { padding: 6px 16px; background: #EDEDED; font-size: 12px; color: #888; font-weight: 600; }
.contact-row { display: flex; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.contact-row:active { background: #ECECEC; }
.cr-avatar {
  width: 40px; height: 40px; border-radius: 4px; margin-right: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  font-weight: 600; color: #fff;
}
.cr-name { font-size: 16px; }

/* A-Z Index */
.az-bar {
  position: absolute; right: 2px; top: 0; bottom: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 4px 0; z-index: 10;
}
.az-bar span { font-size: 10px; color: #888; padding: 1px 6px; text-align: center; cursor: pointer; }
.az-pop {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60px; height: 60px; background: rgba(0,0,0,.6); border-radius: 8px;
  color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center;
  z-index: 300; pointer-events: none;
}

/* ---------- Discover ---------- */
.dis-gap { height: 8px; background: #EDEDED; }
.dis-list { background: #fff; }
.dis-item {
  display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f0f0f0;
  cursor: pointer; font-size: 16px;
}
.dis-item:last-child { border-bottom: none; }
.dis-item:active { background: #ECECEC; }
.dis-item > span:nth-child(2) { flex: 1; margin-left: 12px; }
.di-arrow { color: #ccc; font-size: 18px; }
.di-badge { background: #e74c3c; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; text-align: center; line-height: 18px; padding: 0 4px; margin:0 4px; }
.di-icon-green { width: 24px; text-align: center; font-size: 18px; }
.di-icon-red { width: 24px; text-align: center; font-size: 18px; }
.di-icon-blue { width: 24px; text-align: center; font-size: 18px; }
.di-icon-orange { width: 24px; text-align: center; font-size: 18px; }
.dis-item.danger span { color: #e74c3c; }

.toggle-sw { font-size: 18px; color: #ccc; }

/* ---------- Me (我) ---------- */
.me-profile {
  display: flex; align-items: center; padding: 20px 20px; background: #fff;
  cursor: pointer;
}
.me-profile:active { background: #ECECEC; }
.me-avatar {
  width: 60px; height: 60px; border-radius: 8px; background: #07C160;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600; color: #fff; margin-right: 16px; flex-shrink: 0;
}
.me-info { flex: 1; }
.me-name { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.me-wxid { font-size: 13px; color: #888; }
.me-qr { font-size: 22px; color: #888; }
.me-section { margin-top: 0; }

/* ---------- Chat Detail (聊天详情) ---------- */
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; background: #EDEDED; }
.chat-msgs .msg-row { display: flex; margin-bottom: 16px; align-items: flex-start; }
.chat-msgs .msg-row.self { flex-direction: row-reverse; }

.chat-msgs .msg-avatar {
  width: 36px; height: 36px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #fff;
}
.chat-msgs .self .msg-avatar { background: #07C160; }
.chat-msgs .other .msg-avatar { background: #888; }

.msg-bubble-wrap { max-width: 70%; margin: 0 10px; }
.msg-sender-name {
  font-size: 11px; color: #888; margin-bottom: 2px; padding-left: 2px;
}
.msg-bubble {
  padding: 10px 14px; border-radius: 4px; font-size: 16px; line-height: 1.5;
  word-break: break-word; position: relative;
}
.other .msg-bubble { background: #fff; color: #191919; }
.self .msg-bubble { background: #95EC69; color: #191919; }

.msg-bubble.voice { display: flex; align-items: center; gap: 6px; min-width: 60px; cursor: pointer; }
.msg-bubble.voice .v-icon { font-size: 18px; }
.self .msg-bubble.voice { flex-direction: row-reverse; }

.msg-bubble.image { padding: 2px; background: transparent!important; }
.msg-bubble.image img { max-width: 200px; max-height: 200px; border-radius: 4px; display: block; cursor: pointer; }

.msg-system { text-align: center; margin-bottom: 12px; }
.msg-system span { font-size: 12px; color: #b0b0b0; background: #dcdcdc; padding: 2px 10px; border-radius: 2px; }

.msg-time { font-size: 10px; color: #b0b0b0; margin-top: 2px; white-space: nowrap; }

.msg-bubble.redpack { background: #FA5151!important; color: #fff!important; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 180px; }
.msg-bubble.redpack .rp-icon { font-size: 28px; }
.msg-bubble.redpack .rp-text { font-size: 14px; }

.msg-bubble.transfer { background: #fff!important; border: 2px solid #FF9800; display: flex; flex-direction: column; align-items: center; padding: 14px; cursor: pointer; min-width: 160px; }
.msg-bubble.transfer .tf-label { font-size: 13px; color: #333; }
.msg-bubble.transfer .tf-amount { font-size: 22px; font-weight: 700; color: #FF9800; margin-top: 4px; }

.msg-bubble.location { background: #fff!important; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 160px; }
.msg-bubble.location .loc-icon { font-size: 22px; }
.msg-bubble.location .loc-text { font-size: 14px; color: #333; }

.msg-bubble.file { background: #fff!important; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.msg-bubble.file .file-icon { font-size: 28px; }
.msg-bubble.file .file-name { font-size: 14px; color: #333; flex: 1; }
.msg-bubble.file .file-size { font-size: 12px; color: #999; }

.msg-bubble.video { padding: 2px; background: transparent!important; }

/* Red packet overlay */
.redpack-overlay { position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; }
.redpack-card { background: #FA5151; border-radius: 12px; padding: 30px 40px; text-align: center; color: #fff; position: relative; }
.redpack-card .rp-close { position: absolute; top: 10px; right: 14px; font-size: 20px; cursor: pointer; color: rgba(255,255,255,.7); }
.redpack-card .rp-card-icon { font-size: 48px; margin-bottom: 8px; }
.redpack-card .rp-card-from { font-size: 15px; margin-bottom: 12px; }
.redpack-card .rp-card-amount { font-size: 36px; font-weight: 700; color: #FFD700; }
.redpack-card .rp-card-hint { font-size: 12px; margin-top: 8px; opacity: .8; }

/* Call overlay */
.call-overlay { position: fixed; inset: 0; z-index: 800; background: #2c2c2c; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.call-overlay .call-bg { position: absolute; inset: 0; opacity: .1; background: linear-gradient(135deg, #07C160, #1485EE); }
.call-peer-name { font-size: 22px; font-weight: 600; margin-bottom: 8px; z-index: 1; }
.call-status { font-size: 14px; opacity: .7; margin-bottom: 20px; z-index: 1; }
.call-avatar-big { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #fff; margin-bottom: 20px; z-index: 1; }
.call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.call-local-video { position: absolute; top: 20px; right: 20px; width: 120px; height: 160px; border-radius: 8px; object-fit: cover; z-index: 2; border: 2px solid rgba(255,255,255,.3); }
.call-actions { position: absolute; bottom: 50px; display: flex; gap: 30px; z-index: 3; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 14px; cursor: pointer; }
.call-btn-end { background: #e74c3c; color: #fff; }
.call-btn-switch { background: rgba(255,255,255,.3); color: #fff; }

.msg-typing { font-size: 12px; color: #888; padding: 4px 0; text-align: center; }

/* Input Area */
.chat-input-area { flex-shrink: 0; background: #F7F7F7; border-top: 1px solid #ddd; }
.ci-bar { display: flex; align-items: center; padding: 6px 8px; gap: 4px; }
.ci-btn { font-size: 26px; padding: 4px; color: #555; min-width: 36px; text-align: center; }
.ci-input-wrap { flex: 1; position: relative; }
.ci-input-wrap input {
  width: 100%; padding: 8px 12px; background: #fff; border-radius: 4px;
  font-size: 15px; border: none;
}
.ci-voice-hold {
  width: 100%; padding: 10px; background: #fff; border-radius: 4px;
  text-align: center; font-size: 15px; color: #191919; cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.ci-voice-hold:active { background: #c8c8c8; }
.ci-voice-hold.recording { background: #c8c8c8; color: #07C160; }

/* Emoji Panel */
.emoji-panel { background: #F0F0F0; padding: 10px; max-height: 200px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-panel span { font-size: 24px; text-align: center; padding: 6px; cursor: pointer; border-radius: 4px; }
.emoji-panel span:active { background: #ddd; }

/* Plus Panel */
.plus-panel { background: #F0F0F0; padding: 16px 0; }
.plus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 0; padding: 0 20px; }
.plus-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; padding: 8px 0; }
.plus-item span { font-size: 12px; color: #666; margin-top: 4px; }
.pp-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.pp-green { background: #E8F8E8; }
.pp-blue { background: #E8EEF8; }
.pp-orange { background: #FDF0E8; }
.pp-red { background: #FCE8E8; }
.pp-purple { background: #F0E8FC; }

/* ---------- Slide Pages (子页面) ---------- */
.slide-page {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: #EDEDED; flex-direction: column; overflow: hidden;
}
.slide-page.active { display: flex; }

/* Chat Info */
.ci-members { padding: 16px; background: #fff; display: flex; flex-wrap: wrap; gap: 12px; }
.ci-member { display: flex; flex-direction: column; align-items: center; width: 55px; }
.cim-avatar {
  width: 44px; height: 44px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px;
}
.cim-name { font-size: 11px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55px; text-align: center; }

/* Create Group Page */
.cg-list { flex: 1; overflow-y: auto; background: #fff; }
.cg-row {
  display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.cg-row:active { background: #ECECEC; }
.cg-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ccc;
  margin-right: 12px; flex-shrink: 0; transition: all .15s;
}
.cg-check.checked { background: #07C160; border-color: #07C160; }
.cg-check.checked::after {
  content: '✓'; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; height: 100%;
}
.cg-avatar {
  width: 40px; height: 40px; border-radius: 4px; margin-right: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #fff;
}
.cg-name { font-size: 16px; color: #191919; }

/* Group Info Page */
.gi-members {
  padding: 16px; background: #fff; display: flex; flex-wrap: wrap; gap: 12px;
}
.gi-member { display: flex; flex-direction: column; align-items: center; width: 55px; }
.gim-avatar {
  width: 44px; height: 44px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 4px;
}
.gim-name { font-size: 11px; color: #666; text-align: center; max-width: 55px; word-break: break-all; }
.gim-tag {
  color: #07C160; font-size: 10px; background: #E8F8E8;
  padding: 1px 4px; border-radius: 2px; margin-left: 2px;
}
.gi-name-row {
  display: flex; align-items: center; padding: 14px 16px;
  background: #fff; border-bottom: 1px solid #f0f0f0; font-size: 16px;
}
.gi-name-row > span:nth-child(2) { flex: 1; margin-left: 12px; color: #888; }
.gi-name-row > span:nth-child(3) { color: #ccc; font-size: 18px; }

/* Moments */
.moments-cover { position: relative; }
.mc-cover { height: 260px; background: linear-gradient(135deg, #2a2a2a, #4a4a4a); }
.moments-profile {
  background: #fff; padding: 12px 20px 16px; display: flex; align-items: center; margin-bottom: 10px;
}
.mp-avatar {
  width: 64px; height: 64px; border-radius: 8px; background: #07C160;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; font-weight: 600; margin-right: 16px; margin-top: -32px;
}
.mp-name { font-size: 18px; font-weight: 600; margin-top: -16px; }

.moments-list { flex: 1; overflow-y: auto; }
.moment-item { background: #fff; padding: 16px; margin-bottom: 10px; }
.mi-header { display: flex; align-items: flex-start; margin-bottom: 10px; }
.mi-avatar {
  width: 40px; height: 40px; border-radius: 4px; flex-shrink: 0; margin-right: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 600;
}
.mi-info { flex: 1; }
.mi-name { font-size: 16px; color: #576B95; font-weight: 500; }
.mi-text { font-size: 15px; margin: 6px 0; line-height: 1.5; }
.mi-time { font-size: 12px; color: #888; margin-top: 8px; }
.mi-actions { display: flex; gap: 20px; margin-top: 8px; font-size: 12px; color: #888; }

/* Contact Detail */
.cd-card {
  background: #fff; padding: 30px 20px; margin-bottom: 10px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cd-avatar {
  width: 64px; height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600; color: #fff; margin-bottom: 12px;
}
.cd-name { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.cd-wxid, .cd-region { font-size: 14px; color: #888; margin-bottom: 4px; }
.cd-btns {
  background: #fff; padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.cd-btn {
  width: 100%; padding: 12px; background: #07C160; color: #fff; font-size: 16px; border-radius: 6px; text-align: center;
}
.cd-btn-outline { background: #fff; color: #07C160; border: 1px solid #07C160; }

/* Profile */
.profile-avatar-row { justify-content: space-between; }
.pa-right { display: flex; align-items: center; gap: 8px; }
.pa-avatar {
  width: 56px; height: 56px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: #fff; background: #07C160;
}
.pa-val { color: #888; margin-right: 4px; }

/* ---------- Add Friend ---------- */
.add-friend-res { padding: 12px; }
.afr-card {
  background: #fff; padding: 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px;
}
.afr-avatar {
  width: 48px; height: 48px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.afr-info { flex: 1; }
.afr-name { font-size: 16px; font-weight: 600; }
.afr-wxid { font-size: 13px; color: #888; }
.afr-actions { display: flex; gap: 8px; }
.afr-btn {
  padding: 6px 14px; border-radius: 4px; font-size: 14px; border: none; cursor: pointer;
}
.afr-btn.accept { background: #07C160; color: #fff; }
.afr-btn.reject { background: #f2f2f2; color: #666; }
.afr-btn.add { background: #07C160; color: #fff; padding: 6px 16px; }

/* ---------- Scan Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.95);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.scan-box {
  display: flex; flex-direction: column; align-items: center;
}
.scan-close { position: absolute; top: 20px; right: 20px; font-size: 28px; color: #fff; cursor: pointer; }
.scan-frame {
  width: 220px; height: 220px; border: 2px solid #07C160; position: relative; overflow: hidden;
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px; background: #07C160;
  animation: scanMove 2s ease-in-out infinite;
}
@keyframes scanMove {
  0% { top: 0; } 50% { top: 100%; } 100% { top: 0; }
}
.scan-hint { color: #aaa; font-size: 14px; margin-top: 20px; }
.scan-hint-sub { color: #666; font-size: 13px; margin-top: 12px; }
.scan-album-btn {
  margin-top: 12px; padding: 10px 24px; background: #07C160; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; cursor: pointer;
}

/* ---------- QR Card Overlay ---------- */
#qr-card-overlay { flex-direction: column; }
.qr-card-box {
  background: #fff; border-radius: 16px; width: 300px; max-width: 90vw;
  padding: 30px 24px; position: relative; text-align: center;
}
.qr-close {
  position: absolute; top: 12px; right: 14px; font-size: 22px; color: #999;
  cursor: pointer; background: none; border: none;
}
.qr-card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;
}
.qr-card-avatar {
  width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: #fff;
}
.qr-card-info { text-align: left; }
.qr-card-name { font-size: 17px; font-weight: 600; color: #191919; }
.qr-card-wxid { font-size: 13px; color: #888; margin-top: 2px; }
.qr-card-body { padding: 0 10px; }
#qr-canvas-wrap { margin-bottom: 12px; }
.qr-card-img { width: 180px; height: 180px; display: block; margin: 0 auto; }
.qr-card-fallback { padding: 60px; background: #f5f5f5; border-radius: 8px; color: #888; font-size: 16px; }
.qr-card-hint { font-size: 12px; color: #aaa; margin-top: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 999;
  background: rgba(0,0,0,.75); color: #fff; padding: 10px 20px; border-radius: 6px;
  font-size: 14px; pointer-events: none; white-space: nowrap;
}

/* ---------- Desktop: 居中窄屏手机样式 ---------- */
@media (min-width: 769px) {
  html { background: #d6d6d6; }
  body { display: flex; justify-content: center; align-items: center; }
  .screen {
    position: relative; width: 430px; max-width: 100vw; height: 100vh; max-height: 932px;
    border-radius: 12px; box-shadow: 0 4px 40px rgba(0,0,0,.15);
    flex-shrink: 0;
  }
}

/* ---------- Landscape / Scroll ---------- */
::-webkit-scrollbar { width: 0; }
