/* ============================================================
   黑八 · 微信高仿 UI（v2 · 按 iOS 微信实测参数复刻）
   色板 / 尺寸 / 动效 均对齐微信 8.x iOS 版
   ============================================================ */
:root {
  /* ---- 色板 ---- */
  --wx-green: #07c160;
  --wx-green-active: #06ad56;
  --wx-bubble-me: #95ec69;
  --wx-bubble-me-active: #89dd5f;
  --wx-bubble-other: #ffffff;
  --wx-bg-page: #ededed;
  --wx-bg-chat: #ededed;
  --wx-bg-card: #ffffff;
  --wx-bg-nav: #ededed;
  --wx-bg-tab: rgba(247, 247, 247, .94);
  --wx-bg-input: #f7f7f7;
  --wx-line: #e5e5e5;
  --wx-line-nav: rgba(0, 0, 0, .1);
  --wx-pressed: #ececec;
  --wx-text: #191919;
  --wx-text-sub: #888888;
  --wx-text-3: #b2b2b2;
  --wx-link: #576b95;
  --wx-red: #fa5151;
  --wx-orange: #fa9d3b;
  --wx-blue: #10aeff;

  /* ---- 尺寸 ---- */
  --wx-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
             "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --wx-nav-h: 44px;
  --wx-tab-h: 49px;
  --wx-av: 48px;          /* 列表头像 */
  --wx-av-msg: 40px;      /* 消息头像 */
  --wx-radius-av: 4px;    /* 微信头像圆角 */

  /* ---- 动效 ---- */
  --wx-ease: cubic-bezier(.25, .1, .25, 1);        /* iOS 默认 */
  --wx-ease-out: cubic-bezier(.2, .9, .3, 1);
  --wx-push: .35s cubic-bezier(.25, .1, .25, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--wx-font);
  font-size: 17px;
  color: var(--wx-text);
  background: #d8d8d8;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   登录页
   ============================================================ */
.login-body { background: var(--wx-bg-page); }
.login-wrap {
  height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(170deg, #2b2b2b 0%, #111 100%);
}
.login-card {
  width: 340px; max-width: 100%; background: #fff; border-radius: 12px;
  padding: 38px 28px 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  animation: cardIn .42s var(--wx-ease-out) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.login-logo { display: block; width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 15px; }
.login-title { text-align: center; font-size: 19px; font-weight: 600; margin-bottom: 24px; letter-spacing: 2px; }
.wx-field { position: relative; margin-bottom: 10px; }
.wx-field input {
  width: 100%; height: 48px; border: none; border-bottom: 1px solid #ededed; background: transparent;
  padding: 0 46px 0 2px; font-size: 16px; outline: none; border-radius: 0;
  transition: border-color .2s;
}
.wx-field input:focus { border-bottom-color: var(--wx-green); }
.wx-field .eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  color: var(--wx-text-3); font-size: 13px; cursor: pointer; user-select: none; padding: 6px;
}
.wx-btn {
  width: 100%; height: 46px; margin-top: 18px; border-radius: 6px;
  background: var(--wx-green); color: #fff; font-size: 16px; font-weight: 500; letter-spacing: 1px;
  transition: background .15s, transform .12s;
}
.wx-btn:hover { background: var(--wx-green-active); }
.wx-btn:active { transform: scale(.985); background: #059c4d; }
.wx-btn:disabled { background: #b9e6cd; cursor: not-allowed; }
.login-switch { text-align: center; margin-top: 16px; font-size: 14px; }
.login-switch a { color: var(--wx-link); cursor: pointer; }
.login-err {
  background: #fff1f1; color: var(--wx-red); border-radius: 6px; padding: 9px 12px;
  font-size: 13px; margin-bottom: 14px; display: none;
}

/* ============================================================
   微信壳
   ============================================================ */
.wx {
  position: relative; width: 100%; max-width: 480px; height: 100%; margin: 0 auto;
  background: var(--wx-bg-page); overflow: hidden;
}
.page {
  position: absolute; left: 0; right: 0; top: 0; bottom: var(--wx-tab-h);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--wx-bg-page);
  transition: transform var(--wx-push), filter var(--wx-push);
  will-change: transform;
}
/* push 转场：主页面左移并轻微变暗 */
.wx.pushed .page { transform: translateX(-26%); filter: brightness(.92); }

/* 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 5; height: var(--wx-nav-h);
  display: flex; align-items: center; padding: 0 8px 0 16px;
  background: var(--wx-bg-nav);
  border-bottom: .5px solid var(--wx-line-nav);
}
.nav-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 17px; font-weight: 500; letter-spacing: .2px;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 6px; color: var(--wx-text);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, opacity .12s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:active { background: rgba(0, 0, 0, .07); }
.nav-back {
  width: 36px; height: 36px; color: var(--wx-text);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .12s;
}
.nav-back svg { width: 23px; height: 23px; }
.nav-back:active { opacity: .5; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: #c9c9c9; margin-right: 8px; transition: background .3s; }
.conn.on { background: var(--wx-green); }
.conn.off { background: var(--wx-orange); animation: connBlink 1.4s infinite; }
@keyframes connBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ============================================================
   列表（微信 cell）
   ============================================================ */
.list { padding-bottom: 24px; }
.cell {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; min-height: 55px; background: var(--wx-bg-card);
  position: relative; cursor: pointer;
  transition: background-color .06s linear;
}
.cell:active { background: var(--wx-pressed); }
.cell + .cell::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0;
  height: .5px; background: var(--wx-line);
  transform: scaleY(.5); transform-origin: 0 0;
}
/* 有头像的 cell：分割线左缩进到文字处 */
.cell:has(.av) + .cell:has(.av)::before { left: 76px; }
.cell.two-line { min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.cell .av {
  width: var(--wx-av); height: var(--wx-av); border-radius: var(--wx-radius-av);
  flex-shrink: 0; color: #fff; font-size: 17px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  background: #c9c9c9; background-size: cover; background-position: center; position: relative;
}
.cell .av.group { background: var(--wx-green); }
.cell .av svg { width: 26px; height: 26px; }
.cell .av .badge-dot {
  position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--wx-red); color: #fff; font-size: 12px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-weight: 400;
  box-shadow: 0 0 0 2px #fff;
}
.cell .meta { flex: 1; min-width: 0; }
.cell .nm {
  font-size: 17px; line-height: 1.35; color: var(--wx-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell .sub {
  font-size: 14px; color: var(--wx-text-sub); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px;
}
.cell .right { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cell .tm { font-size: 13px; color: var(--wx-text-3); font-variant-numeric: tabular-nums; }
.cell .badge {
  min-width: 18px; height: 18px; padding: 0 5px; background: var(--wx-red); color: #fff;
  font-size: 12px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.cell .arrow { color: #c8c8c8; flex-shrink: 0; font-size: 17px; line-height: 1; margin-left: -2px; }
.cell .val { color: var(--wx-text-sub); font-size: 15px; flex-shrink: 0; }
.cell .val.strong { color: var(--wx-text); font-weight: 600; }
.cell .role { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #f0f0f0; color: var(--wx-text-sub); flex-shrink: 0; }
.cell .role.manager { background: #e6f7ee; color: var(--wx-green); }
.cell .role.dealer { background: #fff2e5; color: var(--wx-orange); }
.cell .role.admin { background: #ffe9e9; color: var(--wx-red); }
.group-sep { padding: 18px 16px 7px; font-size: 14px; color: var(--wx-text-sub); }
.list-empty {
  padding: 70px 32px; text-align: center; color: var(--wx-text-3);
  font-size: 15px; line-height: 1.9;
}

/* 列表入场（微信：内容直接出现，仅做极轻的淡入） */
@keyframes listIn { from { opacity: 0; } to { opacity: 1; } }
.list > .cell, .list > .group-sep, .list > .list-empty { animation: listIn .22s ease both; }

/* ============================================================
   我（个人页）
   ============================================================ */
.me-card {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 20px 22px; background: var(--wx-bg-card);
  margin-bottom: 8px; cursor: pointer; position: relative;
  transition: background-color .06s linear;
}
.me-card:active { background: var(--wx-pressed); }
.me-card .av {
  width: 64px; height: 64px; border-radius: 8px; background: var(--wx-green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 500;
  background-size: cover; background-position: center; flex-shrink: 0;
}
.me-card .meta { flex: 1; min-width: 0; }
.me-card .nm { font-size: 21px; font-weight: 600; letter-spacing: .2px; }
.me-card .no { font-size: 14px; color: var(--wx-text-sub); margin-top: 7px; }
.me-card .arrow { color: #c8c8c8; font-size: 19px; line-height: 1; flex-shrink: 0; }
.me-list { background: var(--wx-bg-card); }
.me-list .cell + .cell::before { left: 16px; }
.me-gap { height: 8px; background: var(--wx-bg-page); }

/* ============================================================
   底部 TabBar
   ============================================================ */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--wx-tab-h); z-index: 40;
  display: flex; background: var(--wx-bg-tab);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--wx-line-nav);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: #7f7f7f; cursor: pointer; position: relative;
  transition: color .12s;
}
.tab:active { opacity: .6; }
.tab svg { width: 28px; height: 28px; transition: transform .18s var(--wx-ease-out); }
.tab .ico-on { display: none; }
.tab.active .ico { display: none; }
.tab.active .ico-on { display: block; }
.tab.active { color: var(--wx-green); }
.tab.active svg { transform: scale(1.02); }
.tab span { font-size: 10px; line-height: 1.2; letter-spacing: .2px; }
.tab-badge {
  position: absolute; top: 3px; left: 50%; margin-left: 4px;
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--wx-red); color: #fff; font-size: 11px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-style: normal;
  box-shadow: 0 0 0 1.5px var(--wx-bg-tab);
  animation: badgeIn .28s var(--wx-ease-out) both;
}
@keyframes badgeIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   聊天页（全屏 push）
   ============================================================ */
.chatpage {
  position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--wx-bg-chat);
  transform: translateX(100%);
  transition: transform var(--wx-push);
  will-change: transform;
  pointer-events: none;
}
.chatpage.show { transform: translateX(0); pointer-events: auto; }
.chatpage .nav { background: var(--wx-bg-nav); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 12px 10px; -webkit-overflow-scrolling: touch; }

/* 消息 */
.msg { display: flex; margin-bottom: 16px; gap: 10px; position: relative; }
.msg .avatar {
  width: var(--wx-av-msg); height: var(--wx-av-msg); border-radius: var(--wx-radius-av);
  flex-shrink: 0; background: #c9c9c9; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 500;
  background-size: cover; background-position: center;
  cursor: pointer; transition: opacity .12s;
}
.msg .avatar:active { opacity: .7; }
.msg .body { max-width: 70%; position: relative; }
.msg .sender { font-size: 12px; color: var(--wx-text-sub); margin-bottom: 4px; padding-left: 2px; }
.bubble {
  padding: 10px 12px; border-radius: 5px; background: var(--wx-bubble-other);
  font-size: 17px; line-height: 1.42; word-break: break-word; white-space: pre-wrap;
  position: relative; min-height: 40px; display: flex; align-items: center;
  transition: background-color .1s;
  cursor: default; -webkit-user-select: none; user-select: none;
}
.bubble::before {
  content: ""; position: absolute; left: -5.5px; top: 12px; width: 0; height: 0;
  border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent;
  border-right: 6px solid var(--wx-bubble-other);
}
.msg.me { flex-direction: row-reverse; }
.msg.me .body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.me .sender { text-align: right; padding-right: 2px; padding-left: 0; }
.msg.me .bubble { background: var(--wx-bubble-me); }
.msg.me .bubble:active { background: var(--wx-bubble-me-active); }
.msg.me .bubble::before { left: auto; right: -5.5px; border-right: none; border-left: 6px solid var(--wx-bubble-me); }
.msg .bubble:active { background: #f2f2f2; }

/* 消息入场 */
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.anim { animation: msgIn .26s var(--wx-ease-out) both; }

/* 系统 / 机器人 / 报表 消息 */
.msg.sys { justify-content: center; margin-bottom: 16px; }
.msg.sys .avatar { display: none; }
.msg.sys .body { max-width: 88%; }
.msg.sys .bubble {
  background: rgba(0, 0, 0, .055); color: var(--wx-text-sub); font-size: 13px;
  text-align: center; border-radius: 4px; min-height: 0; padding: 5px 11px; line-height: 1.5;
}
.msg.sys .bubble::before { display: none; }
.msg.bot .avatar { background: var(--wx-green); font-size: 18px; }
.msg.bot .bubble { background: #fff; }
.msg.verify .avatar { background: var(--wx-orange); }
.msg.verify .bubble { background: #fff8ee; }
.msg.report .avatar { background: var(--wx-blue); }
.msg.report .bubble {
  background: #f0f9ff; font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 13.5px; line-height: 1.65;
}
.msg.praise .avatar { background: #ffb400; }
.msg.praise .bubble { background: #fffbe6; }
.msg.private .bubble { border: 1px dashed rgba(7, 193, 96, .5); }
.tag-lock {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--wx-orange);
  background: #fff4e5; border-radius: 3px; padding: 1px 5px; margin-bottom: 4px;
}
.bubble .muted { color: var(--wx-text-3); font-style: italic; font-size: 15px; }

/* 日期分隔 */
.day-sep { text-align: center; margin: 14px 0; }
.day-sep span { color: #fff; font-size: 12px; background: rgba(0, 0, 0, .16); padding: 2px 7px; border-radius: 3px; }

/* ============================================================
   长按菜单（微信式气泡菜单）
   ============================================================ */
.ctx-menu {
  position: fixed; z-index: 9600; display: none;
  background: rgba(45, 45, 45, .96); border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  transform-origin: 50% 100%;
}
.ctx-menu.show { display: flex; animation: ctxIn .18s var(--wx-ease-out) both; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
.ctx-menu button {
  color: #fff; font-size: 15px; padding: 11px 18px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; transition: background .1s;
}
.ctx-menu button:active { background: rgba(255, 255, 255, .14); }
.ctx-menu button + button { border-left: .5px solid rgba(255, 255, 255, .18); }

/* ============================================================
   下拉刷新
   ============================================================ */
.ptr {
  position: absolute; left: 0; right: 0; top: 0; height: 60px;
  display: flex; align-items: center; justify-content: center;
  color: var(--wx-text-3); font-size: 13px;
  opacity: 0; pointer-events: none; z-index: 1;
}
.ptr.show { opacity: 1; }
.ptr .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #d5d5d5; border-top-color: var(--wx-green);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   输入区
   ============================================================ */
.chat-input {
  background: var(--wx-bg-input); border-top: .5px solid var(--wx-line-nav);
  flex-shrink: 0; padding-bottom: env(safe-area-inset-bottom);
  transition: background .15s;
}
.toolbar { display: flex; align-items: center; gap: 7px; padding: 8px 12px 0; flex-wrap: wrap; }
.tool {
  border: .5px solid #dedede; background: #fff; border-radius: 5px; height: 30px; padding: 0 11px;
  font-size: 13px; color: var(--wx-text); display: inline-flex; align-items: center; gap: 4px;
  transition: background .12s, color .12s, border-color .12s, transform .1s;
}
.tool:active { transform: scale(.96); background: #f2f2f2; }
.tool.primary { background: var(--wx-green); border-color: var(--wx-green); color: #fff; }
.tool.primary:active { background: var(--wx-green-active); }
.tool.bet-btn.picked { background: var(--wx-green); border-color: var(--wx-green); color: #fff; }
.toolbar .spacer { flex: 1; }
.toolbar .hint { font-size: 12px; color: var(--wx-text-3); padding: 0 2px; }
.input-row { display: flex; align-items: flex-end; gap: 8px; padding: 7px 10px 9px; }
.input-row .tool2 {
  width: 32px; height: 34px; color: var(--wx-text); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; transition: opacity .12s;
}
.input-row .tool2 svg { width: 26px; height: 26px; }
.input-row .tool2:active { opacity: .55; }
.input-row textarea {
  flex: 1; min-height: 36px; max-height: 120px; resize: none; border: none; border-radius: 4px;
  background: #fff; padding: 7px 10px; font-size: 17px; line-height: 1.35; outline: none;
}
.send-btn {
  height: 32px; padding: 0 15px; border-radius: 4px; background: var(--wx-green);
  color: #fff; font-size: 15px; flex-shrink: 0; margin-bottom: 2px;
  transition: background .12s, transform .1s, opacity .12s;
}
.send-btn:active { background: var(--wx-green-active); transform: scale(.96); }
.send-btn:disabled { background: #dcdcdc; color: #f5f5f5; cursor: not-allowed; }
.input-sm {
  height: 30px; width: 76px; border: .5px solid #dedede; border-radius: 5px;
  padding: 0 9px; font-size: 13px; outline: none; background: #fff;
}
.input-sm:focus { border-color: var(--wx-green); }

/* 表情面板 */
.emoji-panel {
  display: none; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 10px 12px 12px;
  background: var(--wx-bg-input); border-top: .5px solid var(--wx-line);
  max-height: 190px; overflow-y: auto;
  animation: panelUp .22s var(--wx-ease-out) both;
}
@keyframes panelUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.emoji-panel.show { display: grid; }
.emoji-panel span { font-size: 24px; text-align: center; cursor: pointer; padding: 4px 0; border-radius: 5px; transition: background .1s; }
.emoji-panel span:active { background: rgba(0, 0, 0, .07); }

/* 语音录制条 */
.voice-bar { display: none; align-items: center; gap: 10px; padding: 7px 10px 9px; }
.voice-bar.show { display: flex; animation: panelUp .2s var(--wx-ease-out) both; }
.voice-rec {
  flex: 1; height: 38px; border-radius: 4px; background: #fff; display: flex; align-items: center;
  gap: 10px; padding: 0 12px; color: var(--wx-text-sub); font-size: 13px;
}
.voice-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wx-red); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.8); } }
.voice-waves { display: flex; gap: 3px; align-items: center; height: 20px; }
.voice-waves i { width: 3px; background: var(--wx-green); border-radius: 2px; animation: wave .9s infinite ease-in-out; }
.voice-waves i:nth-child(1) { animation-delay: 0s } .voice-waves i:nth-child(2) { animation-delay: .1s }
.voice-waves i:nth-child(3) { animation-delay: .2s } .voice-waves i:nth-child(4) { animation-delay: .3s }
.voice-waves i:nth-child(5) { animation-delay: .4s } .voice-waves i:nth-child(6) { animation-delay: .5s }
@keyframes wave { 0%, 100% { height: 6px } 50% { height: 18px } }
.voice-time { font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.voice-bar .vb { height: 38px; padding: 0 16px; border-radius: 4px; font-size: 15px; transition: transform .1s, background .12s; }
.voice-bar .vb:active { transform: scale(.96); }
.vb-cancel { background: #fff; color: var(--wx-text); }
.vb-send { background: var(--wx-green); color: #fff; }

/* 语音气泡 */
.bubble.voice { display: flex; align-items: center; gap: 8px; min-width: 90px; cursor: pointer; }
.bubble.voice .wave-ico { display: inline-flex; align-items: center; gap: 2px; }
.bubble.voice .wave-ico i { width: 2px; height: 9px; background: currentColor; opacity: .5; border-radius: 1px; }
.bubble.voice.playing .wave-ico i { animation: voicePlay .6s infinite ease-in-out; }
.bubble.voice.playing .wave-ico i:nth-child(2) { animation-delay: .15s }
.bubble.voice.playing .wave-ico i:nth-child(3) { animation-delay: .3s }
@keyframes voicePlay { 0%, 100% { height: 5px } 50% { height: 14px } }

/* ============================================================
   Toast（微信：屏幕中央黑底圆角）
   ============================================================ */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92);
  z-index: 9999; background: rgba(0, 0, 0, .72); color: #fff;
  padding: 12px 20px; border-radius: 8px; font-size: 15px; line-height: 1.45;
  opacity: 0; transition: opacity .2s, transform .2s var(--wx-ease-out);
  pointer-events: none; max-width: 66vw; text-align: center; word-break: break-word;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ============================================================
   弹窗（微信：中心缩放弹出）
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 9000;
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.modal-mask.show { display: flex; animation: maskIn .2s ease both; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 12px; width: 400px; max-width: 100%; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .26s var(--wx-ease-out) both;
}
@keyframes modalIn { from { opacity: 0; transform: scale(1.14); } to { opacity: 1; transform: scale(1); } }
.modal.wide { width: 900px; }
.modal-h {
  padding: 16px 18px 12px; font-weight: 600; font-size: 17px; display: flex; align-items: center;
}
.modal-h span { flex: 1; }
.modal-b { padding: 4px 18px 16px; overflow-y: auto; flex: 1; }
.modal-f { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 6px; color: var(--wx-text-3); font-size: 15px;
  display: flex; align-items: center; justify-content: center; transition: background .12s;
}
.icon-btn:active { background: #f0f0f0; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 13px; color: var(--wx-text-sub); margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; height: 40px; border: none; border-bottom: 1px solid #e8e8e8; border-radius: 0;
  padding: 0 2px; font-size: 16px; outline: none; background: transparent;
  transition: border-color .2s;
}
.form-row input:focus, .form-row select:focus { border-bottom-color: var(--wx-green); }
.btn {
  height: 40px; padding: 0 20px; border-radius: 6px; background: var(--wx-green);
  color: #fff; font-size: 15px; font-weight: 500;
  transition: background .12s, transform .1s;
}
.btn:active { background: var(--wx-green-active); transform: scale(.97); }
.btn-ghost { background: #f2f2f2; color: var(--wx-text); }
.btn-ghost:active { background: #e8e8e8; }
.btn.danger { background: var(--wx-red); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 资料卡 */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 6px 0 16px; border-bottom: .5px solid var(--wx-line); margin-bottom: 6px; }
.profile-card .av {
  width: 60px; height: 60px; border-radius: 6px; background: var(--wx-green); color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center;
}
.profile-card .nm { font-size: 19px; font-weight: 600; }
.profile-card .no { font-size: 13px; color: var(--wx-text-sub); margin-top: 5px; }
.pf-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; font-size: 15px; border-bottom: .5px solid #f5f5f5; }
.pf-row .k { color: var(--wx-text-sub); }
.pf-row .v { font-weight: 500; }
.req-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: .5px solid #f5f5f5; }
.req-item:last-child { border-bottom: none; }
.req-item .av {
  width: 44px; height: 44px; border-radius: 4px; background: #c9c9c9; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background-size: cover; background-position: center; flex-shrink: 0;
}
.req-item .meta { flex: 1; min-width: 0; }
.req-item .nm { font-size: 16px; }
.req-item .sub { font-size: 13px; color: var(--wx-text-sub); margin-top: 2px; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #f0f2f5; white-space: nowrap; }
table.tbl th { color: #64748b; font-weight: 500; font-size: 12px; background: #fafbfc; position: sticky; top: 0; }
table.tbl tr:hover td { background: #fafbfc; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.tag.on { background: #e6f7ee; color: var(--wx-green); }
.tag.off { background: #f1f5f9; color: #64748b; }
.tag.warn { background: #fff2e5; color: var(--wx-orange); }
.tag.danger { background: #ffe9e9; color: var(--wx-red); }
.btn-sm {
  height: 28px; padding: 0 12px; border-radius: 5px; border: .5px solid #dbe1e8; background: #fff;
  font-size: 13px; color: #334155; transition: background .12s, transform .1s;
}
.btn-sm:active { transform: scale(.96); background: #f5f7fa; }
.btn-sm.primary { background: var(--wx-green); border-color: var(--wx-green); color: #fff; }
.btn-sm.danger { color: var(--wx-red); border-color: #ffd9d9; }
.row-flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 20px; }
.kv-grid .kv { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f0f2f5; }
.kv-grid .kv .k { color: #64748b; }
.kv-grid .kv .v { font-weight: 600; }
.muted { color: var(--wx-text-3); }
.mono { font-family: "SF Mono", "Consolas", "Menlo", monospace; font-size: 12.5px; }
.scroll-y { max-height: 420px; overflow-y: auto; }
.trend-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.trend-grid .bead {
  aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 600;
}
.member-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; }
.member-line .av {
  width: 30px; height: 30px; border-radius: 4px; background: #c9c9c9; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background-size: cover; background-position: center; flex-shrink: 0;
}
.member-line .role { font-size: 10px; padding: 1px 5px; border-radius: 3px; background: #f0f0f0; color: var(--wx-text-sub); }
.member-line .role.manager { background: #e6f7ee; color: var(--wx-green); }
.member-line .role.dealer { background: #fff2e5; color: var(--wx-orange); }
.member-line .role.admin { background: #ffe9e9; color: var(--wx-red); }
.member-line .mute { color: var(--wx-red); font-size: 11px; }

/* ============================================================
   GM 后台（admin.html）
   ============================================================ */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--wx-text-sub); margin-bottom: 6px; }
.field input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #e2e2e2; border-radius: 6px;
  font-size: 15px; outline: none; background: #fafafa; transition: border-color .2s, background .2s;
}
.field input:focus { border-color: var(--wx-green); background: #fff; }
.pwd-toggle { position: relative; }
.pwd-toggle .eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--wx-text-3); font-size: 12px; cursor: pointer; user-select: none;
}
.admin { display: flex; height: 100%; background: #f4f6f9; }
.admin-nav { width: 210px; min-width: 210px; background: #1f2937; color: #cbd5e1; display: flex; flex-direction: column; }
.admin-nav .brand { padding: 18px 20px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #2d3748; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #cbd5e1; text-decoration: none;
  font-size: 14px; border-left: 3px solid transparent; cursor: pointer; transition: background .15s;
}
.admin-nav a:hover { background: #263143; color: #fff; }
.admin-nav a.active { background: #263143; color: #fff; border-left-color: var(--wx-green); }
.admin-nav .foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid #2d3748; font-size: 12px; }
.admin-main { flex: 1; overflow-y: auto; padding: 22px 26px; min-width: 0; }
.admin-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); border: 1px solid #eef1f5; }
.card .k { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.card .v { font-size: 24px; font-weight: 700; }
.card .v.green { color: var(--wx-green); }
.card .v.red { color: var(--wx-red); }
.card .v.blue { color: var(--wx-blue); }
.panel { background: #fff; border-radius: 10px; border: 1px solid #eef1f5; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); margin-bottom: 18px; overflow: hidden; }
.panel-h { padding: 14px 18px; border-bottom: 1px solid #eef1f5; display: flex; align-items: center; gap: 10px; }
.panel-h h3 { margin: 0; font-size: 15px; }
.panel-h .spacer { flex: 1; }
.panel-b { padding: 16px 18px; }
.view { display: none; }
.view.active { display: block; animation: listIn .25s ease both; }
.spacer { flex: 1; }

@media (max-width: 768px) {
  .admin-nav { width: 60px; min-width: 60px; }
  .admin-nav a span, .admin-nav .foot { display: none; }
  .admin-nav a { justify-content: center; padding: 14px 0; }
}

/* 桌面适配：壳居中 + 阴影 */
@media (min-width: 481px) {
  body { background: #cfcfcf; }
  .wx { box-shadow: 0 0 48px rgba(0, 0, 0, .22); }
}

/* 降低动效（尊重系统设置） */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
