/* ==========================================================================
   轻聊 · 设计系统
   结构照搬微信，视觉走 WorkBuddy 那套：扁平、细边、大圆角、靛紫主色
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  height: 100%; margin: 0; padding: 0;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; }
img { display: block; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 0; height: 0; }

:root {
  --brand: #0AC89E;
  --brand-ink: #062A20;
  --brand-text: #07927A;
  --brand-soft: #E2F8F3;
  --brand-strong: #08A882;
  --green: #12B76A;
  --red: #F04438;
  --orange: #F79009;
  --blue: #2E90FA;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 52px;
  --header-h: 48px;
  --scale: 1;
}

/* ------------------------------ 主题 ------------------------------ */
html[data-theme="light"] {
  --page: #F5F5F4;
  --bg: #FFFFFF;
  --bg-2: #F7F7F6;
  --bg-3: #EFEFEE;
  --text: #1A1A19;
  --text-2: #70706C;
  --text-3: #A3A29E;
  --border: rgba(0,0,0,.09);
  --border-strong: rgba(0,0,0,.16);
  --bubble-me: #0AC89E;
  --bubble-me-text: #062A20;
  --bubble-other: #FFFFFF;
  --bubble-other-text: #1A1A19;
  --mask: rgba(0,0,0,.4);
  --shadow: 0 6px 24px rgba(0,0,0,.08);
  --nav-blur: rgba(250,250,250,.86);
}
html[data-theme="dark"] {
  --page: #131312;
  --bg: #1C1C1B;
  --bg-2: #232322;
  --bg-3: #2C2C2A;
  --text: #F2F2F0;
  --text-2: #A0A09B;
  --text-3: #706F6B;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --bubble-me: #0FBF97;
  --bubble-me-text: #062A20;
  --bubble-other: #262625;
  --bubble-other-text: #F2F2F0;
  --mask: rgba(0,0,0,.6);
  --shadow: 0 6px 24px rgba(0,0,0,.5);
  --nav-blur: rgba(24,24,23,.86);
  --brand-soft: #0E3A31;
}

html[data-font="small"] { --scale: .92; }
html[data-font="normal"] { --scale: 1; }
html[data-font="large"] { --scale: 1.1; }
html[data-font="xlarge"] { --scale: 1.2; }

/* ------------------------------ 启动页 ------------------------------ */
.boot {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg); gap: 14px;
  transition: opacity .35s ease;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-logo { animation: pop .5s cubic-bezier(.2,.9,.3,1.2); }
.boot-name { font-size: 21px; font-weight: 500; letter-spacing: .06em; }
.boot-tip { font-size: 13px; color: var(--text-3); margin-top: 6px; }
@keyframes pop { 0% { transform: scale(.75); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }

/* ------------------------------ 基础布局 ------------------------------ */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.layers { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.layers > .layer { pointer-events: auto; }

.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--page);
}
.layer {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--page);
  will-change: transform;
}
.layer.enter { animation: slideIn .28s cubic-bezier(.32,.72,0,1); }
.layer.exit { animation: slideOut .24s cubic-bezier(.32,.72,0,1) forwards; }
@keyframes slideIn { from { transform: translateX(100%) } to { transform: translateX(0) } }
@keyframes slideOut { from { transform: translateX(0) } to { transform: translateX(100%) } }
.layer.fade-enter { animation: fadeIn .24s ease; }
.layer.fade-exit { animation: fadeOut .2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: scale(.97) } to { opacity: 1; transform: scale(1) } }
@keyframes fadeOut { from { opacity: 1 } to { opacity: 0 } }

/* ------------------------------ 顶栏 ------------------------------ */
.header {
  flex: none; position: relative; z-index: 5;
  padding-top: var(--safe-top);
  height: calc(var(--header-h) + var(--safe-top));
  display: flex; align-items: center;
  background: var(--nav-blur);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: .5px solid var(--border);
}
.header .h-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 17px; font-weight: 500; white-space: nowrap;
  max-width: 58%; overflow: hidden; text-overflow: ellipsis;
}
.header .h-left, .header .h-right {
  display: flex; align-items: center; gap: 2px; min-width: 56px; padding: 0 8px;
}
.header .h-right { margin-left: auto; justify-content: flex-end; }
.header .h-btn {
  height: 36px; min-width: 36px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--text); font-size: 15px; border-radius: 10px;
  cursor: pointer;
}
.header .h-btn:active { background: var(--bg-3); }
.header .h-btn.text { color: var(--brand-text); font-size: 15px; }
.header .h-btn.strong { font-weight: 500; }
.header .back { display: inline-flex; align-items: center; gap: 1px; }
.header .back svg { width: 22px; height: 22px; }
.badge-dot {
  position: absolute; top: 5px; right: 3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; font-weight: 500;
  border: 1.5px solid var(--bg);
}
.h-wrap { position: relative; display: inline-flex; }

/* ------------------------------ 内容区 ------------------------------ */
.body {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--page);
}
.body.plain { background: var(--bg); }
.pad-bottom { height: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); }

.searchbar { padding: 8px 12px; background: var(--page); position: sticky; top: 0; z-index: 3; }
.searchbar .sb {
  height: 34px; background: var(--bg-3); border-radius: 10px;
  display: flex; align-items: center; gap: 6px; padding: 0 10px; color: var(--text-3); font-size: 14px;
  justify-content: center;
}
.searchbar .sb input {
  flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--text);
}
.searchbar .sb.left { justify-content: flex-start; }

/* ------------------------------ 底部 Tab ------------------------------ */
.tabbar {
  flex: none; display: flex; align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-blur);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: .5px solid var(--border);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-3); font-size: 10px; position: relative; cursor: pointer;
  transition: color .15s;
}
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--brand-text); }
.tab .badge-dot { top: 3px; right: 50%; margin-right: -20px; }

/* 版本更新红点（列表行内）：挂在「设置」「关于轻聊」标题右侧的小圆点 */
.ver-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); margin-left: 6px; vertical-align: 2px;
}

/* ------------------------------ 列表 ------------------------------ */
.group {
  background: var(--bg); border-radius: var(--radius-md); margin: 8px 12px;
  overflow: hidden;
}
.group-title {
  font-size: 13px; color: var(--text-3); padding: 14px 16px 6px; background: transparent;
}
.list { background: var(--bg); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; min-height: 56px; position: relative;
  background: var(--bg); cursor: pointer;
}
.row + .row::before {
  content: ''; position: absolute; left: 62px; right: 0; top: 0;
  height: .5px; background: var(--border);
}
.row.no-line::before { display: none; }
.row:active { background: var(--bg-3); }
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { font-size: 16px; font-weight: 400; display: flex; align-items: center; gap: 5px; }
.row .r-sub {
  font-size: 13px; color: var(--text-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row .r-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.row .r-time { font-size: 11.5px; color: var(--text-3); }
.row .r-arrow { color: var(--text-3); flex: none; display: flex; }
.row .r-arrow svg { width: 16px; height: 16px; }
.row .r-value { font-size: 15px; color: var(--text-3); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 44px; height: 44px; border-radius: var(--radius-xs); flex: none;
  object-fit: cover; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 500; overflow: hidden;
}
.avatar.sm { width: 32px; height: 32px; font-size: 13px; border-radius: 5px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; border-radius: 4px; }
.avatar.lg { width: 60px; height: 60px; font-size: 21px; border-radius: 8px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; border-radius: 12px; }
.avatar.round { border-radius: 50%; }
.avatar-stack { display: flex; flex-wrap: wrap; width: 44px; height: 44px; gap: 1px; border-radius: var(--radius-xs); overflow: hidden; }
.avatar-stack .avatar { width: 21.5px; height: 21.5px; border-radius: 0; font-size: 9px; }
.avatar-stack.s1 .avatar { width: 44px; height: 44px; font-size: 15px; }

.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 500; flex: none;
}
.badge.dim { background: var(--text-3); }
.badge.plain { background: transparent; color: var(--text-3); font-weight: 400; }

.chip {
  font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--bg-3); color: var(--text-2); flex: none;
}
.chip.brand { background: var(--brand-soft); color: var(--brand-text); }

.empty {
  padding: 70px 30px; text-align: center; color: var(--text-3); font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty .ico { opacity: .5; }

.idx-bar {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0;
  font-size: 10.5px; color: var(--text-3); z-index: 4; padding: 4px 6px;
}
.idx-bar b { font-weight: 400; line-height: 1.35; }
.idx-flag {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 74px; height: 74px; border-radius: var(--radius-md);
  background: var(--bg-3); color: var(--text); font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 6;
}
.idx-flag.on { opacity: 1; }

/* ------------------------------ 聊天 ------------------------------ */
.chat-body {
  flex: 1; overflow-y: auto; padding: 12px 12px 4px;
  background: var(--chat-bg, var(--page));
  background-size: cover; background-position: center;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.msg { display: flex; gap: 9px; margin-bottom: 16px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.msg .m-col { max-width: 68%; display: flex; flex-direction: column; gap: 4px; }
.msg.me .m-col { align-items: flex-end; }
.msg .m-name { font-size: 11.5px; color: var(--text-3); padding: 0 4px; }
.bubble {
  position: relative; padding: 9px 13px; border-radius: var(--radius-md);
  background: var(--bubble-other); color: var(--bubble-other-text);
  font-size: 16px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
  cursor: default;
}
.msg.me .bubble { background: var(--bubble-me); color: var(--bubble-me-text); }
.bubble.plain { background: transparent !important; padding: 0 !important; }
.bubble.media { padding: 0; background: transparent !important; overflow: hidden; border-radius: var(--radius-md); }
.bubble.media img { max-width: 200px; max-height: 260px; border-radius: var(--radius-md); }
.bubble.voice { display: flex; align-items: center; gap: 8px; min-width: 74px; }
/* 微信那种“横着的信号波”：三条往右张开的弧线 */
.bubble.voice .wave { display: flex; align-items: center; height: 20px; }
.bubble.voice .v-wave { display: flex; align-items: center; }
/* 静息：竖线+两条弧线全部实色（跟气泡文字同色），不透明 */
.bubble.voice .v-wave path { opacity: 1; }
/* 自己发的语音：图标镜像（弧线朝左，微信同款） */
.msg.me .bubble.voice .v-wave svg { transform: scaleX(-1); }
/* 播放中：竖线常亮；弧线依次向外点亮循环——未点亮的直接消失（opacity 跳变，不经过浅色） */
.bubble.voice.on .v-wave .bar { opacity: 1; }
.bubble.voice.on .v-wave .w1 { animation: vw1 1.2s steps(1, end) infinite; }
.bubble.voice.on .v-wave .w2 { animation: vw2 1.2s steps(1, end) infinite; }
@keyframes vw1 { 0%,33% { opacity: 0 } 34%,100% { opacity: 1 } }
@keyframes vw2 { 0%,66% { opacity: 0 } 67%,100% { opacity: 1 } }
@keyframes wave { 0%,100% { transform: scaleY(.5) } 50% { transform: scaleY(1.25) } }
.bubble.sys {
  background: rgba(0,0,0,.05); color: var(--text-2); font-size: 12.5px;
  padding: 3px 10px; border-radius: 10px;
}
html[data-theme="dark"] .bubble.sys { background: rgba(255,255,255,.08); }
.msg.sys { justify-content: center; }
.msg.sys .m-col { max-width: 82%; align-items: center; }
.bubble.recalled { font-size: 12.5px; color: var(--text-3); background: rgba(0,0,0,.05) !important; }
html[data-theme="dark"] .bubble.recalled { background: rgba(255,255,255,.08) !important; }
.m-time { font-size: 11px; color: var(--text-3); text-align: center; margin: 10px 0 14px; }
.m-sticker { font-size: 44px; line-height: 1.1; }
.m-card {
  background: var(--bg); border: .5px solid var(--border); border-radius: var(--radius-md);
  padding: 11px 13px; min-width: 180px; max-width: 240px;
}
.m-card .t { font-size: 15px; font-weight: 500; margin-bottom: 3px; }
.m-card .d { font-size: 12.5px; color: var(--text-3); }
.ack { font-size: 10.5px; color: var(--text-3); padding: 0 3px; }
.ack.err { color: var(--red); }
.ack.fail {
  width: 18px; height: 18px; border-radius: 50%; background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; padding: 0; flex: none; align-self: center;
}
.menu-fav { background: var(--bg); color: var(--text); }

.quote {
  border-left: 2.5px solid var(--border-strong); padding: 3px 8px; margin-bottom: 5px;
  font-size: 13px; opacity: .8; border-radius: 2px; background: rgba(127,127,127,.08);
}

/* 输入栏 */
.inputbar {
  flex: none; border-top: .5px solid var(--border);
  background: var(--nav-blur);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  padding-bottom: var(--safe-bottom);
}
.inputbar .ib-row {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px;
}
.inputbar .ib-btn {
  width: 32px; height: 32px; flex: none; border: 0; background: none; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px;
  padding: 0;
}
.inputbar .ib-btn svg { width: 26px; height: 26px; }
.inputbar .ib-btn:active { background: var(--bg-3); }
.inputbar textarea {
  flex: 1; min-height: 36px; max-height: 108px; resize: none; border: 0; outline: none;
  background: var(--bg); border-radius: 10px; padding: 8px 11px; font-size: 16px;
  color: var(--text); line-height: 1.35; font-family: inherit;
}
html[data-theme="dark"] .inputbar textarea { background: var(--bg-2); }
.inputbar .send {
  flex: none; height: 36px; padding: 0 16px; border-radius: 10px; border: 0;
  background: var(--brand); color: var(--brand-ink); font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.inputbar .send:disabled { opacity: .45; }
.emoji-panel {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 10px 12px 14px; max-height: 210px; overflow-y: auto;
}
.emoji-panel span { font-size: 25px; text-align: center; padding: 5px 0; cursor: pointer; border-radius: 8px; }
.emoji-panel span:active { background: var(--bg-3); }
.plus-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 12px 18px; }
.plus-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; border-radius: var(--radius-md); background: var(--bg);
  font-size: 12px; color: var(--text-2); cursor: pointer;
}
html[data-theme="dark"] .plus-item { background: var(--bg-2); }
.plus-item .ico {
  width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--bg-3);
  display: flex; align-items: center; justify-content: center; color: var(--brand-text);
}
.plus-item .ico svg { width: 24px; height: 24px; }
.recording-tip {
  position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 13px; z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px;
}

/* ------------------------------ 朋友圈 ------------------------------ */
.mc-cover { position: relative; height: 260px; background: var(--bg-3); }
.mc-cover img { width: 100%; height: 100%; object-fit: cover; }
.mc-me {
  position: absolute; right: 14px; bottom: -18px;
  display: flex; align-items: flex-end; gap: 10px;
}
.mc-me .nm { color: #fff; font-size: 16px; font-weight: 500; text-shadow: 0 1px 4px rgba(0,0,0,.5); padding-bottom: 22px; }
.mc-me .avatar { border: 2px solid var(--bg); width: 62px; height: 62px; }
.moment { display: flex; gap: 11px; padding: 16px 14px; background: var(--bg); }
.moment + .moment { border-top: .5px solid var(--border); }
.moment .m-main { flex: 1; min-width: 0; }
.moment .m-name { font-size: 15px; font-weight: 500; color: var(--brand-text); }
.moment .m-text { font-size: 15.5px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.moment .m-imgs { display: grid; gap: 4px; margin-top: 8px; }
.moment .m-imgs.n1 { grid-template-columns: minmax(0,1fr); max-width: 62%; }
.moment .m-imgs.n2 { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 68%; }
.moment .m-imgs.n3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.moment .m-imgs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.moment .m-imgs.n1 img { aspect-ratio: auto; max-height: 240px; }
.moment .m-loc { font-size: 12.5px; color: var(--brand-text); margin-top: 7px; }
.moment .m-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.moment .m-foot .tm { font-size: 12px; color: var(--text-3); }
.moment .m-act { display: flex; gap: 2px; background: var(--bg-3); border-radius: 6px; padding: 3px 5px; }
.moment .m-act b { font-weight: 400; font-size: 13px; padding: 0 6px; cursor: pointer; color: var(--text-2); }
.moment .m-inter { margin-top: 8px; background: var(--bg-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.moment .m-like { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--brand-text); padding-bottom: 6px; }
.moment .m-comment { font-size: 14px; line-height: 1.6; word-break: break-word; }
.moment .m-comment b { color: var(--brand-text); font-weight: 400; }
.moment .m-comment .del { color: var(--text-3); float: right; margin-left: 8px; }

/* ------------------------------ 认证流程 ------------------------------ */
.auth {
  position: fixed; inset: 0; background: var(--bg); z-index: 200;
  display: flex; flex-direction: column;
}
.auth .a-top { padding-top: calc(var(--safe-top) + 6px); display: flex; align-items: center; padding-left: 6px; padding-right: 6px; min-height: 48px; }
.auth .a-back {
  width: 40px; height: 40px; flex: none; border: 0; background: none; padding: 0;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 10px; -webkit-appearance: none; appearance: none;
}
.auth .a-back:active { background: var(--bg-3); }
.auth .a-back svg { width: 24px; height: 24px; }
.auth .a-main { flex: 1; padding: 6px 30px 0; display: flex; flex-direction: column; overflow-y: auto; }
.auth .a-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 28px 0 8px; }
.auth .a-logo .nm { font-size: 20px; font-weight: 500; letter-spacing: .05em; }
.auth h1.a-h { font-size: 26px; font-weight: 500; margin: 26px 0 8px; line-height: 1.25; }
.auth .a-sub { font-size: 14px; color: var(--text-3); margin-bottom: 22px; }
.auth .a-field { position: relative; margin-bottom: 4px; }
.auth .a-field input {
  width: 100%; border: 0; border-bottom: 1.5px solid var(--border-strong); background: transparent;
  font-size: 20px; padding: 12px 62px 12px 0; outline: none; color: var(--text);
  border-radius: 0; transition: border-color .2s;
}
.auth .a-field input:focus { border-color: var(--brand-text); }
.auth .a-field input::placeholder { color: var(--text-3); font-size: 18px; }
.auth .a-field .tail {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-3); cursor: pointer; transition: color .18s, background .18s;
}
.auth .a-field .tail.on { color: var(--brand-text); }
.auth .a-field .tail:active { background: var(--bg-3); }
.auth .a-field .tail.mute { color: var(--text-3); }
.auth .a-hint { font-size: 13px; min-height: 20px; margin-top: 8px; color: var(--text-3); }
.auth .a-hint.err { color: var(--red); }
.auth .a-hint.ok { color: var(--green); }
.auth .a-bottom { padding: 14px 30px calc(22px + var(--safe-bottom)); flex: none; }
.auth .a-steps { display: flex; gap: 6px; justify-content: center; margin: 18px 0 0; }
.auth .a-steps i { width: 22px; height: 3px; border-radius: 2px; background: var(--border-strong); }
.auth .a-steps i.on { background: var(--brand); }
.auth .agree { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-3); align-items: flex-start; line-height: 1.5; margin-top: 6px; }
.auth .agree .box {
  width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.auth .agree .box.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.auth .agree a { color: var(--brand-text); }

/* ------------------------------ 按钮 / 表单 ------------------------------ */
.btn {
  width: 100%; height: 48px; border-radius: var(--radius-md); border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.ghost { background: var(--bg-3); color: var(--text); }
.btn.line { background: transparent; border: .5px solid var(--border-strong); color: var(--text); }
.btn.danger { background: transparent; color: var(--red); }
.btn.sm { height: 34px; font-size: 13.5px; border-radius: 9px; width: auto; padding: 0 14px; }

.cell { background: var(--bg); }
.cell-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-height: 52px;
  position: relative; background: var(--bg); cursor: pointer;
}
.cell-row + .cell-row::before { content: ''; position: absolute; left: 14px; right: 0; top: 0; height: .5px; background: var(--border); }
.cell-row .cl { font-size: 16px; flex: none; }
.cell-row .cr { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 15px; }
.cell-row .cr svg { width: 16px; height: 16px; }
.cell-row input {
  flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--text);
  text-align: right; min-width: 0;
}
.cell-row input.left { text-align: left; }
.switch {
  width: 50px; height: 30px; border-radius: 15px; background: var(--bg-3); position: relative;
  flex: none; cursor: pointer; transition: background .2s;
}
/* :not(.on) —— 不加的话这条(0,2,1)会盖过下面的 .switch.on(0,2,0)，深色模式开关永远不绿 */
html[data-theme="dark"] .switch:not(.on) { background: #3A3A38; }
.switch i {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.switch.on { background: var(--brand); }
.switch.on i { transform: translateX(20px); }

/* ------------------------------ 弹层 ------------------------------ */
.toast {
  position: fixed; left: 50%; bottom: 22%; transform: translate(-50%, 10px);
  background: rgba(28,28,27,.92); color: #fff; padding: 11px 18px; border-radius: var(--radius-md);
  font-size: 14px; max-width: 76%; text-align: center; z-index: 600; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; line-height: 1.45;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sheet-mask, .modal-mask {
  position: fixed; inset: 0; background: var(--mask); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
.modal-mask { align-items: center; }
.sheet {
  width: 100%; max-width: 560px; background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding-bottom: var(--safe-bottom); animation: sheetUp .24s cubic-bezier(.32,.72,0,1);
  max-height: 82vh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
.sheet .sh-title { font-size: 13px; color: var(--text-3); text-align: center; padding: 14px 16px 10px; }
.sheet .sh-item {
  padding: 15px 16px; text-align: center; font-size: 16.5px; cursor: pointer;
  border-top: .5px solid var(--border);
}
.sheet .sh-item:active { background: var(--bg-3); }
.sheet .sh-item.danger { color: var(--red); }
.sheet .sh-cancel { border-top: 8px solid var(--page); color: var(--text-2); }
.modal {
  width: calc(100% - 60px); max-width: 340px; background: var(--bg); border-radius: var(--radius-lg);
  overflow: hidden; animation: fadeIn .2s ease;
}
.modal .md-body { padding: 22px 20px 18px; font-size: 15px; text-align: center; }
.modal .md-title { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.modal .md-input {
  width: 100%; margin-top: 14px; border: 0; border-bottom: 1px solid var(--border-strong);
  background: transparent; font-size: 16px; padding: 8px 2px; outline: none; color: var(--text);
}
.modal .md-field { position: relative; }
.modal .md-field .md-input { padding-right: 40px; }
.modal .md-field .tail {
  position: absolute; right: -6px; bottom: 2px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-3); cursor: pointer; transition: color .18s;
}
.modal .md-field .tail.on { color: var(--brand-text); }
.modal .md-actions { display: flex; border-top: .5px solid var(--border); }
.modal .md-actions div {
  flex: 1; text-align: center; padding: 14px; font-size: 16px; cursor: pointer; color: var(--text-2);
}
.modal .md-actions div.primary { color: var(--brand-text); font-weight: 500; }
.modal .md-actions div + div { border-left: .5px solid var(--border); }

.loading {
  position: fixed; inset: 0; z-index: 550; display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid rgba(127,127,127,.28); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ------------------------------ 个人资料 ------------------------------ */
.profile-head {
  display: flex; align-items: center; gap: 14px; padding: 22px 16px;
  background: var(--bg); cursor: pointer;
}
.profile-head .p-main { flex: 1; min-width: 0; }
.profile-head .p-name { font-size: 21px; font-weight: 500; }
.profile-head .p-sub { font-size: 13.5px; color: var(--text-3); margin-top: 5px; }
.qr-box {
  width: 220px; margin: 0 auto; background: var(--bg); border-radius: var(--radius-md);
  padding: 16px; text-align: center;
}
.qr-box canvas { width: 188px; height: 188px; border-radius: 6px; background: #fff; }

.hero-me { background: var(--bg); padding: 26px 16px 22px; display: flex; align-items: center; gap: 16px; }
.hero-me .nm { font-size: 22px; font-weight: 500; }
.hero-me .id { font-size: 13px; color: var(--text-3); margin-top: 5px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 8px 12px; }
.tile {
  background: var(--bg); border-radius: var(--radius-md); padding: 13px; cursor: pointer;
}
.tile .t { font-size: 15px; font-weight: 500; }
.tile .d { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.tile .ic { color: var(--brand-text); margin-bottom: 8px; }
.pager { display: flex; gap: 8px; overflow-x: auto; padding: 12px; background: var(--bg); }
.pager .pg { flex: none; width: 66px; text-align: center; font-size: 12px; color: var(--text-2); cursor: pointer; }
.pager .pg .avatar { width: 50px; height: 50px; margin: 0 auto 5px; }

.grid-imgs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; padding: 12px; }
.grid-imgs .gi { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-3); cursor: pointer; }
.grid-imgs .gi img { width: 100%; height: 100%; object-fit: cover; }
.grid-imgs .gi .x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center;
}

.viewer {
  position: fixed; inset: 0; background: #000; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
}
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .cl {
  position: absolute; top: calc(var(--safe-top) + 10px); right: 14px; color: #fff;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border-radius: 50%; cursor: pointer;
}

.typing-dot { display: inline-flex; gap: 3px; align-items: center; }
.typing-dot i { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); animation: blink 1.1s infinite; }
.typing-dot i:nth-child(2) { animation-delay: .18s; }
.typing-dot i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,100% { opacity: .3 } 50% { opacity: 1 } }

.pull-tip {
  text-align: center; font-size: 12px; color: var(--text-3); padding: 10px 0; height: 0; overflow: hidden;
  transition: height .2s;
}
.pull-tip.on { height: 34px; }

.sendbar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px calc(13px + var(--safe-bottom));
  background: var(--bg); border-top: .5px solid var(--border);
}
.sendbar .agree { margin: 0; font-size: 14px; color: var(--text); align-items: center; }
.sendbar .agree .box { width: 20px; height: 20px; margin-top: 0; }
.sendbar .size-tip { font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   语音通话
   ========================================================================== */
.call-screen {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; flex-direction: column;
  background: var(--page); color: var(--text);
  animation: csUp .26s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes csUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cs-top {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: calc(48px + var(--safe-top)) 28px 20px; min-height: 0;
}
.cs-avwrap { position: relative; width: calc(104px * var(--scale)); height: calc(104px * var(--scale)); }
.cs-avwrap .avatar {
  width: 100%; height: 100%; border-radius: 50%;
  font-size: calc(40px * var(--scale));
}
.cs-avwrap.ring::before,
.cs-avwrap.ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--brand); animation: csPulse 1.8s ease-out infinite;
}
.cs-avwrap.ring::after { animation-delay: .9s; }
@keyframes csPulse {
  0% { transform: scale(1); opacity: .75; }
  100% { transform: scale(1.5); opacity: 0; }
}
.cs-name { font-size: calc(21px * var(--scale)); font-weight: 500; text-align: center; }
.cs-status { font-size: calc(13.5px * var(--scale)); color: var(--text-3); text-align: center; min-height: 20px; }
.cs-tip { margin-top: 6px; font-size: 12px; color: var(--text-3); text-align: center; }
.cs-actions {
  display: flex; justify-content: center; gap: 44px;
  padding: 0 24px calc(52px + var(--safe-bottom));
}
.cs-actions.duo { gap: 64px; }
.cs-btn {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  background: none; border: 0; padding: 0; color: var(--text); cursor: pointer;
}
.cs-btn .cs-ic {
  width: calc(60px * var(--scale)); height: calc(60px * var(--scale));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); color: var(--text);
  transition: transform .12s ease, background .18s ease, color .18s ease;
}
.cs-btn:active .cs-ic { transform: scale(.93); }
.cs-btn .cs-lb { font-size: calc(12px * var(--scale)); color: var(--text-3); }
.cs-btn.on .cs-ic { background: var(--brand-soft); color: var(--brand-text); }
.cs-btn.hang .cs-ic { background: var(--red); color: #fff; }
.cs-btn.accept .cs-ic { background: var(--brand); color: #fff; }
.cs-btn.dim .cs-ic { opacity: .45; }
.cs-warn {
  margin: 0 28px 18px; padding: 11px 14px; border-radius: var(--radius-md);
  background: var(--bg-2); border: .5px solid var(--border);
  font-size: 12.5px; color: var(--text-2); line-height: 1.6;
}
/* 通话记录气泡 */
.bubble .call-row { display: flex; align-items: center; gap: 7px; }
.bubble .call-row svg { flex: none; }
.bubble .call-row .call-dur { opacity: .7; font-size: 12.5px; }

/* ==========================================================================
   应用内相册选择页（微信式）
   ========================================================================== */
.gal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  animation: csUp .22s cubic-bezier(.2,.9,.3,1.1);
}
.gal-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  height: calc(46px + var(--safe-top)); padding: var(--safe-top) 12px 0;
  border-bottom: .5px solid var(--border); background: var(--bg);
}
.gal-btn {
  border: 0; background: none; color: var(--text); font-size: 15px;
  font-family: inherit; padding: 8px 6px; cursor: pointer;
}
.gal-title {
  display: flex; align-items: center; gap: 3px;
  font-size: 15px; font-weight: 500; cursor: pointer; padding: 8px 6px;
  max-width: 60%; overflow: hidden;
}
.gal-title span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-arrow { display: flex; color: var(--text-3); transform: rotate(90deg); }
.gal-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.gal-body { padding: 0; }
.gal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 3px; }
.g-cell {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-3);
  border-radius: 4px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.g-img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.g-mask {
  position: absolute; inset: 0; background: rgba(10,200,158,.0);
  border: 2px solid transparent; border-radius: 4px; transition: .12s;
}
.g-cell.on .g-mask { background: rgba(0,0,0,.22); border-color: var(--brand); }
.g-sel {
  position: absolute; top: 5px; right: 5px;
  width: 21px; height: 21px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.95); background: rgba(0,0,0,.22);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-ink); font-size: 12px; font-weight: 500;
  transition: .12s;
}
.g-cell.on .g-sel { background: var(--brand); border-color: var(--brand); }
.g-vbadge {
  position: absolute; left: 5px; bottom: 5px;
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  pointer-events: none;
}
.g-vbadge svg { width: 13px; height: 13px; }
.gal-loading, .gal-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-3);
  font-size: 13.5px; padding: 60px 20px;
}
.gal-foot {
  flex: none; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px calc(12px + var(--safe-bottom));
  border-top: .5px solid var(--border); background: var(--bg);
}
.gal-pv {
  border: 0; background: none; font-family: inherit; font-size: 14.5px;
  color: var(--text); padding: 6px 2px; cursor: pointer;
}
.gal-pv.off { color: var(--text-3); }
.gal-orig { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.gal-chk {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
}
.gal-chk.on { background: var(--brand); border-color: var(--brand); }
.gal-chk.on::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--brand-ink); border-bottom: 2px solid var(--brand-ink);
  transform: rotate(-45deg);
}
.gal-send {
  margin-left: auto; border: 0; border-radius: 999px; min-width: 82px;
  padding: 9px 18px; background: var(--brand); color: var(--brand-ink);
  font-family: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
}
.gal-send.off { background: var(--bg-3); color: var(--text-3); }
.gal-amask {
  position: absolute; inset: 0; background: var(--mask);
  opacity: 0; pointer-events: none; transition: opacity .18s;
  display: flex; align-items: flex-end;
}
.gal-amask.on { opacity: 1; pointer-events: auto; }
.gal-albums {
  width: 100%; max-height: 62%; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-lg, 16px) var(--r-lg, 16px) 0 0;
  padding: 8px 0 calc(10px + var(--safe-bottom));
  transform: translateY(12px); transition: transform .18s;
}
.gal-amask.on .gal-albums { transform: none; }
.gal-a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer; }
.gal-a.on { background: var(--brand-soft); }
.gal-acv {
  width: 46px; height: 46px; border-radius: 8px; overflow: hidden; flex: none; background: var(--bg-3);
}
.gal-acv img { width: 100%; height: 100%; object-fit: cover; }
.gal-an { flex: 1; min-width: 0; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-ac { font-size: 12.5px; color: var(--text-3); flex: none; }
.gal-acheck { display: flex; color: var(--brand-text); flex: none; }
.gal-pv-layer {
  position: fixed; inset: 0; z-index: 1300; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.gal-pv-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gal-pv-bar {
  position: absolute; bottom: calc(26px + var(--safe-bottom)); left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.86); font-size: 13px;
}
.gal-scope {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 6px 0; padding: 10px 12px;
  background: var(--brand-soft); border-radius: 10px;
  font-size: 12.5px; color: #0A5D4C; line-height: 1.5;
}
.gal-scope span { flex: 1; min-width: 0; }
.gal-scope-btn {
  flex: none; border: 0; border-radius: 999px; padding: 6px 13px;
  background: var(--brand); color: var(--brand-ink);
  font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.group .tip {
  padding: 9px 16px 12px; font-size: 12.5px; line-height: 1.65;
  color: var(--text-3); background: var(--bg);
}

/* ============================== 微信式深色弹出菜单 ============================== */
.pop-menu {
  position: fixed; z-index: 1400;
  display: flex; align-items: stretch; flex-wrap: wrap; max-width: 82vw;
  background: #4C4C4B; border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0,0,0,.22);
  overflow: hidden;
}
.pop-menu.below::before {
  content: ''; position: absolute; top: -5px; right: 18px;
  width: 10px; height: 10px; background: #4C4C4B; transform: rotate(45deg);
}
.pop-i {
  position: relative; padding: 11px 17px; font-size: 13.5px; color: #fff;
  cursor: pointer; white-space: nowrap; display: flex; align-items: center;
}
.pop-i:active { background: #3D3D3C; }
.pop-i + .pop-i::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: .5px; height: 16px; background: rgba(255,255,255,.24);
}
.pop-i.danger { color: #FF7B7B; }

/* 长按消息时的缩小动画（松手/到点后弹回） */
.msg { transition: transform .18s cubic-bezier(.2,.9,.3,1.2); transform-origin: center; }
/* 消息点按不再缩放（用户要求去掉） */

/* 全屏看图的保存按钮（微信式，右下角） */
.viewer-save {
  position: absolute; right: 16px; bottom: calc(18px + var(--safe-bottom));
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.viewer-save:active { transform: scale(.94); background: rgba(0,0,0,.6); }
.upd-bar {
  height: 4px; border-radius: 2px; background: var(--bg-3);
  margin: 4px 14px 12px; overflow: hidden;
}
.upd-bar .upd-in {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--brand); /* 不要 transition：下载快时动画追不上数字，进度条和百分比会明显对不上 */
}

/* 语音键统一成品牌绿（不再有的白有的绿） */
.inputbar .send.hold { background: var(--brand); color: var(--brand-ink); }

/* 竖排弹出菜单（右上角 + 用）：竖着的宽长方形，不是横长条 */
.pop-menu.vertical { flex-direction: column; min-width: 132px; max-width: 60vw; }
.pop-menu.vertical .pop-i { padding: 14px 18px; justify-content: flex-start; }
.pop-menu.vertical .pop-i + .pop-i::before {
  left: 14px; right: 14px; top: 0; transform: none; width: auto; height: .5px;
}

/* 发语音：微信样式——深色遮罩（较透，底部“按住 说话”椭圆按钮隐约可见）+ 中央绿色气泡声波 */
.rec-sheet {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(12,12,12,.55); color: #fff;
  opacity: 0; transition: opacity .16s ease;
}
.rec-sheet.on { opacity: 1; }
/* 中间的绿色气泡 + 波形（对照微信截图：气泡中心在屏幕约 56% 高度，别太靠上） */
.rec-sheet .rs-bubble {
  position: absolute; left: 50%; top: 56%;
  transform: translate(-50%, -50%);
  min-width: 200px; padding: 20px 26px;
  border-radius: 22px; background: var(--brand);
  box-shadow: 0 10px 34px rgba(0,0,0,.35);
}
.rec-sheet .rs-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -12px;
  transform: translateX(-50%);
  border: 13px solid transparent; border-top-color: var(--brand); border-bottom: 0;
}
.rec-sheet.cancel .rs-bubble { background: #E5484D; }
.rec-sheet.cancel .rs-bubble::after { border-top-color: #E5484D; }
/* 声波：13 根对称竖条（中间高两边低），高度由录音音量驱动（JS），不用固定动画 */
.rec-sheet .rs-wave { display: flex; align-items: center; justify-content: center; gap: 4.5px; height: 44px; }
.rec-sheet .rs-wave i {
  width: 4px; border-radius: 2px; background: #fff;
  height: 12px; transition: height .08s linear;
}
/* 中间：取消（灰色胶囊，居中挂在大椭圆上方——用户要求：不要转文字按钮，中间一个取消就行） */
.rec-sheet .rs-cancel {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(146px + var(--safe-bottom));
  padding: 20px 48px; border-radius: 999px;
  background: rgba(255,255,255,.22); color: #fff; font-size: 17px;
}
.rec-sheet .rs-cancel:active { background: rgba(255,255,255,.45); }
/* 底部一整块浅色大椭圆：只露出上缘的弧（微信同款，两个主题下都是浅灰+深字） */
.rec-sheet .rs-arc {
  position: absolute; left: -12%; right: -12%; height: 330px;
  bottom: calc(-218px + var(--safe-bottom));
  border-radius: 50%;
  background: #E7E7E5;
}
.rec-sheet.cancel .rs-arc { opacity: .55; }
/* 底部中间：松开 发送（写在椭圆上，深色字） */
.rec-sheet .rs-send {
  position: absolute; left: 50%; top: 22px;
  transform: translateX(-50%);
  color: #1A1A19; font-size: 17px; font-weight: 500; white-space: nowrap;
}
.rec-sheet.cancel .rs-send { opacity: .55; }
/* 微信录音界面不显示秒数 */
.rec-sheet .rs-time { display: none; }

/* 文件消息点开后的页面 */
.file-head { display: flex; align-items: center; gap: 14px; padding: 22px 18px; background: var(--bg); }
.file-head .fi {
  width: 56px; height: 56px; border-radius: 13px; flex: none;
  background: var(--brand-soft); color: var(--brand-text);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.file-head .fn { font-size: 16.5px; font-weight: 500; word-break: break-all; line-height: 1.35; }
.file-head .fs { font-size: 13px; color: var(--text-3); margin-top: 6px; }

/* 自研视频播放器 */
.vplayer { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.vplayer video { display: block; width: 100%; max-height: 60vh; background: #000; }
.vplayer .vp-big {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.vplayer .vp-big span {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.vplayer .vp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 8px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.vplayer .vp-btn { color: #fff; display: flex; align-items: center; cursor: pointer; flex: none; }
.vplayer .vp-track { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.32); position: relative; cursor: pointer; }
.vplayer .vp-in { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--brand); border-radius: 2px; }
.vplayer .vp-in::after {
  content: ''; position: absolute; right: -5px; top: -3.5px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff;
}
.vplayer .vp-t { color: #fff; font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }

/* ============================== 应用内相机 ============================== */
.cam-screen {
  position: fixed; inset: 0; z-index: 1300; background: #000;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .22s ease;
}
.cam-screen.on { transform: translateY(0); }
/* 顶栏/底栏都浮在画面上（对齐微信）：取景画面铺满整屏，顶部不再留黑条 */
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px; color: #fff;
}
.cam-x, .cam-mode { cursor: pointer; }
.cam-x { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.cam-mode { font-size: 15px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); }
.cam-stage { flex: 1; position: relative; overflow: hidden; }
.cam-stage { background: #000; }
/* 不再把画面拉伸到超过相机原始分辨率：拉伸=糊，裁切=被放大。
   这里按原始尺寸显示（最多填满容器），既不放大也不糊。 */
.cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-hint {
  position: absolute; left: 0; right: 0; bottom: calc(130px + var(--safe-bottom)); text-align: center;
  color: #fff; font-size: 13.5px; text-shadow: 0 1px 4px rgba(0,0,0,.5); pointer-events: none;
}
.cam-focus {
  position: absolute; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  border: 2px solid var(--brand); border-radius: 10px; opacity: 0; pointer-events: none;
}
.cam-focus.on { animation: camfocus 1.1s ease-out; }
@keyframes camfocus {
  0% { opacity: 1; transform: scale(1.35); }
  60% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
.cam-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 34px calc(30px + var(--safe-bottom));
}
.cam-flip {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.cam-shutter {
  width: 72px; height: 72px; border-radius: 50%; background: #fff;
  border: 4px solid rgba(255,255,255,.45); cursor: pointer;
  transition: transform .1s, background .15s;
}
.cam-shutter:active { transform: scale(.94); }
.cam-shutter.rec { background: #FF4D4D; border-color: rgba(255,77,77,.5); border-radius: 18px; }
.cam-shutter.busy { opacity: .5; }

/* ============================== 全屏查看器（图片/视频） ============================== */
.viewer { opacity: 0; transition: opacity .18s; }
.viewer.on { opacity: 1; }
.viewer .vw-stage {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.viewer img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transition: transform .1s ease-out; will-change: transform;
}
.viewer video { max-width: 100%; max-height: 100%; background: #000; display: block; }
.viewer .vw-big {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  transition: opacity .2s; pointer-events: none;
}
.viewer .vw-big span {
  width: 68px; height: 68px; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: auto;
}
.viewer .vw-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 18px calc(18px + var(--safe-bottom));
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
.viewer .vw-btn { color: #fff; display: flex; cursor: pointer; flex: none; }
.viewer .vw-track {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.32); position: relative;
}
.viewer .vw-in { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--brand); border-radius: 2px; }
.viewer .vw-t { color: #fff; font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.viewer .viewer-close {
  position: absolute; top: calc(var(--safe-top) + 12px); left: 14px;
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.viewer.vw-video .viewer-save { bottom: calc(74px + var(--safe-bottom)); }

/* 聊天里的视频消息：首帧 + 播放键 + 时长 */
.vthumb { position: relative; border-radius: 12px; overflow: hidden; background: #000; line-height: 0; max-width: 220px; }
.vthumb video { display: block; width: 220px; max-height: 260px; object-fit: cover; background: #000; }
.vthumb .vthumb-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.vthumb .vthumb-dur { display: none; /* 用户要求去掉秒数角标 */ 
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 16px;
}

/* 资料页里的两个带图标的动作行（发消息 / 音视频通话） */
.act-row {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 14px; background: var(--bg); cursor: pointer; position: relative;
}
.act-row + .act-row::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: .5px; background: var(--border);
}
.act-row span { font-size: 16px; color: var(--text); }
.act-row .ico { display: flex; color: var(--text); }
.profile-head .p-gender { display: inline-flex; vertical-align: middle; margin-left: 6px; color: #3A8EE6; }
.profile-head .p-gender.f { color: #E8618C; }

/* ============================== 贴图号（小红书式两列瀑布流） ============================== */
.tie-grid {
  column-count: 2; column-gap: 8px; padding: 10px 10px 0;
}
.tie-card {
  break-inside: avoid; background: var(--bg); border-radius: 12px;
  overflow: hidden; margin-bottom: 8px; cursor: pointer;
}
.tie-card:active { transform: scale(.985); }
.tie-card .tc-cover { position: relative; line-height: 0; background: var(--bg-3); min-height: 90px; }
.tie-card .tc-cover img { width: 100%; display: block; }
.tie-card .tc-cover.text-only { padding: 16px 12px; min-height: 110px; display: flex; align-items: center; }
.tie-card .tc-txt { font-size: 14.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }
.tie-card .tc-n, .tie-card .tc-video {
  position: absolute; color: #fff; font-size: 11px; line-height: 17px;
  background: rgba(0,0,0,.5); border-radius: 8px; padding: 0 6px;
}
.tie-card .tc-n { right: 6px; top: 6px; }
.tie-card .tc-video { left: 6px; top: 6px; display: flex; align-items: center; padding: 2px 6px; }
.tie-card .tc-text {
  padding: 8px 10px 4px; font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.tie-card .tc-foot {
  display: flex; align-items: center; gap: 5px; padding: 4px 10px 10px;
  font-size: 12px; color: var(--text-3);
}
.tie-card .tc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tie-card .tc-like { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.tie-card .tc-like.on { color: var(--brand-text); }
.tie-card .tc-like b { font-weight: 400; }
.tie-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 90px 30px; color: var(--text-3); font-size: 14.5px; gap: 8px; text-align: center;
}
.tie-empty .te-ico { color: var(--text-3); opacity: .5; }
.tie-empty .te-sub { font-size: 13px; }

/* 贴图号：双列瀑布流（淘宝看商品那种，左右两边都有，图片保持原始比例） */
.tt-feed { column-count: 2; column-gap: 8px; padding: 10px 10px 0; }
.tt-card {
  background: var(--bg); border-radius: 14px; overflow: hidden;
  margin: 0 0 8px; cursor: pointer;
  break-inside: avoid; -webkit-column-break-inside: avoid;
  display: inline-block; width: 100%;   /* inline-block 让旧 WebView 的分列不把卡片拦腰截断 */
}
.tt-card:active { transform: scale(.99); }
.tt-card .tt-cover { position: relative; line-height: 0; background: var(--bg-3); }
.tt-card .tt-cover img { width: 100%; display: block; }   /* 瀑布流：不裁成固定高，按原图比例排 */
.tt-card .tt-video {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.tt-card .tt-n {
  position: absolute; right: 10px; top: 10px; color: #fff; font-size: 11.5px;
  background: rgba(0,0,0,.5); border-radius: 9px; padding: 2px 8px;
}
.tt-card .tt-text {
  padding: 12px 14px 4px; font-size: 15px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap;
}
.tt-card .tt-foot {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px 14px;
  font-size: 12.5px; color: var(--text-3);
}
.tt-card .tt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-card .tt-like { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.tt-card .tt-like.on { color: var(--brand-text); }
.tt-card .tt-like b { font-weight: 400; }

/* 通话最小化后的顶部小条（点一下恢复，右边可直接挂断） */
.call-mini {
  position: fixed; z-index: 1150;
  top: calc(var(--safe-top) + 8px); left: 10px; right: 10px; height: 46px;
  border-radius: 23px; background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.22); cursor: pointer;
}
.call-mini .cm-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.call-mini .cm-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none;
  animation: cmBlink 1.1s infinite;
}
@keyframes cmBlink { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.call-mini .cm-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-mini .cm-time { font-size: 13px; opacity: .8; flex: none; }
.call-mini .cm-hang {
  width: 34px; height: 34px; border-radius: 50%; background: #E5484D; color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}

/* 通话最小化 = 可拖动悬浮小窗（微信那种：拖到边缘自动收缩成细长条） */
.call-float {
  position: fixed; z-index: 1150; width: 158px;
  background: rgba(28,30,29,.95); border-radius: 16px;
  box-shadow: 0 8px 26px rgba(0,0,0,.32);
  padding: 10px 10px 8px; cursor: grab;
  transition: width .18s ease, border-radius .18s ease, padding .18s ease;
  user-select: none;
}
.call-float .cf-head { display: flex; align-items: center; gap: 8px; }
.call-float .cf-meta { min-width: 0; flex: 1; }
.call-float .cf-name {
  font-size: 13.5px; color: #fff; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.call-float .cf-time {
  font-size: 11.5px; color: rgba(255,255,255,.66); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 104px;
}
.call-float .cf-row { display: flex; gap: 6px; margin-top: 8px; }
.call-float .cf-btn {
  flex: 1; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,.14); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.call-float .cf-btn.on { background: var(--brand); color: var(--brand-ink); }
.call-float .cf-btn.hang { background: #E5484D; }
/* 贴边收缩态：只留头像 + 挂断，几乎不挡内容 */
.call-float.side { width: 56px; padding: 8px 6px; border-radius: 14px; }
.call-float.side .cf-meta { display: none; }
.call-float.side .cf-row { margin-top: 6px; }
.call-float.side .cf-row .cf-btn { display: none; }
.call-float.side .cf-row .cf-btn.hang { display: flex; flex: 1; }
.call-float.side .cf-head { justify-content: center; }
