:root {
  --wx-green: #07c160;
  --wx-bg: #ededed;
  --wx-header: #ededed;
  --wx-bubble-mine: #95ec69;
  --wx-bubble-other: #ffffff;
  --wx-line: #e5e5e5;
  --wx-text: #111111;
  --wx-sub: #888888;
  --wx-red: #fa5151;
  /* 主题可覆盖的扩展变量 */
  --wx-card-bg: #ffffff;
  --wx-input-bg: #ffffff;
  --wx-tab-bg: #f7f7f7;
  --wx-mine-text: #111111;
  --wx-mine-link: #ffffff;
  --wx-theme-name: "经典";
  /* 皮肤套装背景层（经典为空 = 纯色，无壁纸） */
  --skin-bg: none;
  --skin-cover: transparent;
}

/* ================= 女生皮肤（5 套） ================= */
[data-theme="pink"] {
  --wx-green: #ff5f8d; --wx-bg: #ffe9f0; --wx-header: #ffb6c9;
  --wx-bubble-mine: #ff8fae; --wx-bubble-other: #ffffff;
  --wx-line: #ffd7e2; --wx-tab-bg: #fff0f5; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "甜心粉";
  --skin-bg: url(/skins/pink.jpg); --skin-cover: rgba(255,233,240,0.40);
}
[data-theme="sakura"] {
  --wx-green: #ff7ba9; --wx-bg: #fff6f8; --wx-header: #ffd6e0;
  --wx-bubble-mine: #ffb6cd; --wx-bubble-other: #ffffff;
  --wx-line: #ffe1e8; --wx-tab-bg: #fff8fa; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "樱花粉";
  --skin-bg: url(/skins/sakura.jpg); --skin-cover: rgba(255,246,248,0.38);
}
[data-theme="lavender"] {
  --wx-green: #8a6df0; --wx-bg: #f3eefe; --wx-header: #e3dbff;
  --wx-bubble-mine: #a48df7; --wx-bubble-other: #ffffff;
  --wx-line: #e4dcff; --wx-tab-bg: #f6f3ff; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "梦幻紫";
  --skin-bg: url(/skins/lavender.jpg); --skin-cover: rgba(243,238,254,0.30);
}
[data-theme="mint"] {
  --wx-green: #2bbf9c; --wx-bg: #e9faf4; --wx-header: #c5f0e4;
  --wx-bubble-mine: #8fe3cb; --wx-bubble-other: #ffffff;
  --wx-line: #d3f3ea; --wx-tab-bg: #f2fbf7; --wx-mine-text: #0b6b56; --wx-mine-link: #ffffff;
  --wx-theme-name: "薄荷青";
  --skin-bg: url(/skins/mint.jpg); --skin-cover: rgba(233,250,244,0.42);
}
[data-theme="peach"] {
  --wx-green: #ff8a65; --wx-bg: #fff2ec; --wx-header: #ffdccb;
  --wx-bubble-mine: #ffab8c; --wx-bubble-other: #ffffff;
  --wx-line: #ffe3d5; --wx-tab-bg: #fff7f2; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "蜜桃橙";
  --skin-bg: url(/skins/peach.jpg); --skin-cover: rgba(255,242,236,0.42);
}
/* 男生风格皮肤（2 套，纯风格无人物） */
[data-theme="cyber"] {
  --wx-green: #2e9eff; --wx-bg: #eaf4ff; --wx-header: #c2dcff;
  --wx-bubble-mine: #5aa9ff; --wx-bubble-other: #ffffff;
  --wx-line: #cfe5ff; --wx-tab-bg: #f0f7ff; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "极夜蓝";
  --skin-bg: url(/skins/cyber.jpg); --skin-cover: rgba(234,244,255,0.44);
}
[data-theme="night"] {
  --wx-green: #8a5cf6; --wx-bg: #f0ecff; --wx-header: #d5c6ff;
  --wx-bubble-mine: #9b78f9; --wx-bubble-other: #ffffff;
  --wx-line: #e2d8ff; --wx-tab-bg: #f6f2ff; --wx-mine-text: #ffffff; --wx-mine-link: #ffffff;
  --wx-theme-name: "暗夜紫";
  --skin-bg: url(/skins/night.jpg); --skin-cover: rgba(240,236,255,0.44);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--wx-bg); color: var(--wx-text); font-size: 16px;
  overflow: hidden; user-select: none; overscroll-behavior: none;
}
#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; }
/* 皮肤套装背景层：铺满整屏，供主界面/聊天页/登录页共用；经典主题为纯色 */
#skin-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-color: var(--wx-bg);
  background-image:
    linear-gradient(var(--skin-cover, transparent), var(--skin-cover, transparent)),
    var(--skin-bg);
  background-size: cover, cover;
  background-position: center 62%, center 62%;
  background-repeat: no-repeat, no-repeat;
}
/* 主界面浮于背景层之上（views 透明，露出#skin-bg壁纸） */
#main { position: relative; z-index: 1; }
/* 聊天页/登录页各自直接承载壁纸背景（不透明，盖住下层），经典为纯色 */
#login, #chat, #kf-center, #kf-list {
  background-color: var(--wx-bg);
  background-image: linear-gradient(var(--skin-cover, transparent), var(--skin-cover, transparent)), var(--skin-bg);
  background-size: cover, cover;
  background-position: center 62%, center 62%;
  background-repeat: no-repeat, no-repeat;
}
#kf-list { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; }
#kf-list .topbar { padding: 10px 16px; height: calc(52px + env(safe-area-inset-top)); }
#kfl-body { flex: 1; overflow-y: auto; padding-bottom: 20px; }
#kfl-body .empty { color: #999; font-size: 14px; text-align: center; padding: 60px 0; }
/* 主界面占满整屏：顶栏 + 内容(flex:1) + 底部Tab 正确分层 */
#main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------- 通用组件 ---------- */
.btn { border: none; background: var(--wx-green); color: #fff; border-radius: 6px; padding: 10px 18px; font-size: 15px; cursor: pointer; }
.btn:active { opacity: .8; }
.btn.plain { background: transparent; color: var(--wx-green); }
.btn.gray { background: #c0c0c0; }
.input { border: 1px solid #ccc; border-radius: 6px; padding: 10px 12px; font-size: 15px; width: 100%; background: var(--wx-input-bg); outline: none; }
.avatar {
  width: 44px; height: 44px; border-radius: 6px; background: #d0d0d0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 17px;
  overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.hidden { display: none !important; }

/* "我"页头像：右下角相机角标，点击换头像 */
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-wrap .avatar { width: 58px; height: 58px; font-size: 22px; }
.avatar-wrap .cam {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 1px solid var(--wx-line); display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
}
#me-profile { gap: 14px; padding: 16px 14px; }

/* ---------- 登录页 ---------- */
#login { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
#login .logo { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 14px; }
#login h1 { font-size: 22px; margin-bottom: 30px; font-weight: 600; }
#login .tabs { display: flex; margin-bottom: 22px; width: 100%; max-width: 320px; }
#login .tabs span { flex: 1; text-align: center; padding-bottom: 8px; border-bottom: 2px solid #ddd; cursor: pointer; color: #666; }
#login .tabs span.active { color: var(--wx-green); border-bottom-color: var(--wx-green); font-weight: 600; }
#login .form { width: 100%; max-width: 320px; }
#login .form .input { margin-bottom: 14px; }
#login .btn { width: 100%; padding: 12px; font-size: 16px; margin-top: 6px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--wx-header); padding: 8px 14px; display: flex; align-items: center; gap: 12px;
  height: calc(50px + env(safe-area-inset-top)); border-bottom: 0.5px solid var(--wx-line); flex-shrink: 0;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.topbar .title { flex: 1; font-size: 17px; font-weight: 600; text-align: center; }
.topbar .icon-btn { font-size: 22px; cursor: pointer; min-width: 28px; text-align: center; color: var(--wx-text); display: flex; align-items: center; justify-content: center; }
.topbar .back { font-size: 24px; }
/* 微信式主顶栏：标题靠左 + 右上角"+" */
.topbar.main { padding: 10px 16px; height: calc(52px + env(safe-area-inset-top)); }
.topbar.main .title { text-align: left; font-size: 18px; font-weight: 600; }
.topbar.main .icon-btn svg { width: 24px; height: 24px; }
.topbar.main .icon-btn.hidden { display: none; }

/* 微信式搜索框 */
.searchbar {
  background: var(--wx-header); padding: 7px 12px; display: flex; align-items: center; gap: 6px;
  border-bottom: 0.5px solid var(--wx-line); position: sticky; top: 0; z-index: 2;
}
.searchbar .mag { width: 15px; height: 15px; flex-shrink: 0; margin-left: 4px; }
.searchbar input {
  flex: 1; height: 32px; border: none; border-radius: 6px; background: var(--wx-input-bg); padding: 0 10px;
  font-size: 14px; outline: none; color: var(--wx-text);
}
.searchbar input::placeholder { color: #bbb; }

/* ---------- 底部 Tab ---------- */
#tabbar {
  display: flex; background: var(--wx-tab-bg); border-top: 0.5px solid var(--wx-line);
  height: calc(54px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); flex-shrink: 0;
}
#tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #888; cursor: pointer; }
#tabbar .tab .icon { font-size: 0; line-height: 0; display: flex; position: relative; }
#tabbar .tab .icon svg { width: 25px; height: 25px; }
.tab-badge { position: absolute; top: -4px; right: -10px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: #fa5151; color: #fff; font-size: 10px; text-align: center; padding: 0 4px; box-sizing: border-box; font-weight: 600; }
.tab-badge.hidden { display: none; }
#tabbar .tab .label { font-size: 10px; }
#tabbar .tab.active { color: var(--wx-green); }

/* ---------- 主内容 ---------- */
#views { flex: 1; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: transparent; display: none; }
.view.active { display: block; }

/* 会话列表 / 联系人行：半透明白，让皮肤壁纸透出来 */
.row { display: flex; align-items: center; padding: 12px 14px; border-bottom: 0.5px solid var(--wx-line); background: rgba(255,255,255,0.55); cursor: pointer; gap: 12px; }
.row:active { background: #f2f2f2; }
.row .avatar { width: 46px; height: 46px; border-radius: 50%; }
.row .body { flex: 1; min-width: 0; }
.row .line1 { display: flex; justify-content: space-between; align-items: baseline; }
.row .name { font-size: 16px; color: var(--wx-text); font-weight: 400; }

/* 微信首页式左滑删除：会话项包一层，下层右侧红色删除按钮，上层行主体左滑露出 */
.conv-row { position: relative; overflow: hidden; border-bottom: 0.5px solid var(--wx-line); }
.conv-row .conv-del {
  position: absolute; right: 0; top: 0; bottom: 0; width: 92px;
  background: #fe2c55; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer;
}
.conv-row .conv-item {
  position: relative; background: #fff;
  display: flex; align-items: center; padding: 12px 14px; gap: 12px;
  transform: translateX(0);
}
.conv-item:active { background: #f2f2f2; }
.conv-item .avatar { width: 46px; height: 46px; border-radius: 50%; }
.conv-item .body { flex: 1; min-width: 0; }
.conv-item .line1 { display: flex; justify-content: space-between; align-items: baseline; }
.conv-item .name { font-size: 16px; color: var(--wx-text); font-weight: 400; }
.row .time { font-size: 12px; color: #bbb; flex-shrink: 0; }
.row .line2 { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.row .last { font-size: 13px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76%; }
.row .badge { background: var(--wx-red); color: #fff; border-radius: 10px; min-width: 18px; height: 18px; padding: 0 6px; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* conv-item（会话项）内部共用行样式 */
.conv-item .time { font-size: 12px; color: #bbb; flex-shrink: 0; }
.conv-item .line2 { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.conv-item .last { font-size: 13px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76%; }
.conv-item .badge { background: var(--wx-red); color: #fff; border-radius: 10px; min-width: 18px; height: 18px; padding: 0 6px; font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* 首页区块标题 */
.section-title { padding: 10px 14px; font-size: 13px; color: #888; background: var(--wx-bg); }
.section-title .more { float: right; color: var(--wx-green); }

/* 接待列表：访客在线/离线状态文字（卡片最右侧） */
.conv-item .tm { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; }
.conv-item .kf-online { font-size: 12px; }
.conv-item .kf-online.on { color: var(--wx-green); }
.conv-item .kf-online.off { color: #bbb; }
/* 聊天窗口顶部：访客在线/离线状态 */
.chat-online { font-size: 12px; margin-left: 4px; }
.chat-online.on { color: var(--wx-green); }
.chat-online.off { color: #999; }
.chat-online.hidden { display: none; }

/* 发现页 / 我页 */
.menu { background: rgba(255,255,255,0.72); }
.menu .row .icon { width: 26px; text-align: center; margin-right: 14px; font-size: 20px; }
.menu .row { border-bottom: 0.5px solid var(--wx-line); }

/* ---------- 聊天页 ---------- */
#chat { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; bottom: var(--kb-h, 0); }
#kf-center { position: fixed; inset: 0; z-index: 31; display: flex; flex-direction: column; }
#kf-center .kfc-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 30px; }
.kfc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 16px; }
.kfc-stat { background: rgba(255,255,255,0.88); border-radius: 10px; padding: 10px 4px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.kfc-stat b { display: block; font-size: 20px; color: #111; }
.kfc-stat span { display: block; font-size: 11px; color: #888; margin-top: 2px; }
.kfc-sec { margin-bottom: 16px; }
.kfc-sec-head { font-size: 13px; color: #888; margin: 6px 2px 8px; display: flex; align-items: center; justify-content: space-between; }
.kfc-addbtn { border: none; background: var(--wx-green); color: #fff; border-radius: 14px; font-size: 12px; padding: 4px 12px; cursor: pointer; }
.kfc-agents, .kfc-convs { background: rgba(255,255,255,0.92); border-radius: 10px; overflow: hidden; }
.kfc-agent { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 0.5px solid rgba(0,0,0,.05); flex-wrap: wrap; }
.kfc-agent:last-child { border-bottom: none; }
.kfc-agent .kfc-del { margin-left: auto; border: none; background: #f5f5f5; color: var(--wx-red); border-radius: 6px; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.kfc-agent .tag { font-size: 11px; color: var(--wx-green); margin-left: 6px; }
.kfc-audit { background: rgba(255,255,255,0.92); border-radius: 10px; overflow: hidden; }
.kfc-audit-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 0.5px solid rgba(0,0,0,.05); }
.kfc-audit-item:last-child { border-bottom: none; }
.kfc-au-info { flex: 1; min-width: 0; }
.kfc-au-info b { display: block; font-size: 14px; color: #111; }
.kfc-au-info span { display: block; font-size: 11px; color: #888; margin-top: 2px; }
.kfc-au-ops { display: flex; gap: 6px; flex-shrink: 0; }
.kfc-au-ops button { border: 0; border-radius: 6px; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.kfc-au-ops .ok { background: var(--wx-green); color: #fff; }
.kfc-au-ops .no { background: #f5f5f5; color: var(--wx-red); }
.kfc-conv { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 0.5px solid rgba(0,0,0,.05); cursor: pointer; }
.kfc-conv:last-child { border-bottom: none; }
.kfc-conv:active { background: rgba(0,0,0,.04); }
.kfc-conv .who { font-size: 15px; color: #111; font-weight: 600; }
.kfc-conv .last { font-size: 13px; color: #999; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 56vw; }
.kfc-conv .meta { margin-left: auto; text-align: right; font-size: 11px; color: #aaa; flex-shrink: 0; }
.kfc-conv .meta .cnt { display: inline-block; background: var(--wx-red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; margin-top: 4px; }
.kfc-empty { text-align: center; color: #aaa; font-size: 13px; padding: 22px 0; }
#kfc-back { cursor: pointer; }
#chat .msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 10px 10px; }
.msg-time { text-align: center; font-size: 12px; color: #aaa; margin: 10px 0; }
.msg { display: flex; margin-bottom: 12px; gap: 8px; align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg .bubble {
  max-width: 66%; padding: 9px 12px; border-radius: 6px; font-size: 15px; line-height: 1.5;
  word-break: break-word; position: relative; white-space: pre-wrap;
}
.msg.other .bubble { background: rgba(255,255,255,0.92); border: 0.5px solid rgba(0,0,0,.05); }
.msg.mine .bubble { background: var(--wx-bubble-mine); color: var(--wx-mine-text); }
.msg.mine .voice .dur { color: var(--wx-mine-text); }
.msg.mine .bars { color: var(--wx-mine-text); }
.msg .nick { font-size: 12px; color: #888; margin-bottom: 3px; }
.msg.other .nick { text-align: left; }
.msg img.content { max-width: 220px; max-height: 260px; border-radius: 6px; display: block; }
.msg .voice { display: flex; align-items: center; gap: 7px; min-width: 96px; }
.msg .voice .v-load { display: none; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.12); border-top-color: #07c160; border-radius: 50%; animation: vspin .8s linear infinite; flex: none; }
.msg .voice .bars { display: flex; align-items: center; gap: 2.5px; height: 22px; }
.msg .voice .bars i { width: 3.5px; height: 6px; background: currentColor; border-radius: 2px; display: inline-block; }
.msg .voice .dur { font-size: 12px; line-height: 1; color: #666; }
.msg .voice.loading .v-load { display: inline-block; }
.msg .voice.loading .bars { display: none; }
@keyframes vspin { to { transform: rotate(360deg); } }
/* 微信样式：自己的语音气泡波形朝右（气泡在右），别人的朝左 */
.msg.mine .voice { flex-direction: row-reverse; }
.msg .voice.playing .bars i { animation: kfbar .55s ease-in-out infinite alternate; }
.msg .voice.playing .bars i:nth-child(2) { animation-delay: .1s; }
.msg .voice.playing .bars i:nth-child(3) { animation-delay: .2s; }
.msg .voice.playing .bars i:nth-child(4) { animation-delay: .15s; }
.msg .voice.playing .bars i:nth-child(5) { animation-delay: .05s; }
@keyframes kfbar { from { height: 5px; } to { height: 20px; } }

/* 输入栏 */
#chat .inputbar {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; background: var(--wx-tab-bg);
  border-top: 0.5px solid var(--wx-line); padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
#chat .inputbar .tool { font-size: 26px; cursor: pointer; line-height: 1; width: 34px; height: 36px; display: flex; align-items: center; justify-content: center; color: #4a4a4a; }
#chat .inputbar .tool svg { display: block; }
#chat .inputbar .tool.active { color: var(--wx-green); }
#chat .inputbar textarea {
  flex: 1; resize: none; border: none; background: #fff; border-radius: 6px; padding: 9px 12px;
  font-size: 15px; font-family: inherit; outline: none; max-height: 72px; line-height: 1.4;
  min-height: 38px; height: 38px;
}
#chat .inputbar .send { background: var(--wx-green); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font-size: 15px; }
#chat .inputbar .hold {
  flex: 1; background: var(--wx-input-bg); border: 0.5px solid #ddd; border-radius: 6px; height: 38px;
  display: flex; align-items: center; justify-content: center; color: #666; font-size: 15px; text-align: center; cursor: pointer;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
#chat .inputbar .hold.recording { background: #e8e8e8; color: var(--wx-red); }
#chat .rec-hint {
  position: absolute; left: 50%; top: 36%; transform: translate(-50%,-50%);
  background: rgba(17,17,17,.75); color: #fff; border-radius: 12px; padding: 14px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 50;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
#chat .rec-hint .rh-tip { font-size: 13px; opacity: .92; white-space: nowrap; }
#chat .rec-hint .rh-timer { font-size: 24px; font-weight: 600; min-width: 70px; text-align: center; }
/* 按住说话时，上方左右两个指示区（左=上滑取消、右=上滑转文字） */
.rec-zone {
  position: fixed; top: 18%; width: 88px; height: 88px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: rgba(17,17,17,.68); color: #fff; font-size: 13px; line-height: 1.35; text-align: center;
  z-index: 1200; box-shadow: 0 2px 12px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
}
.rec-zone.show { display: flex; }
#rec-cancel { left: 22px; }
#rec-text { right: 22px; }
.rec-zone.active { transform: scale(1.14); }
#rec-cancel.active { background: #fa5151; }
#rec-text.active { background: #07c160; }
/* 上滑到取消区：变红，只显示"松开 取消" */
#chat .rec-hint.cancel { background: rgba(255,77,79,.88); }
#chat .rec-hint.cancel .rh-timer { display: none; }

/* ---------- 表情面板（微信式） ---------- */
#chat .emoji-panel { height: 252px; background: var(--wx-tab-bg); border-top: 0.5px solid var(--wx-line); display: flex; flex-direction: column; }
/* 快捷回复面板 */
#qk-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: #fff; border-top: 0.5px solid var(--wx-line); display: flex; flex-direction: column; height: 62vh; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
#qk-panel .qk-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 0.5px solid var(--wx-line); font-size: 16px; font-weight: 600; color: #111; }
#qk-panel .qk-head span:first-child { flex: 1; }
#qk-panel .qk-close { color: #999; font-weight: 400; font-size: 17px; cursor: pointer; margin-right: 16px; }
#qk-panel .qk-add { color: var(--wx-green); font-weight: 600; font-size: 14px; cursor: pointer; }
#qk-panel .qk-list { flex: 1; overflow-y: auto; padding: 6px 0; }
#qk-panel .qk-item { display: flex; align-items: center; padding: 11px 16px; border-bottom: 0.5px solid #f2f2f2; }
#qk-panel .qk-item:active { background: #f5f5f5; }
#qk-panel .qk-txt { flex: 1; font-size: 15px; color: #333; word-break: break-all; line-height: 1.4; }
#qk-panel .qk-img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
#qk-panel .qk-del { color: #fa5151; font-size: 15px; padding: 0 4px; margin-left: 10px; cursor: pointer; flex-shrink: 0; }
#qk-panel .qk-vw { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
#qk-panel .qk-vbars { display: flex; align-items: center; gap: 2.5px; height: 20px; flex-shrink: 0; }
#qk-panel .qk-vbars i { width: 3px; height: 6px; background: #07c160; border-radius: 2px; display: inline-block; }
#qk-panel .qk-vdur { font-size: 12px; color: #888; flex-shrink: 0; }
#qk-panel .qk-vnote { flex: 1; font-size: 13px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#qk-panel .qk-edit { color: #576b95; font-size: 13px; margin-left: 10px; cursor: pointer; flex-shrink: 0; }
#qk-panel .qk-send { background: var(--wx-green); color: #fff; font-size: 13px; padding: 5px 14px; border-radius: 4px; margin-left: 10px; cursor: pointer; flex-shrink: 0; }
#qk-panel .qk-send:active { opacity: .8; }
#qk-panel .qk-tip { padding: 8px 16px; color: #999; font-size: 12px; text-align: center; border-top: 0.5px solid #f2f2f2; }
#qk-panel .qk-empty { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }
/* 语音快捷回复录音弹层 */
.qk-rec-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200; display: flex; align-items: center; justify-content: center; }
.qk-rec-box { width: 82%; max-width: 340px; background: #fff; border-radius: 14px; padding: 26px 20px 18px; text-align: center; }
.qk-rec-title { font-size: 16px; font-weight: 600; color: #111; }
.qk-rec-timer { font-size: 42px; color: #07c160; font-weight: 700; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.qk-rec-btn { width: 120px; height: 120px; border-radius: 50%; background: #07c160; color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; margin: 10px auto; cursor: pointer; user-select: none; }
.qk-rec-btn.rec-on { background: #fa5151; animation: qkPulse 1.2s ease-in-out infinite; }
@keyframes qkPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(250,81,81,.45); } 50% { box-shadow: 0 0 0 18px rgba(250,81,81,0); } }
.qk-rec-tip { font-size: 12px; color: #999; margin-top: 6px; }
.qk-rec-cancel { display: inline-block; margin-top: 16px; color: #999; font-size: 14px; padding: 8px 32px; cursor: pointer; }
.emoji-tabs { display: flex; align-items: center; padding: 0 6px; height: 38px; border-bottom: 0.5px solid var(--wx-line); overflow-x: auto; background: var(--wx-tab-bg); }
.emoji-tab { flex-shrink: 0; display: flex; align-items: center; gap: 3px; padding: 6px 10px; font-size: 13px; color: var(--wx-sub); border-bottom: 2px solid transparent; cursor: pointer; }
.emoji-tab .t-ic { font-size: 17px; line-height: 1; }
.emoji-tab.active { color: var(--wx-green); border-bottom-color: var(--wx-green); font-weight: 600; }
.emoji-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); padding: 8px 6px; }
.emoji-cell { font-size: 27px; line-height: 1; padding: 6px 2px; text-align: center; cursor: pointer; border-radius: 6px; }
.emoji-cell:active { background: rgba(0,0,0,.08); }
.emoji-cell.big { font-size: 34px; }
.emoji-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 12px; border-top: 0.5px solid var(--wx-line); }
.emoji-del { width: 38px; height: 34px; display: flex; align-items: center; justify-content: center; color: #5a5a5a; cursor: pointer; }
.emoji-del svg { display: block; }
.emoji-send { background: var(--wx-green); color: #fff; border-radius: 5px; padding: 7px 18px; font-size: 15px; cursor: pointer; }
.emoji-send:active { opacity: .8; }

/* 模态框 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 120; display: flex; align-items: center; justify-content: center; }
.mask .sheet { background: #fff; width: 86%; max-width: 360px; border-radius: 12px; padding: 18px; max-height: 80vh; overflow-y: auto; }
/* 微信式底部动作面板 */
.sheet-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; background: #fff;
  border-radius: 12px 12px 0 0; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); overflow: hidden;
}
.sheet-bottom .plus-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-size: 16px; border-bottom: 0.5px solid var(--wx-line); cursor: pointer; }
.sheet-bottom .plus-item:active { background: #f2f2f2; }
.sheet-bottom .plus-item .pi-ic { font-size: 20px; width: 26px; text-align: center; }
.sheet-bottom .plus-cancel { text-align: center; padding: 14px; font-size: 16px; cursor: pointer; color: #333; }
.sheet-bottom .plus-cancel:active { background: #f2f2f2; }

/* ---------- 皮肤换肤 ---------- */
.theme-now { margin-left: auto; font-size: 13px; color: var(--wx-sub); }
.theme-grid { display: flex; flex-wrap: wrap; gap: 16px 4%; padding: 4px 0; }
.theme-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30.6%; cursor: pointer; }
.theme-item .swatch { width: 64px; height: 96px; border-radius: 8px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); position: relative; overflow: hidden; }
.theme-item .swatch.on::after {
  content: '✓'; position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px;
  background: var(--wx-green); color: #fff; border-radius: 50%; font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff;
}
.theme-item .tname { font-size: 12px; color: var(--wx-sub); }
.theme-item .tname.cur { color: var(--wx-green); font-weight: 600; }
.mask .sheet h3 { font-size: 16px; margin-bottom: 14px; text-align: center; }
.mask .sheet .field { margin-bottom: 12px; }
.mask .sheet .pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 0.5px solid var(--wx-line); cursor: pointer; }
.mask .sheet .pick-item.on { color: var(--wx-green); }
.mask .sheet .actions { display: flex; gap: 10px; margin-top: 14px; }
.mask .sheet .actions .btn { flex: 1; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--wx-bg); border-radius: 14px; padding: 5px 10px; font-size: 13px; cursor: pointer; }

/* 图片查看 */
#lightbox { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 9999; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#lightbox img { max-width: 100%; max-height: 100%; }
#lightbox .lb-close { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 10000; cursor: pointer; }

.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.8); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; z-index: 80; }

/* ---------- 撤回/删除占位 ---------- */
.msg.sys { justify-content: center; }
.msg.sys .msg-ph { font-size: 13px; color: #999; background: transparent; box-shadow: none; padding: 4px 0; text-align: center; }

/* ---------- 长按消息菜单 / 顶栏菜单（底部动作面板） ---------- */
.action-sheet { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; bottom: var(--kb-h, 0); }
.action-sheet .as-box { width: 100%; background: #fff; border-radius: 12px 12px 0 0; padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); }
.action-sheet .as-item { text-align: center; padding: 14px; font-size: 16px; border-bottom: .5px solid #e5e5e5; cursor: pointer; }
.action-sheet .as-item.danger { color: #fa5151; }
.action-sheet .as-cancel { text-align: center; padding: 14px; font-size: 16px; color: #555; margin-top: 6px; cursor: pointer; }

/* ---------- 禁止选中，防止长按弹出系统"拷贝/翻译/搜索"菜单 ---------- */
#chat .msgs, #chat .msgs .msg, #chat .msgs .msg * {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- TG 式删除确认弹窗 ---------- */
.dlg-mask { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.dlg-box { width: min(78%, 300px); background: #fff; border-radius: 14px; overflow: hidden; text-align: center; }
.dlg-title { font-size: 16px; font-weight: 600; padding: 18px 20px 6px; }
.dlg-body { font-size: 14px; color: #666; padding: 0 20px 16px; line-height: 1.5; }
.dlg-btns { display: flex; border-top: .5px solid #eee; }
.dlg-btn { flex: 1; padding: 13px; font-size: 15px; cursor: pointer; border-left: .5px solid #eee; }
.dlg-btn:first-child { border-left: 0; }
.dlg-btn.danger { color: #fa5151; font-weight: 600; }

/* ---------- 长按消息高亮反馈 ---------- */
.msg.lp .bubble { box-shadow: 0 0 0 2px rgba(0,0,0,.10); }

/* ---------- 首页聊天列表：行背景全透明（露出壁纸），分割线纯白清晰 ---------- */
#view-chats #chat-list .row,
#view-chats .row {
  background: transparent;
  border-bottom: 1px solid #ffffff;
}
/* 分割线只在聊天之间，去掉搜索栏下方的多余影响（列表首行） */
#view-chats #chat-list .row:last-child { border-bottom: none; }

/* ---------- 聊天气泡：无论哪套皮肤，气泡一律纯白、文字一律黑色 ---------- */
.msg .bubble { background: #ffffff; color: #000000; border: 0.5px solid rgba(0,0,0,.06); }
.msg.other .bubble { background: #ffffff; color: #000000; }
.msg.mine .bubble { background: #ffffff; color: #000000; }
.msg.mine .voice .dur, .msg.mine .bars, .msg .voice .dur { color: #000000; }

/* ========== 安装到桌面引导浮层（微信风底部提示） ========== */
.install-banner {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  background: #ffffff; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
  z-index: 9999; overflow: hidden;
  animation: ibUp .25s ease;
}
@keyframes ibUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.ib-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px; }
.ib-icon { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.ib-htext { flex: 1; min-width: 0; }
.ib-title { font-size: 16px; font-weight: 600; color: #000; }
.ib-sub { font-size: 12px; color: #888; margin-top: 2px; line-height: 1.4; }
.ib-close { font-size: 22px; color: #999; line-height: 1; padding: 2px 6px; cursor: pointer; flex-shrink: 0; }
.ib-body { padding: 0 14px 14px; }
.ib-tip { font-size: 13px; color: #666; margin-bottom: 10px; line-height: 1.6; }
.ib-btn { display: block; width: 100%; background: #07c160; color: #fff; border: none; border-radius: 8px; padding: 12px 0; font-size: 16px; font-weight: 600; cursor: pointer; }
.ib-btn:active { background: #06ad56; }
.ib-steps .ib-step { font-size: 14px; color: #333; padding: 7px 0; border-bottom: 1px solid #f2f2f2; line-height: 1.5; }
.ib-steps .ib-step:last-child { border-bottom: none; }
.ib-note { font-size: 12px; color: #999; margin-top: 8px; line-height: 1.5; }

/* ---------- 朋友圈（微信样式） ---------- */
#moments { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #ededed; }
/* 顶部封面横幅 */
.mom-banner { position: relative; height: 200px; flex-shrink: 0; }
.mom-cover { position: absolute; inset: 0; background: linear-gradient(160deg, #7fb2ff 0%, #a8c9ff 45%, #dbe6ff 100%); }
.mom-back { position: absolute; top: 14px; left: 12px; z-index: 2; color: #fff; font-size: 28px; line-height: 1; padding: 2px 6px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.mom-banner-title { position: absolute; left: 16px; bottom: 16px; color: #fff; font-size: 26px; font-weight: 600; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.mom-cam { position: absolute; top: 14px; right: 12px; z-index: 2; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
#mom-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 30px; }
.mom-card { background: #fff; padding: 0 16px; margin: 0; border-radius: 0; }
.mom-head { display: flex; align-items: flex-start; gap: 12px; padding-top: 16px; }
.mom-head .avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 3px; }
.mom-head-main { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.mom-name { font-size: 17px; font-weight: 600; color: #576b95; line-height: 1.3; }
.mom-pin-tag { font-size: 11px; color: #fa5151; border: 1px solid #fa5151; border-radius: 3px; padding: 0 4px; font-weight: 400; flex-shrink: 0; }
.mom-time { font-size: 12px; color: #b2b2b2; margin-top: 2px; }
.mom-del { font-size: 12px; color: #b2b2b2; cursor: pointer; flex-shrink: 0; margin-left: 6px; }
.mom-content { font-size: 17px; line-height: 1.45; margin-top: 8px; word-break: break-word; color: #222; }
.mom-imgs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.mom-img { width: calc(33.333% - 3px); aspect-ratio: 1; object-fit: cover; border-radius: 3px; display: block; }
.mom-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 0 14px; }
.mom-foot-left { display: flex; align-items: center; gap: 10px; }
.mom-time2 { font-size: 12px; color: #b2b2b2; }
.mom-foot-acts { display: flex; align-items: center; gap: 2px; }
.mom-act { border: 0; background: none; font-size: 13px; color: #576b95; cursor: pointer; padding: 4px 6px; }
.mom-act.like.on { color: #fa5151; }
.mom-act .num { color: #b2b2b2; font-size: 12px; }
.mom-likers { margin: 0 0 8px; background: #f7f7f7; border-radius: 6px; padding: 6px 10px; font-size: 14px; color: #333; }
.mom-likers .lc { color: #576b95; font-weight: 600; }
.mom-comments { margin: 0 0 12px; background: #f7f7f7; border-radius: 6px; padding: 6px 10px; }
.mom-comment { font-size: 14px; line-height: 1.5; word-break: break-word; padding: 2px 0; }
.mom-comment .mom-cdel { float: right; color: #fa5151; font-weight: 600; margin-left: 8px; padding: 0 3px; cursor: pointer; }
.mc-name { color: #576b95; font-weight: 600; }
#mom-post-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); border-radius: 12px 12px 0 0; box-shadow: 0 -2px 12px rgba(0,0,0,.08); }
.mps-head { font-size: 16px; font-weight: 600; margin-bottom: 10px; text-align: center; }
#mom-post-text { width: 100%; border: 1px solid var(--wx-line); border-radius: 6px; padding: 8px; font-size: 15px; resize: none; box-sizing: border-box; min-height: 60px; }
.mps-btns { display: flex; gap: 8px; margin-top: 10px; }
.mps-btns .btn { flex: 1; }
#mom-post-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mom-pick { position: relative; width: 60px; height: 60px; }
.mom-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mom-pick-x { position: absolute; top: -6px; right: -6px; background: rgba(0,0,0,.6); color: #fff; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; font-size: 12px; cursor: pointer; }
#mom-comment-bar { position: fixed; left: 0; right: 0; bottom: var(--kb-h, 0); z-index: 56; background: #f5f5f5; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; }
#mom-comment-input { flex: 1; border: 1px solid var(--wx-line); border-radius: 18px; padding: 7px 12px; font-size: 14px; }
#mom-comment-send { border: 0; background: var(--wx-green); color: #fff; border-radius: 18px; padding: 0 16px; font-size: 14px; }

/* ---------- 微信式丝滑动画（纯transform，走合成层不掉帧） ---------- */
.pg { animation: pgIn .24s cubic-bezier(.35,0,.25,1); }
@keyframes pgIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.pg-out { animation: pgOut .24s cubic-bezier(.35,0,.25,1) forwards; }
@keyframes pgOut { from { transform: translateX(0); } to { transform: translateX(100%); } }
.badge, .kf-badge { animation: dotIn .2s cubic-bezier(.2,1.2,.3,1); }
@keyframes dotIn { from { transform: scale(0); } to { transform: scale(1); } }
.row:active, .conv:active, .conv-item:active, .kf-row:active, .menu-row:active, .as-item:active, .cont-row:active { background: #ececec !important; transition: background .1s; }

/* ---------- 账号操作日志页 ---------- */
.kfc-logs-hint { font-size: 12px; color: #999; padding: 6px 2px 0; }
.logs-tool { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 0.5px solid #e5e5e5; align-items: center; }
.logs-tool input { flex: 1; border: 1px solid #d6d6d6; border-radius: 8px; padding: 8px 10px; font-size: 14px; min-width: 0; }
.logs-tool button { border: 0; background: #07c160; color: #fff; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.logs-list { padding: 4px 0; }
.logs-item { padding: 10px 12px; border-bottom: 0.5px solid #f0f0f0; }
.logs-item .lt { font-size: 11px; color: #999; }
.logs-item .la { font-size: 14px; font-weight: 600; color: #333; margin: 3px 0; }
.logs-item .ld { font-size: 13px; color: #666; word-break: break-all; }
.logs-empty { padding: 40px 16px; text-align: center; color: #999; font-size: 13px; }

/* 置顶会话：浅灰底（仿微信） */
.conv-item.pinned { background: #f5f5f5; }

/* 聊天信息页（微信式） */
#gsettings { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 85; display: flex; flex-direction: column; background: #ededed; }
#gsettings .gs-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 0 calc(20px + env(safe-area-inset-bottom)); }
.gs-section { background: #fff; margin-bottom: 8px; }
.gs-section:last-child { margin-bottom: 0; }
.gs-members { display: flex; flex-wrap: wrap; gap: 12px 12px; padding: 20px 16px 8px; background: #fff; }
.gs-mcell { width: 52px; text-align: center; font-size: 12px; color: #333; }
.gs-mcell .avatar { width: 48px; height: 48px; border-radius: 6px; margin: 0 auto 6px; background: #ededed; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 18px; overflow: hidden; }
.gs-mcell .avatar img { width: 100%; height: 100%; object-fit: cover; }
.gs-mcell .avatar.gs-del { outline: 2px solid #fa5151; }
.gs-mname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-op { width: 48px; height: 48px; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; color: #333; margin: 0 auto 6px; font-size: 20px; font-weight: 600; }
.gs-row { display: flex; align-items: center; padding: 14px 16px; border-top: 0.5px solid #ececec; background: #fff; }
.gs-row .gs-k { flex: 0 0 108px; font-size: 16px; color: #111; }
.gs-row .gs-val { flex: 1; text-align: right; font-size: 15px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-row .gs-val.empty { color: #bbb; }
.gs-row .gs-ann { max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-row .gs-arrow { color: #bbb; margin-left: 6px; font-size: 18px; }
.gs-row.gs-danger { color: #fa5151; }
.gs-leave { margin: 20px 16px; text-align: center; color: #fa5151; font-size: 16px; font-weight: 500; padding: 14px; background: #fff; border-radius: 8px; }
/* 微信式开关 */
.sw { position: relative; width: 48px; height: 28px; flex-shrink: 0; margin-left: 8px; }
.sw input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; z-index: 2; cursor: pointer; }
.sw::before { content: ''; position: absolute; inset: 0; border-radius: 14px; background: #ccc; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sw:has(input:checked)::before { background: #07c160; }
.sw:has(input:checked)::after { transform: translateX(20px); }

/* 弹层弹出动画 */
@keyframes popIn { from { transform: scale(.92); opacity: .5; } to { transform: scale(1); opacity: 1; } }

/* ===== 微信式"+"号面板（2行4列） ===== */
.plus-mask{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:200;display:flex;align-items:flex-end}
.plus-panel{width:100%;background:#f7f7f7;border-radius:16px 16px 0 0;padding:24px 16px 30px;transform:translateY(100%);transition:transform .25s ease}
.plus-panel.show{transform:translateY(0)}
.plus-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px 8px}
.plus-cell{display:flex;flex-direction:column;align-items:center;gap:8px}
.plus-ic{width:56px;height:56px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.plus-lb{font-size:12px;color:#333}

/* ===== 名片气泡/选择器/详情 ===== */
.card-bubble{display:flex;align-items:center;gap:10px;min-width:150px;max-width:210px;padding:2px}
.card-bubble-av{width:38px;height:38px;border-radius:6px;background:#e6e6e6;display:flex;align-items:center;justify-content:center;font-size:16px;color:#fff;flex:none;overflow:hidden}
.card-bubble-av img{width:100%;height:100%;object-fit:cover}
.card-bubble-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.card-bubble-nm{font-size:14px;color:#333;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:130px}
.card-bubble-sub{font-size:11px;color:#999}
.as-av{display:inline-flex;width:34px;height:34px;border-radius:6px;background:#bbb;color:#fff;align-items:center;justify-content:center;font-size:15px;margin-right:10px;flex:none;overflow:hidden;vertical-align:middle}
.as-av img{width:100%;height:100%;object-fit:cover}
.as-nm{font-size:15px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.as-title{font-size:13px;color:#999;padding:10px 16px 4px}
.card-detail{display:flex;flex-direction:column;align-items:center;padding:26px 16px 14px;gap:10px}
.card-detail-av{width:64px;height:64px;border-radius:12px;background:#bbb;color:#fff;display:flex;align-items:center;justify-content:center;font-size:26px;overflow:hidden}
.card-detail-av img{width:100%;height:100%;object-fit:cover}
.card-detail-nm{font-size:17px;font-weight:600;color:#333}

/* ===== 引用块 ===== */
.quote-block{background:rgba(0,0,0,.06);border-left:3px solid #888;border-radius:4px;padding:6px 8px;margin-bottom:6px;max-width:220px}
.quote-nm{font-size:11px;color:#888;margin-bottom:2px}
.quote-txt{font-size:12px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===== 群聊 @ 高亮 ===== */
.at-hl{color:#07c160;font-weight:600}
.bubble.at-me{outline:2px solid rgba(7,193,96,.55);outline-offset:2px;border-radius:8px}

/* ===== 已读回执 ===== */
.read-flag{font-size:10px;color:#b2b2b2;text-align:right;margin-top:2px;padding-right:2px}

/* ===== 引用条（输入框上方） ===== */
.replybar{display:flex;align-items:center;justify-content:space-between;background:#f2f2f2;border-top:1px solid #e5e5e5;padding:6px 10px;font-size:12px;color:#666;max-width:100%}
.reply-line{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;overflow:hidden}
.reply-nm{color:#07c160;font-size:11px}
.reply-txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-x{width:22px;height:22px;border-radius:50%;background:#d8d8d8;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;flex:none;margin-left:8px}

/* ===== 朋友圈大图查看器（多图滑动） ===== */
.mom-viewer{position:fixed;inset:0;background:#000;z-index:300;display:flex;align-items:center;justify-content:center;touch-action:pan-y}
.mv-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}
.mv-img{max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.mv-close{position:fixed;top:14px;right:14px;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;z-index:301}
.mv-count{position:fixed;top:18px;left:50%;transform:translateX(-50%);color:rgba(255,255,255,.9);font-size:13px;z-index:301}
/* 群机器人消息 BOT 标识 */
.bot-tag{display:inline-block;background:#07c160;color:#fff;font-size:10px;font-weight:600;padding:1px 4px;border-radius:3px;margin-right:5px;vertical-align:middle;line-height:1.4}
/* 群聊他人消息：头像最左，昵称+气泡纵向排列在头像右侧（微信样式） */
.msg .msg-box { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
/* ===== 转账（微信风，虚拟币） ===== */
/* 转账卡片——微信式橙底白字，固定尺寸（与金额无关，收发双方一致），"转账"标签在气泡内底部 */
.msg .bubble.transfer-bubble { background: transparent; border: none; padding: 0; width: 250px; max-width: calc(100% - 48px); }
.transfer-card { position: relative; width: 100%; height: 80px; padding: 13px 18px 0; box-sizing: border-box; border-radius: 6px; cursor: pointer; user-select: none; -webkit-user-select: none; background: linear-gradient(180deg,#ffab52,#f99230); color: #fff; }
.transfer-card .tc-amt { font-size: 17px; font-weight: 600; letter-spacing: .5px; line-height: 1.25; }
.transfer-card .tc-lb { font-size: 11px; opacity: .92; margin-top: 3px; }
.transfer-card.accepted { background: linear-gradient(180deg,#ffe3bc,#fdcd9f); }
.transfer-card.accepted .tc-lb { opacity: .9; }
.transfer-card .tc-tag { position: absolute; bottom: 8px; left: 18px; font-size: 11px; color: #999; line-height: 1.4; white-space: nowrap; }
/* 转账输入弹层 */
.transfer-sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 78%; max-width: 320px; background: #fff; border-radius: 16px; padding: 0 0 18px; z-index: 9999; box-shadow: 0 8px 40px rgba(0,0,0,.25); text-align: center; }
.transfer-sheet .ts-top { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px 0 6px; }
.transfer-sheet .ts-x { position: absolute; left: 16px; top: 12px; font-size: 17px; color: #999; padding: 4px; }
.transfer-sheet .ts-title { font-size: 16px; font-weight: 600; color: #111; }
.transfer-sheet .ts-avbox { position: relative; width: 64px; height: 64px; margin: 12px auto 8px; border-radius: 50%; overflow: hidden; background: #e8e8e8; display: flex; align-items: center; justify-content: center; }
.transfer-sheet .ts-av { width: 100%; height: 100%; object-fit: cover; }
.transfer-sheet .ts-av-fb { font-size: 24px; color: #fff; font-weight: 600; }
.transfer-sheet .ts-name { font-size: 15px; color: #333; margin-bottom: 14px; }
.transfer-sheet .ts-money { display: flex; align-items: center; justify-content: center; gap: 4px; border-bottom: 1px solid #eee; margin: 0 28px; padding-bottom: 10px; }
.transfer-sheet .ts-yen { font-size: 30px; font-weight: 600; color: #333; }
.transfer-sheet .ts-money input { width: 100%; border: none; outline: none; font-size: 30px; font-weight: 600; color: #222; text-align: left; background: transparent; }
.transfer-sheet .ts-note { margin: 12px 28px 0; }
.transfer-sheet .ts-note input { width: 100%; border: none; outline: none; font-size: 14px; color: #666; border-bottom: 1px solid #eee; padding: 8px 0; background: transparent; }
.transfer-sheet .ts-btn { width: calc(100% - 56px); margin: 18px 28px 0; background: linear-gradient(180deg,#ff9c33,#f07e16); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; padding: 11px 0; cursor: pointer; }
/* 转账详情弹层 */
.td-sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 82%; max-width: 340px; background: #fff; border-radius: 16px; padding: 0 0 16px; z-index: 9999; box-shadow: 0 8px 40px rgba(0,0,0,.25); text-align: center; }
.td-sheet .td-top { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px 0 4px; }
.td-sheet .ts-x { position: absolute; left: 16px; top: 12px; font-size: 17px; color: #999; padding: 4px; }
.td-sheet .ts-title { font-size: 16px; font-weight: 600; color: #111; }
.td-sheet .td-yenicon { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(180deg,#ff9c33,#f07e16); margin: 16px auto 12px; display: flex; align-items: center; justify-content: center; }
.td-sheet .td-yen { font-size: 34px; color: #fff; font-weight: 700; }
.td-sheet .td-title { font-size: 14px; color: #666; }
.td-sheet .td-title .td-o { color: #333; font-weight: 600; margin-left: 6px; }
.td-sheet .td-amt { font-size: 34px; font-weight: 700; background: linear-gradient(180deg,#f8b500,#ef8200); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 12px 0 4px; }
.td-sheet .td-note { font-size: 14px; color: #07c160; margin-top: 6px; }
.td-sheet .td-time { font-size: 12px; color: #bbb; margin-top: 10px; }
.td-sheet .td-actions { margin-top: 18px; }
.td-sheet .td-btn { width: calc(100% - 56px); background: linear-gradient(180deg,#ff9c33,#f07e16); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; padding: 11px 0; cursor: pointer; }
.td-sheet .td-state { font-size: 15px; color: #999; padding: 11px 0; }
.td-sheet .td-state.ok { color: #07c160; }
.td-sheet .td-tip { font-size: 11px; color: #c9c9c9; margin-top: 14px; }
