:root {
  --bg: #eef1f7;
  --panel: #ffffff;
  --panel-2: #f5f9ff;
  --text: #1c2230;
  --text-2: #6b7488;
  --line: #e6e9f2;
  --accent: #1e78ed;
  --accent-2: #4f97ff;
  --accent-soft: #e8f1fe;
  --green: #16a34a;
  --danger: #e11d48;
  --shadow: 0 12px 32px rgba(24, 32, 56, .10);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #d9f2e3 0%, transparent 55%),
              radial-gradient(900px 500px at 110% 10%, #e8f1fe 0%, transparent 50%),
              var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.app {
  height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  position: relative;
}

/* ============ 侧栏 ============ */
.sidebar {
  --side-pad-x: 12px;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px var(--side-pad-x) 12px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; font-size: 19px;
  background: linear-gradient(135deg, #059669, #4f97ff);
  box-shadow: 0 6px 16px rgba(30, 120, 237, .35);
}
.brand-logo svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .2px; }
.brand-text span { font-size: 12px; color: var(--text-2); }
.brand-add { margin-left: auto; }

.me {
  display: flex; align-items: center; gap: 10px;
  margin: 4px var(--side-pad-x) 10px; padding: 10px;
  background: var(--panel-2); border-radius: 12px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, #059669, #2eb872); flex: none;
}
.me-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.me-info b { font-size: 13.5px; }
.me-info span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  border: 0; background: transparent; border-radius: 8px;
  width: 30px; height: 30px; display: grid; place-items: center;
  color: var(--text-2); font-size: 15px;
}
.icon-btn:hover { background: #eff5fe; color: var(--text); }
.icon-btn .ib-svg { width: 22px; height: 22px; display: block; }
.c-ico.c-ico-svg,
.fsw-ico.c-ico-svg,
.fav-side-tabs .fav-cat .c-ico.fav-ico-svg {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6b7385; line-height: 0;
  border-radius: 8px; background: #f3f4f8;
}
.c-ico.c-ico-svg svg,
.fsw-ico.c-ico-svg svg,
.fav-side-tabs .fav-cat .c-ico.fav-ico-svg svg { width: 20px; height: 20px; display: block; }
.store-side-tabs .store-cat .c-ico.c-ico-svg { color: #5b6478; background: #f3f4f8; }
.store-side-tabs .store-cat[data-cat="all"] .c-ico { color: #3B7FE8; background: #e8f1fe; }
.store-side-tabs .store-cat[data-cat="tool"] .c-ico { color: #8b7355; background: #f5f0ea; }
.store-side-tabs .store-cat[data-cat="game"] .c-ico { color: #7c5cbf; background: #f1ebff; }
.store-side-tabs .store-cat[data-cat="life"] .c-ico { color: #c2783d; background: #fff4e8; }
.store-side-tabs .store-cat.active .c-ico.c-ico-svg { box-shadow: inset 0 0 0 1px rgba(59,127,232,.18); }
.fav-side-tabs .fav-cat.active .c-ico.fav-ico-svg { color: var(--accent); background: var(--accent-soft); }
.fav-side-write .fsw-ico.c-ico-svg { margin-right: 4px; color: #5b6478; background: #f3f4f8; }
.c-sec.c-link .c-ico.c-ico-svg { color: #d97706; background: #fff4e5; }

.section-title {
  padding: 8px 18px 6px; font-size: 12px; letter-spacing: .8px;
  color: var(--text-2); text-transform: uppercase;
}
.conv-list { flex: 1; overflow-y: auto; padding: 0 var(--side-pad-x) 8px; min-height: 0; }
.conv {
  display: flex; gap: 10px; align-items: center;
  padding: 10px; border-radius: 11px; cursor: pointer; position: relative;
}
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--accent-soft); }
.conv .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
.conv-main { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.conv-top b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { font-size: 11px; color: var(--text-2); flex: none; }
.conv-bottom { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.conv-bottom span { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  background: var(--danger); color: #fff; font-size: 10.5px; line-height: 1;
  padding: 3px 6px; border-radius: 99px; flex: none;
}
.sidebar-foot { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.foot-btn {
  flex: 1; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 10px; padding: 9px 6px; font-size: 12.5px;
}
.foot-btn:hover { border-color: #bbd4fb; background: var(--accent-soft); }

/* ============ 聊天区 ============ */
.chat {
  /* 消息区底色；头栏/输入栏单独铺白 */
  background: #f3f5fa;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.chat-title { display: flex; flex-direction: column; line-height: 1.3; }
.chat-title b { font-size: 15.5px; }
.chat-title span { font-size: 12px; color: var(--text-2); }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #cbd2e0; display: block; }
.conn.ok i { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.conn.bad i { background: var(--danger); box-shadow: 0 0 0 3px rgba(225, 29, 72, .15); }

.messages {
  flex: 1; overflow-y: auto; padding: 18px 20px 8px;
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
  background: transparent;
}
.msg { display: flex; gap: 10px; max-width: 76%; }
.msg .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.msg-body { min-width: 0; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; }
.msg-meta b { font-size: 12px; color: var(--text-2); font-weight: 600; }
.msg-meta time { font-size: 10.5px; color: #7c869b; }
.bubble {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 9px 12px; border-radius: 4px 12px 12px 12px;
  font-size: 13.5px; word-break: break-word; white-space: pre-wrap;
}
.msg.self { align-self: flex-end; flex-direction: row-reverse; }
.msg.self .msg-meta { justify-content: flex-end; }
.msg.self .bubble {
  background: linear-gradient(135deg, #1e78ed, #4f97ff);
  color: #fff; border: 0; border-radius: 12px 4px 12px 12px;
  box-shadow: 0 6px 16px rgba(30, 120, 237, .28);
}
.msg.system { align-self: center; max-width: 90%; }
.msg.system .bubble {
  background: transparent; border: 0; color: #8b93a7; font-size: 12px;
  padding: 0; text-align: center;
}
.msg.self .msg-meta b { color: #9cb4d8; }

/* 小程序卡片消息 */
.mp-card {
  width: 268px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 6px 18px rgba(20, 26, 45, .08); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.mp-card:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(20, 26, 45, .14); }
.mp-card-head {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px 6px; font-size: 12px; color: var(--text-2);
}
.mp-card-head .mp-logo {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 12px;
}
.mp-card-title { padding: 2px 12px 10px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.mp-card-desc { padding: 0 12px 10px; font-size: 12px; color: var(--text-2); }
.mp-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); padding: 7px 12px; font-size: 12px; color: var(--text-2);
  background: var(--panel-2);
}
.mp-card-foot b { color: var(--accent); font-weight: 600; }
.msg.self .mp-card { color: var(--text); }

/* 输入区 */
.load-earlier {
  display: block; margin: 6px auto 0; padding: 2px 10px; border: 0; border-radius: 99px;
  background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer;
}
.load-earlier:hover { background: var(--accent-soft); color: var(--accent); }
.load-earlier[hidden] { display: none; }
.composer { border-top: 1px solid var(--line); padding: 10px 16px 14px; background: var(--panel); flex: none; }
.tools { display: flex; gap: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.tool {
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 99px; padding: 5px 12px; font-size: 12.5px; color: #404a63;
}
.tool:hover { border-color: #bbd4fb; background: var(--accent-soft); color: var(--accent); }
.tool.ghost { background: transparent; color: var(--text-2); }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
#input {
  flex: 1; resize: none; max-height: 120px; min-height: 40px;
  border: 0; border-radius: 8px; padding: 9px 12px;
  font: inherit; line-height: 1.4; background: #f2f3f5; outline: none;
  overflow-x: hidden; overflow-y: hidden; /* 未超高时不出现滚动条 */
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 26, 45, .28) transparent; /* Firefox：只有滑块有色 */
}
#input::-webkit-scrollbar { width: 6px; }
#input::-webkit-scrollbar-track { background: transparent; }
#input::-webkit-scrollbar-thumb {
  background: rgba(20, 26, 45, .28);
  border-radius: 99px;
}
#input::-webkit-scrollbar-thumb:hover { background: rgba(20, 26, 45, .42); }
#input:focus { border-color: #bbd4fb; background: #fff; box-shadow: 0 0 0 3px rgba(30, 120, 237, .14); }
.send {
  border: 0; border-radius: 8px; padding: 0 14px; height: 40px;
  background: linear-gradient(135deg, #1e78ed, #4f97ff); color: #fff; font-weight: 600;
  box-shadow: 0 8px 18px rgba(30, 120, 237, .3);
}
.send:disabled { opacity: .5; box-shadow: none; cursor: default; }

/* ============ 小程序面板 ============ */
.mp-panel {
  position: fixed; top: 18px; right: 18px; bottom: 18px; width: min(460px, calc(100vw - 36px));
  background: var(--panel); border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 26, 45, .22);
  display: flex; flex-direction: column; overflow: hidden; z-index: 40;
  transform: translateX(calc(100% + 40px)); transition: transform .28s cubic-bezier(.22, .9, .28, 1);
}
.mp-panel.open { transform: translateX(0); }
.mp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line);
}
.mp-identity { display: flex; gap: 9px; align-items: center; min-width: 0; }
.mp-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 17px; flex: none;
}
.mp-identity b { display: block; font-size: 13.5px; line-height: 1.25; }
.mp-identity span { font-size: 11px; color: var(--text-2); }
.mp-actions { display: flex; gap: 2px; }
.mp-permbar {
  display: none; gap: 6px; flex-wrap: wrap; padding: 6px 12px;
  background: #fff9ec; border-bottom: 1px solid #f4e6c8; font-size: 11px; color: #8a6d2f;
}
.mp-permbar.show { display: flex; }
.mp-permbar .chip {
  background: #fff; border: 1px solid #f0dfbb; border-radius: 99px; padding: 1px 8px;
}
.mp-stage { position: relative; flex: 1; background: #f3f5fa; min-height: 0; }
#mpFrame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.mp-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: #f5f9ff; color: var(--text-2); font-size: 12.5px;
}
.mp-loading[hidden] { display: none; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid #dfe3f2; border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mp-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: #8b93a7; background: var(--panel-2);
}
.mp-badge { background: #e8f1fe; color: #1e78ed; border-radius: 99px; padding: 2px 8px; }

/* ============ 弹层 ============ */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(18, 22, 36, .42); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 60; padding: 20px;
}
.sheet-mask[hidden] { display: none; }
.sheet {
  background: var(--panel); border-radius: 16px; width: min(720px, 100%);
  box-shadow: 0 30px 80px rgba(10, 14, 26, .35); padding: 16px 18px 18px;
  max-height: 82vh; display: flex; flex-direction: column;
}
.sheet.small { width: min(420px, 100%); }
.sheet[hidden] { display: none; }
.sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet header b { font-size: 15px; }
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  overflow-y: auto;
  align-items: stretch;
}
.store-item {
  position: relative;
  height: 248px;
  border: 1px solid rgba(20, 26, 45, .08);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  color: #fff;
  background-color: #4a5568;
  background-image:
    linear-gradient(180deg, rgba(12, 18, 32, .28) 0%, rgba(12, 18, 32, .55) 48%, rgba(12, 18, 32, .78) 100%),
    var(--store-cover, none);
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 22px rgba(20, 26, 45, .10);
}
.store-item:hover {
  border-color: rgba(30, 120, 237, .35);
  box-shadow: 0 12px 28px rgba(20, 26, 45, .16);
  transform: translateY(-1px);
}
.store-item .row { display: flex; gap: 9px; align-items: center; min-width: 0; }
.store-item .ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: rgba(255,255,255,.92); color: #1a1d2a;
  display: grid; place-items: center; font-size: 19px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.store-item .row > div { min-width: 0; flex: 1; }
.store-item b {
  display: block;
  font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.store-item .ver {
  font-size: 11px; color: rgba(255,255,255,.78);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-item p {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,.88);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}
.store-item .perms {
  display: flex; flex-wrap: nowrap; gap: 4px; margin-top: 0;
  min-height: 0; overflow: hidden;
}
.store-item .perms code {
  font-size: 10px;
  background: rgba(255,255,255,.18);
  color: #fff;
  padding: 1px 6px;
  border-radius: 99px;
  white-space: nowrap;
}
.store-item > .btn.primary {
  margin-top: auto;
  width: 100%;
  border: 0;
  background: rgba(255,255,255,.95);
  color: #1e78ed;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.store-item > .btn.primary:hover {
  filter: none;
  background: #fff;
  color: #1565d0;
}
.store-item .kind {
  background: rgba(255,255,255,.22) !important;
  color: #fff !important;
  margin-left: 6px;
  vertical-align: 1px;
}
.store-item .kind.life {
  background: rgba(255, 196, 80, .35) !important;
}
.hint { font-size: 12px; color: var(--text-2); margin: 12px 2px 0; line-height: 1.6; }

.btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 14px; font-size: 13px; }
.btn.primary { background: linear-gradient(135deg, #1e78ed, #4f97ff); color: #fff; border: 0; }
.btn.ghost { background: transparent; }
.btn:hover { filter: brightness(.98); }

.perm-body { padding: 4px 2px 12px; font-size: 13px; }
.perm-app { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.perm-app span { font-size: 20px; }
.perm-scope {
  display: flex; flex-direction: column; gap: 4px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.perm-scope code { font-size: 12px; color: var(--accent); }
.perm-scope span { font-size: 12px; color: var(--text-2); }
.sheet-btns { display: flex; gap: 10px; justify-content: flex-end; }

.list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.list-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid transparent; text-align: left; background: transparent;
}
.list-item:hover { background: var(--panel-2); border-color: var(--line); }
.list-item .ico { font-size: 18px; width: 28px; text-align: center; color: #5b6478; flex: none; }
.list-item .ico.ico-svg {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; line-height: 0;
  border-radius: 8px; background: #f3f4f8; color: #5b6478;
}
.list-item .ico.ico-svg svg { width: 22px; height: 22px; display: block; }
.list-item .ico.ico-svg.ico-danger { background: #fff1f2; color: #e54d42; }
.list-item .ico.ico-svg.ico-ok { background: #eaf8f0; color: #07ae58; }
.list-item b { font-size: 13px; display: block; }
.list-item small { color: var(--text-2); font-size: 12px; }
.list-item .right { margin-left: auto; color: var(--text-2); font-size: 12px; }

/* 会话右键/长按菜单（参考 lottery-user / 图二） */
.conv-action-layer {
  position: fixed; inset: 0; z-index: 80;
}
.conv-action-layer[hidden] { display: none !important; }
.conv-action-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .45);
}
.conv-action-highlight {
  position: absolute; z-index: 1;
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 26, 45, .14);
  pointer-events: none;
}
.conv-action-highlight[hidden] { display: none !important; }
.conv-action-highlight .conv {
  margin: 0; background: #fff !important;
  box-shadow: none;
}
.conv-action-menu {
  position: absolute; z-index: 2;
  min-width: 108px; padding: 6px 0;
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
}
.conv-action-menu__item {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 44px; padding: 10px 22px;
  font-size: 15px; color: #1a1d2a; background: transparent; border: 0;
  width: 100%; cursor: pointer; text-align: left;
  border-bottom: 1px solid rgba(54, 56, 83, .06);
}
.conv-action-menu__item:last-child { border-bottom: 0; }
.conv-action-menu__item:hover { background: rgba(54, 56, 83, .04); }
.conv-action-menu__item--danger .cam-label { color: #e54d42; }
.conv-action-menu__item--multi { min-height: 56px; gap: 2px; }
.conv-action-menu .cam-label { font-size: 15px; line-height: 1.35; }
.conv-action-menu .cam-sub { font-size: 12px; color: #8b93a7; line-height: 1.35; }

.toast {
  position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 20px);
  background: rgba(24, 30, 46, .92); color: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 12.5px; opacity: 0; pointer-events: none;
  transition: all .22s ease; z-index: 90; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 空状态 */
.empty {
  margin: auto; text-align: center; color: var(--text-2); font-size: 12.5px;
  display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 20px;
}
.empty .big { font-size: 30px; }
.empty-illu {
  width: 132px; height: auto; max-width: 56%;
  display: block; margin: 0 auto 2px;
  user-select: none; pointer-events: none;
  opacity: .95;
}
.empty .empty-illu { margin-bottom: 4px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 0; gap: 0; height: 100dvh; }
  .sidebar { display: none; }
  .chat { border-radius: 0; }
  .mp-panel { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
}

/* ============ 登录 / 注册 ============ */
.login-mask {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 15% 0%, #d9f2e3 0%, transparent 55%),
    radial-gradient(700px 500px at 90% 10%, #e8f1fe 0%, transparent 50%),
    rgba(238, 241, 247, .92);
  backdrop-filter: blur(6px);
}
.login-mask[hidden] { display: none; }
.login-card {
  width: min(400px, 100%); background: #fff; border-radius: 18px; padding: 22px 22px 16px;
  box-shadow: 0 30px 80px rgba(20, 26, 45, .22);
}
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.login-brand .brand-logo { width: 44px; height: 44px; font-size: 22px; }
.login-brand b { display: block; font-size: 16px; }
.login-brand span { font-size: 12px; color: var(--text-2); }
.login-tabs { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.login-tab { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.login-tab.active { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(20, 26, 45, .08); font-weight: 600; }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form[hidden] { display: none; }
.login-form label { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.login-form input {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 11px 12px; font: inherit; outline: none;
}
.login-form input:focus { border-color: #bbd4fb; background: #fff; box-shadow: 0 0 0 3px rgba(30, 120, 237, .14); }
.primary.lg { width: 100%; border: 0; color: #fff; font-weight: 600; padding: 12px; border-radius: 11px; margin-top: 14px;
  background: linear-gradient(135deg, #1e78ed, #4f97ff); box-shadow: 0 10px 22px rgba(30, 120, 237, .3); }
.primary.lg:disabled { opacity: .6; box-shadow: none; }
.login-err { color: var(--danger); font-size: 12px; min-height: 16px; margin: 6px 0 0; }
.login-hint { font-size: 12px; color: var(--text-2); margin: 4px 0 0; line-height: 1.6; }
.login-hint code { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 5px; }
.login-guest { width: 100%; border: 0; background: transparent; color: var(--text-2); font-size: 12.5px; padding: 12px 0 4px; }
.login-guest:hover { color: var(--accent); }

/* ============ 侧栏 tab ============ */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 0 12px 8px; background: var(--panel-2); border-radius: 10px; }
.tab {
  flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 7px 6px;
  font-size: 12.5px; color: var(--text-2); position: relative;
}
.tab:hover { background: var(--panel-2); }
.tab.active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(20, 26, 45, .06); }
.tab-count { font-size: 10.5px; margin-left: 3px; opacity: .8; }

/* 通讯录条目 */
.friend { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; cursor: pointer; }
.friend:hover { background: var(--panel-2); }
.friend .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.friend b { font-size: 13.5px; font-weight: 600; display: block; }
.friend small { font-size: 11px; color: var(--text-2); }
.friend .add { margin-left: auto; font-size: 11px; color: var(--accent); border: 1px solid #c9efda; border-radius: 99px; padding: 3px 9px; background: #fff; }

/* 游客态 */
.guest-view {
  margin: auto; text-align: center; max-width: 420px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.guest-view .big { font-size: 40px; }
.guest-view h3 { margin: 4px 0 0; font-size: 18px; }
.guest-view p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.guest-view .primary { margin-top: 8px; border: 0; color: #fff; background: linear-gradient(135deg, #1e78ed, #4f97ff);
  border-radius: 11px; padding: 11px 26px; font-weight: 600; box-shadow: 0 10px 22px rgba(30, 120, 237, .28); }
.locked { opacity: .45; pointer-events: none; filter: blur(.4px); }
.icon-btn.text { width: auto; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.icon-btn.text:hover { color: var(--danger); background: #fff1f4; }

/* ============ 语音通话 ============ */
.chat-actions { display: flex; align-items: center; gap: 6px; }
.chat-actions .icon-btn { font-size: 16px; }

.call-layer {
  position: fixed; inset: 0; z-index: 95; color: #fff;
  background: linear-gradient(160deg, #2b3242 0%, #1a1f2b 55%, #12151d 100%);
  display: grid; place-items: center; overflow: hidden;
}
.call-layer[hidden] { display: none; }
.call-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 120, 237, .35), transparent 65%);
  filter: blur(30px); top: -160px; left: 50%; transform: translateX(-50%);
  animation: callPulse 4s ease-in-out infinite;
}
@keyframes callPulse { 0%,100% { opacity: .55; } 50% { opacity: .95; } }
.call-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(420px, 88vw); }
.call-avatar {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  font-size: 40px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #059669, #2eb872);
  box-shadow: 0 18px 50px rgba(56, 78, 220, .45), 0 0 0 10px rgba(255,255,255,.06);
  margin-top: 20px;
}
.call-name { font-size: 22px; font-weight: 600; letter-spacing: .3px; }
.call-status { font-size: 13.5px; color: rgba(255,255,255,.62); min-height: 20px; letter-spacing: .5px; }
.call-controls { display: flex; gap: 34px; margin-top: 26px; }
.call-btn {
  width: 66px; border: 0; background: transparent; color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px;
}
.call-btn i {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; font-style: normal; background: rgba(255,255,255,.14);
  transition: transform .12s ease, background .15s ease;
}
.call-btn:hover i { transform: translateY(-2px); }
.call-btn:active i { transform: scale(.95); }
.call-btn span { color: rgba(255,255,255,.78); }
.call-btn.accept i { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 10px 24px rgba(34,197,94,.35); }
.call-btn.reject i, .call-btn.hangup i { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 10px 24px rgba(244,63,94,.35); }
.call-btn.mute.on i, .call-btn.speaker.on i { background: linear-gradient(135deg, #1e78ed, #4f97ff); }
.call-min {
  margin-top: 18px; border: 0; background: transparent; color: rgba(255,255,255,.55);
  font-size: 12.5px; padding: 8px 16px; border-radius: 99px;
}
.call-min:hover { color: #fff; background: rgba(255,255,255,.08); }

.call-float {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 94; background: #16a34a; color: #fff; font-size: 12.5px;
  padding: 7px 16px; border-radius: 99px; box-shadow: 0 8px 20px rgba(22,163,74,.35);
  cursor: pointer;
}
.call-float[hidden] { display: none; }

/* 修复 [hidden] 被 display:flex 覆盖 */
.call-btn[hidden] { display: none; }
.call-btn i svg { width: 26px; height: 26px; fill: #fff; display: block; }

/* ============ 陌生人拨打 / 通话记录 ============ */
.dial-entry {
  width: 100%; border: 1px dashed #cfd5e6; background: transparent; color: var(--accent);
  border-radius: 10px; padding: 9px; font-size: 12.5px; margin: 4px 0 10px;
}
.dial-entry:hover { background: var(--accent-soft); border-color: #c3c8f2; }
.call-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; cursor: pointer; }
.call-item:hover { background: var(--panel-2); }
.call-item .dir { width: 22px; text-align: center; font-size: 13px; }
.call-item .dir.out { color: var(--accent); }
.call-item .dir.in { color: var(--green); }
.call-item .dir.miss { color: var(--danger); }
.call-item .info { flex: 1; min-width: 0; }
.call-item b { font-size: 13px; display: block; }
.call-item small { font-size: 11px; color: var(--text-2); }
.call-item time { font-size: 10.5px; color: #7c869b; }
.call-item .call-redial {
  background: none; border: none; padding: 4px 6px; border-radius: 8px;
  font-size: 14px; cursor: pointer; opacity: 0.4; transition: opacity .15s, background .15s;
  color: #5b6478; display: inline-flex; align-items: center; justify-content: center;
}
.call-item .call-redial svg { width: 16px; height: 16px; display: block; }
.call-item:hover .call-redial { opacity: 0.85; }
.call-item .call-redial:hover { opacity: 1; background: var(--panel-3, #eef1ff); }
.call-empty { text-align: center; color: var(--text-2); font-size: 12px; padding: 24px 8px; }

.dial-body { display: flex; flex-direction: column; gap: 10px; }
.dial-row { display: flex; gap: 8px; }
.dial-row input {
  flex: 1; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 10px 12px; font: inherit; outline: none;
}
.dial-row input:focus { border-color: #bbd4fb; background: #fff; }
.dial-tip { font-size: 12px; color: var(--text-2); margin: 0; }
.dial-result { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel-2); }
.dial-result .row { display: flex; align-items: center; gap: 10px; }
.dial-result .avatar { width: 38px; height: 38px; border-radius: 50%; font-size: 15px; }
.dial-result b { font-size: 14px; display: block; }
.dial-result small { color: var(--text-2); font-size: 12px; }
.dial-result .actions { display: flex; gap: 8px; margin-top: 10px; }
.dial-result .actions .btn { flex: 1; }

.block-box {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; color: var(--text-2); padding: 8px; margin-bottom: 6px;
  background: #fff5f7; border: 1px solid #f6d7de; border-radius: 10px;
}
.blk-chip {
  border: 1px solid #f1c2cd; background: #fff; color: #b91c41;
  border-radius: 99px; padding: 2px 9px; font-size: 11px;
}
.blk-chip:hover { background: #ffe4ea; }

.req-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.req-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.req-item .avatar { width: 36px; height: 36px; border-radius: 50%; font-size: 14px; }
.req-item .info { flex: 1; min-width: 0; }
.req-item b { display: block; font-size: 13.5px; }
.req-item small { font-size: 12px; color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-item .acts { display: flex; gap: 6px; }
.req-item .acts button { border: 0; border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.req-item .acts .ok { background: var(--accent); color: #fff; }
.req-item .acts .no { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); }
.req-empty { text-align: center; color: var(--text-2); font-size: 12.5px; padding: 22px 8px; }
.badge.dot { min-width: 18px; text-align: center; }
.dial-result .actions .btn.go { background: #fff; border: 1px solid #bbd4fb; color: var(--accent); }

.group-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 4px; font-size: 12px; color: var(--text-2); }
.group-head i { font-style: normal; opacity: .7; }
.friend .f-main { flex: 1; min-width: 0; }
.friend .friend-edit { border: 0; background: transparent; color: #b6bdcf; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.friend .friend-edit:hover { color: var(--accent); background: var(--accent-soft); }
#promptInput { width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 11px 12px; font: inherit; outline: none; }
#promptInput:focus { border-color: #bbd4fb; background: #fff; }
.dial-entry { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.dial-entry .ico { width: 16px; height: 16px; fill: currentColor; }
.friend-edit svg { width: 14px; height: 14px; fill: currentColor; display: block; }

/* 分组标题行的「管理」快捷按钮 */
.group-head .gmgr-btn {
  border: 0; background: transparent; color: #b6bdcf; font-size: 11px;
  padding: 2px 6px; border-radius: 6px; cursor: pointer; opacity: 0;
  transition: opacity .15s ease;
}
.group-head:hover .gmgr-btn { opacity: 1; }
.group-head .gmgr-btn:hover { color: var(--accent); background: var(--accent-soft); }

/* 通讯录底部的「管理分组」入口 */
.group-mgr-entry {
  padding: 14px 12px 8px; display: flex; justify-content: center;
}
.group-mgr-entry .btn { width: 100%; }

/* 分组管理面板 */
.groupmgr { padding: 4px 12px 12px; max-height: 65vh; overflow-y: auto; }
.groupmgr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px; background: var(--panel-2); border-radius: 11px;
  margin-bottom: 8px;
}
.groupmgr-row .gmgr-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); }
.groupmgr-row .gmgr-count {
  font-size: 11px; color: var(--text-2); padding: 2px 7px; border-radius: 99px;
  background: #eff5fe; flex: none;
}
.groupmgr-row .gmgr-actions { display: flex; gap: 2px; flex: none; }
.groupmgr-row .gmgr-actions button {
  border: 0; background: transparent; color: var(--text-2); font-size: 12px;
  padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.groupmgr-row .gmgr-actions .rename-btn:hover { color: var(--accent); background: var(--accent-soft); }
.groupmgr-row .gmgr-actions .delete-btn:hover { color: var(--danger); background: #ffe6eb; }

/* ============ 朋友圈 / 发现（第二列发现导航 + 右侧封面流） ============ */
.app.moments-mode .me,
.app.moments-mode .side-search:has(#convSearch),
.app.moments-mode #convSearch,
.app.moments-mode .tabs,
.app.moments-mode #convList,
.app.moments-mode #friendList,
.app.moments-mode #callList,
.app.moments-mode #storeList,
.app.moments-mode #favSide,
.app.moments-mode .brand-add,
.app.moments-mode .sidebar-foot {
  display: none !important;
}
.app.moments-mode #discoverSide {
  display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}
/* 发现里点小程序/游戏：左侧仍是发现，右侧显示 storeMain */
.app.moments-mode.discover-store #chatMain { display: none !important; }
.app.moments-mode.discover-store #storeList { display: none !important; }
.app.moments-mode.discover-store #discoverSide { display: flex !important; }
.discover-side-tabs {
  display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 12px; flex: 1; overflow: auto;
}
.discover-side-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; box-shadow: none;
  border-radius: 8px; padding: 11px 12px; text-align: left; cursor: pointer; color: var(--text);
}
.discover-side-item:hover { background: rgba(0,0,0,.04); }
.discover-side-item.active { background: #e8f5e9; color: #1a1d2a; }
.discover-side-item .dsi-title { flex: 1; font-size: 14px; font-weight: 500; }
.discover-side-item.active .dsi-title { font-weight: 600; }
.discover-side-item .dsi-ico {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0; overflow: hidden;
}
.discover-side-item .dsi-ico svg {
  width: 20px; height: 20px; display: block; flex: none;
  /* 光学微调：避免线框图标视觉偏下 */
  transform: translateY(-0.5px);
}
.discover-side-item .dsi-moments { color: #07c160; background: #e8f8ef; --dsi-core: #e8f8ef; }
.discover-side-item .dsi-store { color: #7c5cbf; background: #f1ebff; }
.discover-side-item .dsi-game { color: #f59e0b; background: #fff7e8; }
.discover-side-item.active .dsi-moments { color: #fff; background: #07c160; --dsi-core: #07c160; }
.discover-side-item.active .dsi-game { background: #fff0d6; }
.discover-side-item.active .dsi-store { background: #ebe2ff; }

.moments-panel {
  display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
  background: #fff;
}
.chat.moments-on .moments-panel { display: flex; }
.chat.moments-on .chat-empty,
.chat.moments-on .chat-head,
.chat.moments-on .composer,
.chat.moments-on .notice-bar,
.chat.moments-on .net-banner,
.chat.moments-on .messages,
.chat.moments-on .load-earlier,
.chat.moments-on .jump-bottom,
.chat.moments-on .drop-hint,
.chat.moments-on .mention-pop { display: none !important; }
.moments-scroll { flex: 1; min-height: 0; overflow-y: auto; background: #fff; }
.moments-cover {
  position: relative; height: min(38vh, 300px); min-height: 200px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(0,0,0,.05) 0%, transparent 28%, rgba(0,0,0,.45) 100%),
    url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=1200&q=80&auto=format&fit=crop') center / cover no-repeat,
    linear-gradient(160deg, #7bb58a, #5a8fb8);
  background-size: cover;
  background-position: center;
}
.moments-cover.has-custom-bg {
  /* 自定义封面：渐变叠在用户图上，由 JS 写入 background-image */
  background-size: cover;
  background-position: center;
}
.moments-cover-tools {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
}
.moments-cover-back {
  position: absolute; top: 12px; left: 10px; z-index: 2;
  color: #fff !important; text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.moments-cover-cam {
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: #fff; padding: 0; cursor: pointer;
  display: grid; place-items: center;
}
.moments-cover-cam svg { width: 22px; height: 22px; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.moments-cover-cam:hover { background: rgba(255,255,255,.18); }
.moments-cover-me {
  position: absolute; right: 20px; bottom: -28px; z-index: 2;
  display: flex; align-items: flex-end; gap: 12px;
}
.moments-cover-me b {
  color: #fff; font-size: 17px; font-weight: 600; margin-bottom: 28px;
  text-shadow: 0 1px 8px rgba(0,0,0,.55); max-width: 180px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.moments-cover-avatar {
  width: 68px; height: 68px; border-radius: 6px; font-size: 22px;
  border: 0; box-shadow: 0 2px 10px rgba(0,0,0,.28);
  flex: none;
}
.moments-feed {
  padding: 44px 22px 8px; min-height: 120px; background: #fff;
}
.moments-loading, .moments-empty { display: block; text-align: center; color: var(--text-2); font-size: 12.5px; padding: 26px 0; }
.moments-empty-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 36px 12px; color: var(--text-2); font-size: 12.5px; text-align: center;
}
.moments-empty-box .empty-illu { width: 132px; }
.moments-foot { display: flex; justify-content: center; padding: 6px 0 18px; background: #fff; }
.moments-foot .btn { font-size: 12.5px; }
.moment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.moment:last-child { border-bottom: 0; }
.moment > .avatar { width: 44px; height: 44px; border-radius: 6px; font-size: 15px; flex: none; }
.moment-main { flex: 1; min-width: 0; }
.moment-name { font-size: 15px; font-weight: 600; color: #576b95; margin-bottom: 5px; }
.moment-text { font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: #191919; }
.moment-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; max-width: 300px; }
.moment-media.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 220px; }
.moment-media.single { grid-template-columns: 1fr; max-width: 220px; }
.moment-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 2px; background: #f2f2f2; cursor: zoom-in; }
.moment-media.single .moment-img { aspect-ratio: auto; max-height: 280px; object-fit: contain; background: #f7f7f7; }
.moment-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: #b2b2b2; position: relative; }
.moment-more {
  width: 32px; height: 22px; border: 0; border-radius: 3px;
  background: #f7f7f7; color: #576b95; font-size: 16px; line-height: 1; letter-spacing: 1px;
  cursor: pointer; padding: 0;
}
.moment-more:hover { background: #ececec; }
.moment-pop {
  position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: stretch; background: #4c4c4c; border-radius: 4px;
  overflow: hidden; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.moment-pop[hidden] { display: none; }
.moment-pop button {
  border: 0; background: transparent; color: #fff; font-size: 13px;
  padding: 8px 14px; white-space: nowrap; cursor: pointer;
}
.moment-pop button + button { border-left: 1px solid rgba(255,255,255,.12); }
.moment-pop button:hover { background: rgba(255,255,255,.08); }
.moment-pop button.on { color: #ffb4b4; }
.moment-pop button.danger { color: #ffb4b4; }
.moment-likes { margin-top: 8px; padding: 7px 10px; background: #f7f7f7; border-radius: 3px; font-size: 13px; color: #576b95; line-height: 1.55; }
.moment-comments { margin-top: 2px; background: #f7f7f7; border-radius: 3px; padding: 6px 10px; }
.moment-likes + .moment-comments { margin-top: 0; border-radius: 0 0 3px 3px; }
.moment-likes:has(+ .moment-comments) { border-radius: 3px 3px 0 0; border-bottom: 1px solid #ebebeb; }
.moment-comment { font-size: 13px; line-height: 1.65; cursor: pointer; word-break: break-word; color: #191919; }
.moment-comment b { color: #576b95; font-weight: 600; }
.moment-comment .m-reply { color: #b2b2b2; margin: 0 3px; }
.moments-textarea {
  width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line);
  background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px;
  outline: none; font-family: inherit; line-height: 1.6;
}
.moments-textarea:focus { border-color: #bbd4fb; background: #fff; }
.moments-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.moment-thumb { position: relative; width: 68px; height: 68px; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.moment-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moment-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(20, 24, 38, .62); color: #fff; font-size: 12px; line-height: 1; padding: 0;
}
.moments-pick { display: inline-flex; align-items: center; cursor: pointer; }

/* 发表朋友圈弹窗（对齐微信） */
.sheet.moment-compose {
  position: relative;
  width: min(420px, 100%);
  padding: 22px 22px 18px;
  border-radius: 14px;
  background: #fff;
}
.mc-text {
  width: 100%; min-height: 88px; max-height: 180px; resize: none;
  border: 0 !important; outline: none !important; background: transparent; padding: 0;
  font-size: 16px; line-height: 1.55; font-family: inherit; color: #191919;
  box-shadow: none !important;
}
.mc-text:hover,
.mc-text:focus,
.mc-text:focus-visible {
  border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent;
}
.mc-text::placeholder { color: #b2b2b2; }
.mc-tools { display: flex; align-items: center; margin: 4px 0 12px; }
.mc-emoji {
  width: 28px; height: 28px; border: 0; border-radius: 6px; padding: 0;
  background: transparent; color: #8c8c8c; font-size: 22px; line-height: 1; cursor: pointer;
}
.mc-emoji:hover { color: #576b95; background: #f5f5f5; }
.mc-media {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.mc-media .moment-thumb {
  width: 100%; aspect-ratio: 1 / 1; height: auto; border-radius: 4px; background: #f2f2f2;
}
.mc-add {
  width: 100%; aspect-ratio: 1 / 1; border: 0; border-radius: 4px;
  background: #f2f2f2; color: #b2b2b2; font-size: 36px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.mc-add:hover { background: #ebebeb; color: #8c8c8c; }
.mc-add[hidden] { display: none; }
.mc-rows {
  border-top: 1px solid #f0f0f0; margin: 4px 0 16px;
}
.mc-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; border-bottom: 1px solid #f0f0f0; background: transparent;
  padding: 13px 2px; text-align: left; cursor: pointer; color: #191919; font-size: 14px;
}
.mc-row:last-child { border-bottom: 0; }
.mc-row:hover { background: #fafafa; }
.mc-row-ico {
  width: 22px; flex: none; text-align: center; color: #576b95; font-size: 15px; font-weight: 600;
}
.mc-row-ico.mc-row-svg {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.mc-row-ico.mc-row-svg svg { width: 18px; height: 18px; display: block; }
.mc-row-lbl { flex: 1; font-weight: 400; }
.mc-row-val { color: #8c8c8c; font-size: 13px; margin-right: 2px; }
.mc-row i { font-style: normal; color: #c8c8c8; font-size: 16px; }
.mc-actions { display: flex; gap: 12px; }
.mc-cancel, .mc-post {
  flex: 1; height: 44px; border: 0; border-radius: 8px;
  font-size: 16px; font-weight: 500; cursor: pointer;
}
.mc-cancel { background: #f2f2f2; color: #191919; }
.mc-cancel:hover { background: #ebebeb; }
.mc-post { background: #07c160; color: #fff; }
.mc-post:hover { background: #06ad56; }
.mc-post:disabled { opacity: .55; cursor: not-allowed; }

/* 取消时：将此次编辑保留？ */
.mc-keep-mask {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  background: rgba(0,0,0,.28); border-radius: 14px;
}
.mc-keep-mask[hidden] { display: none; }
.mc-keep-card {
  width: min(280px, 86%); background: #fff; border-radius: 12px;
  padding: 22px 18px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.18);
  text-align: center;
}
.mc-keep-card b {
  display: block; font-size: 16px; font-weight: 600; color: #191919; margin-bottom: 18px;
}
.mc-keep-actions { display: flex; gap: 10px; }
.mc-keep-discard, .mc-keep-save {
  flex: 1; height: 40px; border: 0; border-radius: 8px;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.mc-keep-discard { background: #f2f2f2; color: #191919; }
.mc-keep-discard:hover { background: #ebebeb; }
.mc-keep-save { background: #07c160; color: #fff; }
.mc-keep-save:hover { background: #06ad56; }

/* ============ 发现 ============ */
.discover-list { display: flex; flex-direction: column; gap: 6px; }
.discover-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 11px;
  padding: 12px 12px; font-size: 14px; text-align: left;
}
.discover-row:hover { background: var(--accent-soft); border-color: #bbd4fb; }
.discover-row .dc-ico { font-size: 18px; width: 28px; text-align: center; flex: none; }
.discover-row .dc-ico.dc-ico-svg {
  width: 30px; height: 30px; border-radius: 8px; background: #f3f4f8; color: #5b6478;
  display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.discover-row .dc-ico.dc-ico-svg svg { width: 20px; height: 20px; display: block; }
.discover-row b { flex: 1; font-weight: 500; }
.discover-row i { font-style: normal; color: var(--text-2); font-size: 15px; }

/* ============ 群聊管理 ============ */
.group-body { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow-y: auto; }
.grow {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--panel-2); border-radius: 11px; font-size: 13px; cursor: pointer;
}
.grow span { color: var(--text-2); font-size: 12px; width: 84px; flex: none; }
.grow b { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow i { font-style: normal; font-size: 12px; color: var(--accent); }
.gsec { font-size: 12px; color: var(--text-2); padding: 4px 2px; }
.gm-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px 6px; }
.gm { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.gm .avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 16px; }
.gm small { font-size: 10.5px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbtns { display: flex; gap: 10px; margin-top: 6px; }
.gbtns .btn { flex: 1; }
.gbtns .btn.danger { color: var(--danger); border-color: #f3c9d2; background: #fff5f7; }

.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 56vh; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pick-item:hover { background: var(--panel-2); }
.pick-item input { accent-color: var(--accent); }
.pick-item .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.pick-item .pinfo { display: flex; flex-direction: column; }
.pick-item b { font-size: 13px; }
.pick-item small { font-size: 11px; color: var(--text-2); }

/* ============ 群公告 / @成员 / 群文件 ============ */
.notice-bar {
  display: flex; align-items: flex-start; gap: 10px; margin: 10px 16px 0;
  background: #fff8e6; border: 1px solid #f3e2b3; border-radius: 10px;
  padding: 9px 12px; font-size: 12.5px; color: #7a5b12;
}
.notice-bar[hidden] { display: none; }
.notice-bar .nb-icon {
  flex: none; width: 24px; height: 24px; margin-top: 1px;
  color: #c48a1a; display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.notice-bar .nb-icon svg { width: 20px; height: 20px; display: block; }
.notice-bar .nb-text { flex: 1; line-height: 1.6; max-height: 38px; overflow: hidden; white-space: pre-wrap; }
.notice-bar.expanded .nb-text { max-height: 200px; overflow-y: auto; }
.notice-bar .nb-close { border: 0; background: transparent; color: #b08a3a; font-size: 16px; line-height: 1; }
.notice-bar .nb-more { border: 0; background: transparent; color: #b08a3a; font-size: 12px; }

.mention-pop {
  position: absolute; left: 16px; bottom: 108px; z-index: 30;
  width: 220px; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(20, 26, 45, .16); padding: 4px;
}
.mention-pop[hidden] { display: none; }
.mention-pop .mi { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.mention-pop .mi:hover { background: var(--panel-2); }
.mention-pop .mi .avatar { width: 24px; height: 24px; border-radius: 50%; font-size: 11px; }

.at-me { box-shadow: 0 0 0 2px rgba(244, 63, 94, .35); }
.msg .bubble .at { color: #1e78ed; font-weight: 600; }
.msg.self .bubble .at { color: #fff; font-weight: 600; text-decoration: underline; }

.file-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.file-tools .btn { flex: 1; }
.file-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; }
.file-item .fi { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); display: grid; place-items: center; font-size: 16px; }
.file-item .fmeta { flex: 1; min-width: 0; }
.file-item b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item small { font-size: 10.5px; color: var(--text-2); }
.file-item a { font-size: 12px; color: var(--accent); text-decoration: none; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.file-empty { text-align: center; color: var(--text-2); font-size: 12px; padding: 22px 8px; }

.file-card {
  display: flex; align-items: center; gap: 10px; width: 240px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff;
}
.file-card:hover { border-color: #bbd4fb; }
.file-card .fc-ico { font-size: 22px; }
.file-card .fc-meta { display: flex; flex-direction: column; min-width: 0; }
.file-card b { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card small { font-size: 11px; color: var(--text-2); }
.msg.self .file-card b { color: var(--text); }
.img-bubble { padding: 4px; background: #fff; border: 1px solid var(--line); position: relative; background-size: cover; background-position: center; }
.img-bubble .msg-img.defer { filter: blur(7px); transform: scale(1.02); cursor: pointer; }
.img-bubble .img-load { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.msg-img { max-width: 200px; max-height: 200px; border-radius: 8px; display: block; cursor: pointer; }

/* ============ 第三方服务（滴滴/美团等） ============ */
.svc-view {
  position: absolute; inset: 0; overflow-y: auto; padding: 22px 18px;
  background: linear-gradient(180deg, #f5f9ff, #f5f9ff);
}
.svc-view[hidden] { display: none; }
.svc-card {
  max-width: 340px; margin: 10px auto; background: #fff; border-radius: 16px; padding: 22px 18px;
  box-shadow: 0 14px 40px rgba(20, 26, 45, .1); text-align: center; display: flex;
  flex-direction: column; gap: 10px; align-items: center;
}
.svc-logo {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  font-size: 30px; background: color-mix(in srgb, var(--brand) 16%, #fff);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 25%, transparent);
}
.svc-card b { font-size: 17px; }
.svc-card p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.svc-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.svc-tags span { font-size: 10.5px; color: #6b7488; background: var(--panel-2); border-radius: 99px; padding: 2px 8px; }
.svc-btn {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px;
  padding: 11px; font-size: 13px; color: var(--text);
}
.svc-btn.primary { border: 0; color: #fff; background: var(--brand, #1e78ed); font-weight: 600; }
.svc-hint { font-size: 11px; color: #9aa2b5; margin: 6px 0 0; line-height: 1.6; }
.store-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.store-tab { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font-size: 12px; color: var(--text-2); }
.store-tab.active { background: var(--accent-soft); border-color: #bbd4fb; color: var(--accent); font-weight: 600; }
.store-item .kind { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: #e8f1fe; color: #1e78ed; margin-left: 6px; }
.store-item .kind.life { background: #fff0e6; color: #c2410c; }
.store-sec { font-size: 12px; color: var(--text-2); padding: 4px 2px 0; }

/* 小程序三栏：第二列选项 / 第三列内容（非弹框） */
.store-side-tabs { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 8px; }
.store-cat { width: 100%; border: 0; background: transparent; text-align: left; }
.store-cat.active { background: var(--accent-soft); color: var(--accent); }
.app.store-mode .side-search:has(#convSearch),
.app.store-mode #convSearch { display: none; }
.app.store-mode .tabs { display: none; }
.app.store-mode .me { display: none; }
.app.store-mode .brand-add { display: none; }
.store-side-sec { padding: 4px 0 8px; }
.store-side-label { font-size: 12px; color: var(--text-2); padding: 6px 12px 4px; }
.store-app-row {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: transparent; border-radius: 12px; padding: 8px 10px; cursor: pointer; color: var(--text);
}
.store-app-row:hover { background: var(--panel-2); }
.store-app-row.active { background: var(--accent-soft); }
.store-app-row .ico {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 18px; flex: none;
}
.store-app-row .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.store-app-row .meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-app-row .meta span { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.store-main,
#chatMain {
  grid-column: 3;
  grid-row: 1;
}
.store-main {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  display: none; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; position: relative;
}
.app.store-mode .store-main,
.app.moments-mode.discover-store .store-main { display: flex !important; }
.app.store-mode #chatMain { display: none !important; }
.app:not(.store-mode):not(.discover-store) .store-main { display: none !important; }
.app.store-mode #storeList { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }

/* 收藏三栏（对齐小程序栏） */
.app.fav-mode .side-search:has(#convSearch),
.app.fav-mode #convSearch { display: none; }
.app.fav-mode .tabs { display: none; }
.app.fav-mode .me { display: none; }
.app.fav-mode .brand-add { display: none; }
.app.fav-mode .sidebar-foot { display: none; }
.app.fav-mode #favSide { display: flex !important; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.app.fav-mode #favMain.fav-panel { display: flex !important; }
.app.fav-mode #chatMain,
.app.fav-mode .store-main { display: none !important; }
.app:not(.fav-mode) #favMain.fav-panel { display: none !important; }
.fav-side-write {
  display: flex; align-items: center; gap: 10px; margin: 0 8px 8px;
  border: 0; background: var(--panel-2); border-radius: 10px;
  padding: 11px 12px; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left;
  box-shadow: none;
}
.fav-side-write:hover { background: var(--accent-soft); color: var(--accent); }
.fav-side-write .fsw-ico { width: 22px; text-align: center; color: var(--accent); font-size: 15px; }
.fav-side-tabs {
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 6px 10px; flex: 1; min-height: 0; overflow: auto;
}
.fav-side-tabs .fav-cat {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; box-shadow: none;
  border-radius: 10px; padding: 11px 12px; margin: 0;
  text-align: left; color: var(--text); cursor: pointer;
}
.fav-side-tabs .fav-cat:hover { background: var(--panel-2); }
.fav-side-tabs .fav-cat.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.fav-side-tabs .fav-cat .c-title {
  flex: 1; font-size: 14px; font-weight: 500; line-height: 1.3;
}
.fav-side-tabs .fav-cat.active .c-title { font-weight: 600; }
.fav-side-tabs .fav-cat .c-count {
  font-size: 12px; color: var(--text-2); font-weight: 400; min-width: 1em; text-align: right;
}
.fav-side-tabs .fav-cat.active .c-count { color: var(--accent); opacity: .75; }
/* fav 图标井样式见上方统一 .c-ico / .fav-ico-svg */
.fav-side-foot {
  margin-top: auto; padding: 12px 16px 14px; font-size: 12px; color: var(--text-2);
  border-top: 1px solid var(--line); flex: none; letter-spacing: .2px;
}
.fav-panel {
  grid-column: 3; grid-row: 1;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  display: none; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
}
.fav-main-head {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex: none;
}
.fav-main-head b { font-size: 16px; }
.fav-main-head span { flex: 1; font-size: 12.5px; color: var(--text-2); }
.fav-main-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 18px; }
.fav-main-body .fav-list { padding: 0; }
.store-main-head {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.store-main-head b { font-size: 16px; }
.store-main-head span { font-size: 12.5px; color: var(--text-2); }
.store-main-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 18px; }
.store-empty {
  height: 100%; min-height: 240px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; color: var(--text-2);
}
.store-empty .ce-icon { font-size: 42px; opacity: .35; }
.store-empty .empty-illu { width: 140px; margin-bottom: 2px; }
.store-detail {
  max-width: 520px; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 10px;
}
.store-detail .row { display: flex; gap: 12px; align-items: center; }
.store-detail .ico {
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 26px;
}
.store-detail .perms { display: flex; flex-wrap: wrap; gap: 6px; }
.store-detail .perms code {
  font-size: 11px; background: var(--panel-2); border-radius: 6px; padding: 2px 7px; color: var(--text-2);
}
.store-runtime {
  flex: 1; min-height: 0; position: relative; display: none;
}
.store-runtime.on { display: block; }
/* 在小程序栏内打开时，运行面板铺满第三列 */
.app.store-mode .store-runtime.on .mp-panel,
.app.store-mode .mp-panel.docked {
  position: absolute; inset: 0; width: auto; top: 0; right: 0; bottom: 0; left: 0;
  transform: none; border-radius: 0; box-shadow: none; z-index: 2;
}
.app.store-mode .mp-panel.docked:not(.open) { display: none; }

.embed-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text-2); backdrop-filter: blur(4px);
}
.embed-bar[hidden] { display: none; }
.embed-bar span { flex: 1; }
.embed-bar button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 3px 8px; font-size: 11px; color: var(--accent); }
.mp-stage .embed-bar + iframe { padding-top: 0; }

/* ============ 拍一拍 ============ */
.msg.system .bubble.pat { color: #8a6d3b; }
#messages.shaking { animation: pat-shake .5s ease-in-out; }
@keyframes pat-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.msg.system .bubble.pat {
  background: transparent; border: 0; box-shadow: none; padding: 2px 6px;
  max-width: none; white-space: nowrap; color: #8a8f9c;
}

/* ============ 引用回复 ============ */
.quote-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  background: var(--panel-2); border-radius: 10px; padding: 7px 10px; font-size: 12px; color: var(--text-2);
}
.quote-bar[hidden] { display: none; }
.quote-bar .qb-icon {
  color: var(--accent); font-size: 14px; width: 18px; height: 18px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.quote-bar .qb-icon svg { width: 16px; height: 16px; display: block; }
.quote-bar .qb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar .qb-text b { color: var(--accent); margin-right: 4px; }
.quote-bar .qb-close { border: 0; background: transparent; font-size: 16px; color: var(--text-2); }
.quote-bubble { display: flex; flex-direction: column; gap: 6px; }
.quote-box {
  border-left: 3px solid #bbd4fb; background: rgba(255,255,255,.55); border-radius: 6px;
  padding: 5px 8px; font-size: 12px; color: #6b7488; max-width: 100%;
}
.msg.self .quote-box { background: rgba(255,255,255,.16); color: rgba(255,255,255,.85); border-left-color: rgba(255,255,255,.6); }
.quote-box b { margin-right: 4px; }
.quote-text { white-space: pre-wrap; word-break: break-word; }

/* ============ 消息搜索 ============ */
.search-input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; outline: none; margin-bottom: 8px;
}
.search-scope { font-size: 12px; color: var(--text-2); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.search-results { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.search-item { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.search-item:hover { background: var(--panel-2); }
.search-item .si-top { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); align-items: baseline; }
.search-item .si-top b { color: var(--text); }
.search-item .si-top time { margin-left: auto; font-size: 11px; }
.search-item .si-txt { font-size: 12.5px; margin-top: 3px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.flash { animation: msg-flash 1.6s ease; }
@keyframes msg-flash {
  0%, 100% { background: transparent; }
  30% { background: #fff6d8; border-radius: 10px; }
}

/* ============ 免打扰 ============ */
.conv-top .mute { font-size: 11px; color: #b6bccb; margin-left: 4px; }
.conv-bottom .dot { width: 7px; height: 7px; border-radius: 50%; background: #c3c8d4; display: inline-block; margin-left: 6px; }
.conv-top .mute { font-size: 10px; color: #a9b0bf; border: 1px solid #d8dce6; border-radius: 4px; padding: 0 3px; margin-left: 6px; line-height: 15px; }

/* ============ 来电铃声 ============ */
.ring-list { display: flex; flex-direction: column; gap: 6px; }
.ring-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ring-item:hover { background: var(--panel-2); }
.ring-item.active { border-color: #bbd4fb; background: var(--accent-soft); }
.ring-item .ri-main { flex: 1; min-width: 0; }
.ring-item b { font-size: 13px; display: block; }
.ring-item small { font-size: 11px; color: var(--text-2); }
.ring-item .ri-play { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--accent); }
.ring-item .ri-check { color: var(--accent); font-weight: 700; }
.ring-hint { font-size: 11px; color: #9aa2b5; margin: 10px 0 0; }

/* ============ 群聊列表 / 群号 ============ */
.group-sec-title { font-size: 12px; color: var(--text-2); padding: 12px 4px 6px; }
.group-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.group-row:hover { background: var(--panel-2); }
.group-row .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.group-row .gm-main { flex: 1; min-width: 0; }
.group-row b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row small { font-size: 10.5px; color: var(--text-2); }
.join-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.join-card b { font-size: 14px; }
.join-card p { font-size: 12px; color: var(--text-2); margin: 4px 0 10px; }
.join-card .btn { width: 100%; }

/* ============ 我的二维码 / 添加好友 ============ */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; }
.qr-box img { width: 240px; height: 240px; border-radius: 12px; background: #fff; }
.qr-box b { font-size: 15px; }
.qr-box small { color: var(--text-2); font-size: 12px; }
.add-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.add-card .avatar { width: 42px; height: 42px; border-radius: 50%; font-size: 16px; }
.add-card .ac-main { flex: 1; min-width: 0; }
.add-card b { font-size: 14px; display: block; }
.add-card small { color: var(--text-2); font-size: 12px; }
.add-card .btn { flex: none; }

/* ============ 扫一扫 / 群二维码 ============ */
.scan-area { position: relative; width: 100%; aspect-ratio: 1 / 1; background: #0f1220; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.scan-area video { width: 100%; height: 100%; object-fit: cover; }
.scan-hint { position: absolute; inset: auto 12px 12px; text-align: center; color: #cfd4e6; font-size: 12px; background: rgba(0,0,0,.45); border-radius: 8px; padding: 6px; }
.card-share { display: flex; align-items: center; gap: 10px; width: 220px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.card-share .avatar { width: 38px; height: 38px; border-radius: 8px; font-size: 15px; }
.card-share .cs-main { flex: 1; min-width: 0; }
.card-share b { display: block; font-size: 13px; }
.card-share small { font-size: 11px; color: var(--text-2); }
.card-share .btn { padding: 4px 8px; font-size: 11px; }

/* ============ 弱网：发送状态 / 网络横幅 ============ */
.net-banner {
  margin: 8px 16px 0; padding: 7px 10px; border-radius: 9px; font-size: 12px;
  background: #fff4e5; color: #a15c00; border: 1px solid #f3dbb8;
  display: flex; align-items: center; gap: 8px;
}
.net-banner[hidden] { display: none; }
.net-banner .net-ico {
  width: 18px; height: 18px; flex: none; color: #c48a1a; line-height: 0;
}
.net-banner .net-ico svg { width: 18px; height: 18px; display: block; }
.msg-state { font-size: 10.5px; color: var(--text-2); margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }
.msg.self .msg-state { text-align: right; justify-content: flex-end; }
.msg-state.failed { color: #e5484d; cursor: pointer; font-weight: 600; }
.msg-state.sending::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid #c3c8d4; border-top-color: var(--accent);
  display: inline-block; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 分片上传进度 ============ */
.upload-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); padding: 0 2px 8px; }
.upload-bar[hidden] { display: none; }
.upload-bar #uploadName { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-track { flex: 1; height: 4px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.ub-track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ============ 视频消息 ============ */
.video-bubble { padding: 4px; background: #fff; border: 1px solid var(--line); }
.msg-video { max-width: 260px; max-height: 220px; border-radius: 8px; display: block; background: #000; }

/* ============ 已读回执 ============ */
.msg-receipt { font-size: 10px; color: #9aa2b5; margin-top: 2px; text-align: right; display: block; }

/* i18n：用户信息行的按钮不换行 */
.me { flex-wrap: nowrap; }
.me .icon-btn.text { white-space: nowrap; font-size: 12px; padding: 2px 6px; }

/* 语言菜单 */
.lang-menu { position: fixed; top: 58px; right: 18px; z-index: 9999; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(20,26,45,.16); padding: 6px; min-width: 148px; }
.lang-menu a { display: block; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.lang-menu a:hover { background: var(--panel-2); }
.lang-menu a.on { color: var(--accent); font-weight: 600; }

/* 头像图片 */
.avatar.img { background-size: cover !important; background-position: center !important; background-repeat: no-repeat; color: transparent; }
#meAvatar { cursor: pointer; }

/* 群头像 */
.g-avatar { display: flex; justify-content: center; padding: 4px 0 6px; }
.g-avatar .avatar { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; cursor: pointer; }
.g-avatar .avatar.img { border-radius: 18px; color: transparent; }

/* 头像大图 */
.lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(10,12,20,.88);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 40px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(80vw, 560px); max-height: 80vh; border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); background: #fff; }

/* ============ 微信风格：左侧图标栏 + 空状态 ============ */
.app { grid-template-columns: 56px 300px minmax(0, 1fr); gap: 12px; }
.rail {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  background: var(--panel); border-radius: 18px; padding: 14px 0 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.rail-avatar-wrap { display: flex; justify-content: center; }
.rail-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; cursor: pointer; margin-bottom: 10px; }
.rail-btn {
  position: relative;
  width: 100%; height: 40px; border: 0; background: transparent;
  border-radius: 0; margin: 0; padding: 0;
  font-size: 18px; color: var(--text-2); cursor: pointer;
  /* 图标相对整栏居中，不受选中块偏移影响 */
  display: grid; place-items: center;
}
.rail-btn .rail-ico { width: 24px; height: 24px; display: block; position: relative; z-index: 1; overflow: visible; }
.rail-btn .rail-ico-chat,
.rail-btn .rail-ico-friend,
.rail-btn .rail-ico-mp,
.rail-btn .rail-ico-fav,
.rail-btn .rail-ico-moments,
.rail-btn .rail-ico-call,
.rail-btn .rail-ico-me { width: 28px; height: 28px; }
.rail-btn > * { position: relative; z-index: 1; }
/* 侧栏图标：选中填色 / 未选中灰色描边 */
.rail-btn .rail-ico .ico-on { display: none; }
.rail-btn .rail-ico .ico-off { display: inline; }
.rail-btn.active .rail-ico .ico-on { display: inline; }
.rail-btn.active .rail-ico .ico-off { display: none; }
/* 背景块：贴右、左圆角（如图），图标仍居中 */
.rail-btn::before {
  content: "";
  position: absolute;
  inset: 0 0 0 8px;
  border-radius: 12px 0 0 12px;
  background: transparent;
  z-index: 0;
  pointer-events: none;
}
.rail-btn:hover::before { background: var(--panel-2); }
.rail-btn.active::before { background: var(--accent-soft); }
.rail-btn:hover,
.rail-btn.active { background: transparent; }
.rail-spacer { flex: 1; }
.tabs { display: none; }
.sidebar-foot { display: none; }

.chat.no-chat .chat-head,
.chat.no-chat .composer,
.chat.no-chat .notice-bar,
.chat.no-chat .net-banner,
.chat.no-chat .messages { display: none !important; }
.chat-empty { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-2); }
.chat.no-chat .chat-empty { display: flex; }
.chat-empty .ce-icon { font-size: 46px; opacity: .35; }
.chat-empty .empty-illu { width: 148px; }
.chat-empty p { font-size: 13px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 0; gap: 0; height: 100dvh; }
  .rail { display: none; }
  .chat.no-chat .chat-empty { display: flex; }
}

/* 会话搜索：与会话列表左右对齐 */
.side-search {
  padding: 0 var(--side-pad-x, 12px) 10px;
  width: 100%;
  box-sizing: border-box;
  flex: none;
}
.side-search input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 9px; padding: 7px 10px; font-size: 12.5px; outline: none;
}
.side-search input:focus { border-color: #bbd4fb; background: #fff; }

/* ============ 通讯录折叠 / 加号面板 ============ */
.contact-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 10px; }
.contact-head b { font-size: 15px; }
.c-sec { display: flex; align-items: center; gap: 8px; padding: 11px 6px; cursor: pointer; border-radius: 8px; }
.c-sec:hover { background: var(--panel-2); }
.c-sec .chev { color: #b6bccb; font-size: 14px; transition: transform .18s ease; width: 12px; }
.c-sec.open .chev { transform: rotate(90deg); }
.c-sec .c-title { flex: 1; font-size: 13.5px; font-weight: 600; }
.c-sec .c-count { font-size: 12px; color: var(--text-2); }
.c-body { padding-left: 6px; }
.c-body[hidden] { display: none; }

.voice-btn {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: #eff5fe; color: #6b7085; font-size: 18px; line-height: 1; cursor: pointer;
  touch-action: none; user-select: none;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.voice-btn svg { width: 20px; height: 20px; display: block; }
.voice-btn.recording { background: var(--accent); color: #fff; }
.voice-btn.cancel { background: #e11d48; color: #fff; }
.plus-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer;
}
.plus-btn:hover { border-color: #bbd4fb; color: var(--accent); }
.plus-panel {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 12px 30px rgba(20,26,45,.08);
}
.plus-panel[hidden] { display: none; }
.pp-item { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 4px; border-radius: 10px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.pp-item:hover { background: var(--panel-2); }
.pp-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; font-size: 18px; color: #5b6478; }
.pp-ico.pp-ico-svg svg { width: 22px; height: 22px; display: block; }

.conv-top .pin { font-size: 10px; margin-left: 6px; }

/* 头像编辑入口 */
.rail-avatar-wrap { position: relative; margin-bottom: 10px; }
.rail-avatar-wrap .rail-avatar { margin-bottom: 0; }
.av-edit {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid #fff; background: var(--accent); color: #fff; font-size: 12px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.g-avatar { position: relative; }
.g-av-edit {
  border: 1px solid var(--line); background: #fff; color: var(--accent); border-radius: 99px;
  font-size: 11px; padding: 3px 10px; margin-left: 10px; cursor: pointer;
}

/* hidden 属性优先（避免 display 覆盖导致元素仍然可见） */
[hidden] { display: none !important; }

.g-av-tip { font-size: 11px; color: var(--text-2); margin-left: 8px; }

.g-notice { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.g-notice b { font-size: 13px; color: #b45309; }
.g-notice small { color: #b45309; opacity: .8; font-size: 12px; }
.g-notice .btn { align-self: flex-start; padding: 5px 14px; font-size: 12px; }

/* ================= 2026 UI 打磨：控件去标准化 ================= */
:root {
  --ctl-border: #e3f0e8;
  --ctl-border-hover: #c9e3d4;
  --ring: 0 0 0 3px rgba(30, 120, 237, .14);
  --ctl-shadow: 0 1px 2px rgba(20, 26, 45, .04);
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea,
select {
  background: #fff;
  border: 1px solid var(--ctl-border);
  border-radius: 11px;
  padding: 9px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  box-shadow: var(--ctl-shadow);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder { color: #8790a3; }
input:hover, textarea:hover, select:hover { border-color: var(--ctl-border-hover); }
input:focus, textarea:focus, select:focus {
  border-color: #a9a4f2;
  box-shadow: var(--ring);
}

.btn {
  border-radius: 11px;
  padding: 9px 16px;
  font-weight: 600;
  border: 1px solid var(--ctl-border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--ctl-shadow);
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { border-color: var(--ctl-border-hover); box-shadow: 0 4px 12px rgba(20, 26, 45, .07); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary {
  background: linear-gradient(135deg, #0cae5c, #1e78ed);
  border: 0;
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 120, 237, .28);
}
.btn.primary:hover { box-shadow: 0 10px 24px rgba(30, 120, 237, .34); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.go { background: #eef7f0; color: #24884b; border-color: #d9ecdf; }

.send {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #0cae5c, #1e78ed);
  box-shadow: 0 8px 18px rgba(30, 120, 237, .28);
  transition: transform .12s ease, box-shadow .16s ease;
}
.send:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(30, 120, 237, .34); }
.send:active { transform: scale(.98); }

.plus-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: #eff5fe;
  color: #6b7085;
  transition: background .16s ease, color .16s ease, transform .12s ease;
}
.plus-btn:hover { background: #e8e6ff; color: var(--accent); transform: translateY(-1px); }

.dial-entry {
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid #eceef7;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: var(--ctl-shadow);
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.dial-entry:hover { background: #eff5fe; border-color: #c9efda; transform: translateY(-1px); }

.side-search input {
  border: 1px solid transparent;
  background: #f4f5fb;
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.side-search input:focus { background: #fff; border-color: #cfe9d9; box-shadow: var(--ring); }

#input {
  border: 1px solid var(--ctl-border);
  background: #f5f9ff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 2px rgba(20, 26, 45, .03);
}
#input:focus { background: #fff; border-color: #bbd4fb; box-shadow: var(--ring); }

#promptInput, #dialInput { border-radius: 12px; }

.req-item .ok, .req-item .no {
  border-radius: 9px;
  padding: 6px 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}
.req-item .ok { background: #e9f8ef; color: #1f8a49; }
.req-item .ok:hover { background: #dcf3e6; }
.req-item .no { background: #fdeef0; color: #c2405a; }
.req-item .no:hover { background: #fbdfe4; }

.icon-btn.text { border-radius: 8px; }

/* 群管理行的操作按钮 & 布局 */
.grow { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: #f5f9ff; margin-bottom: 8px; }
.grow span { flex: none; width: 88px; font-size: 12px; color: var(--text-2); line-height: 1.35; }
.grow b { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow i {
  flex: none; font-style: normal; font-size: 12px; font-weight: 600; color: var(--accent);
  background: #e8f1fe; border-radius: 999px; padding: 4px 11px; cursor: pointer;
  transition: background .15s ease;
}
.grow i:hover { background: #e8f1fe; }
.g-av-edit { border: 0; background: #e8f1fe; color: var(--accent); font-weight: 600; }
.g-av-edit:hover { background: #e8f1fe; }
.icon-btn.close { font-size: 17px; color: var(--text-2); }
.icon-btn.close:hover { background: #eff5fe; color: var(--text); }

/* 系统通知 */
.notif-entry { background: #fffaf0; border-color: #fde8c8; }
.notif-entry:hover { background: #fff5e3; }
.notif-entry .notif-av {
  background: linear-gradient(140deg, #f59e0b, #f97316) !important;
  color: #fff;
}
.notif-entry .notif-av svg { width: 20px; height: 20px; display: block; }

.btn .btn-ico {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  margin-right: 4px; vertical-align: -2px; line-height: 0;
}
.btn .btn-ico svg { width: 16px; height: 16px; display: block; }
.notif-item { padding: 12px; border-radius: 12px; background: #f5f9ff; margin-bottom: 8px; }
.notif-item b { font-size: 13px; }
.notif-item p { margin: 4px 0 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.notif-item small { font-size: 11px; color: #a3a9bb; }

/* 系统通知卡片 */
#notifList { display: flex; flex-direction: column; gap: 8px; }
.noti-card {
  display: flex; gap: 12px; align-items: flex-start; position: relative;
  padding: 12px; border-radius: 14px; background: #fff;
  border: 1px solid var(--ctl-border); cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.noti-card:hover { background: #f5f9ff; border-color: #c9efda; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,26,45,.06); }
.noti-card.unread { background: #eff5fe; border-color: #e8f1fe; }
.noti-ico {
  width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, #e8f1fe, #e8f1fe); font-size: 18px;
}
.noti-main { flex: 1; min-width: 0; }
.noti-main b { display: block; font-size: 13.5px; font-weight: 650; color: var(--text); }
.noti-main p { margin: 3px 0 4px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.noti-main small { font-size: 11px; color: #a3a9bb; }
.noti-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: absolute; right: 12px; top: 12px; }

/* 通知详情 */
.noti-back { border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; padding: 4px 0 12px; cursor: pointer; }
.noti-detail-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(140deg,#e8f1fe,#e8f1fe); margin: 4px auto 12px; }
.noti-detail-title { text-align: center; font-size: 15px; font-weight: 650; }
.noti-detail-body { margin: 10px 0 6px; padding: 12px; border-radius: 12px; background: #f5f9ff; font-size: 13px; line-height: 1.6; color: var(--text-2); word-break: break-word; }
.noti-detail-time { text-align: center; font-size: 12px; color: #a3a9bb; margin-bottom: 16px; }
.noti-action { width: 100%; }

/* 通知记录 */
.hist-row { position: relative; overflow: hidden; border-radius: 12px; margin-bottom: 8px; background: #fdeff1; }
.hist-inner {
  position: relative; display: flex; gap: 10px; align-items: flex-start; background: #fff;
  border: 1px solid var(--ctl-border); border-radius: 12px; padding: 10px 12px;
  touch-action: pan-y; will-change: transform;
}
.hist-swipe-hint { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #c2405a; font-weight: 600; }
.hist-main { flex: 1; min-width: 0; }
.hist-main b { display: block; font-size: 13px; }
.hist-main p { margin: 2px 0 3px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main small { font-size: 11px; color: #a3a9bb; }
.hist-check { margin-top: 12px; accent-color: var(--accent); width: 16px; height: 16px; }
.hist-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-top: 8px; background: #fff; border-top: 1px solid var(--line);
}
.hist-all { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.hist-count { flex: 1; font-size: 12px; color: var(--text-2); }
.btn.danger { background: #fdeef0; color: #c2405a; border-color: #d9f2e3; box-shadow: none; }
.btn.danger:hover { background: #fbdfe4; }

.noti-empty { text-align: center; padding: 28px 12px; color: var(--text-2); }
.noti-empty .ne-ico { font-size: 34px; opacity: .35; margin-bottom: 8px; }
.noti-empty p { margin: 0 0 12px; font-size: 13px; }

/* 通讯录：通知记录入口 */
.c-sec.c-link { cursor: pointer; }
.c-sec.c-link .c-title { font-weight: 600; }

/* 通话入口：线框图标 */
.dial-entry {
  display: flex; align-items: center; gap: 10px;
}
.dial-entry .dial-ico {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f8; color: #5b6478; line-height: 0;
}
.dial-entry .dial-ico svg { width: 20px; height: 20px; display: block; }
.dial-entry .dial-ico.dial-ring { color: #7c5cbf; background: #f1ebff; }
.dial-entry .dial-ico.dial-call { color: #3B7FE8; background: #e8f1fe; }

/* 游戏排行榜 */
.rank-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.rank-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.rank-tab.on { background: var(--accent-soft); border-color: #c9c6ff; color: var(--accent); font-weight: 600; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; background: #fff; }
.rank-row.me { background: #eff5fe; border-color: #e8f1fe; }
.rk-medal { width: 24px; text-align: center; font-size: 16px; flex: none; }
.rk-no { font-size: 12px; color: var(--text-2); font-weight: 600; }
.rk-main { flex: 1; min-width: 0; }
.rk-main b { display: block; font-size: 13px; }
.rk-main small { font-size: 11px; color: var(--text-2); }
.rk-score { font-size: 16px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.rank-foot { text-align: center; font-size: 12px; color: var(--text-2); padding: 8px 0; }

/* 弱网模式提示 */
body.weak-net #netBanner { background: #fff8ea; border-color: #ffe2b8; color: #8a5a00; }
#netBanner[data-level="offline"] { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }

/* 渐进式图片：先模糊缩略图，再淡入清晰图 */
.msg-img { transition: filter .28s ease; }
.msg-img.progressive { filter: blur(12px); transform: scale(1.02); }

/* 分片进度 */
.ub-chunks { display: flex; gap: 2px; flex: 1; min-width: 0; height: 6px; }
.ub-chunk { flex: 1; height: 6px; border-radius: 2px; background: #e9ecf6; transition: background .15s ease; }
.ub-chunk.done { background: var(--accent); }
.ub-chunk.active { background: #b9b4ff; animation: ubpulse 1s infinite ease-in-out; }
@keyframes ubpulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* 表情面板 */
.emoji-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 18px; cursor: pointer; flex: 0 0 auto; color: #6b7085; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.emoji-btn svg { width: 22px; height: 22px; display: block; }
.emoji-btn:hover { background: var(--panel-2); }
.emoji-btn.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(79,110,255,.15); color: var(--accent); }
.emoji-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; box-shadow: 0 12px 30px rgba(20,26,45,.1); }
.emoji-panel[hidden] { display: none; }
.ep-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ep-tabs { display: flex; gap: 4px; flex: 0 0 auto; }
.ep-tab { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.ep-tab.active { background: var(--panel-2); color: var(--text); font-weight: 700; }
.ep-search { flex: 1; min-width: 80px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 12px; outline: none; }
.ep-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; max-height: 216px; overflow-y: auto; padding: 2px; }
.ep-cell { border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.ep-cell:hover { background: var(--panel-2); }
.ep-empty { grid-column: 1 / -1; padding: 18px; text-align: center; color: var(--text-2); font-size: 12.5px; }
.ep-make { display: flex; flex-direction: column; gap: 8px; }
.ep-make[hidden] { display: none; }
.em-row { display: flex; align-items: center; gap: 10px; }
.em-preview { width: 74px; height: 74px; border-radius: 14px; background: linear-gradient(140deg,#f4f6ff,#e8ecff); display: grid; place-items: center; font-size: 40px; border: 1px solid var(--line); }
.em-text { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 13px; outline: none; }
.em-caps { display: flex; flex-wrap: wrap; gap: 6px; }
.em-caps button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.em-caps button:hover { border-color: var(--accent); color: var(--accent); }
.em-actions { display: flex; align-items: center; gap: 10px; }
.em-actions #emSend { border: 0; border-radius: 10px; padding: 9px 18px; background: linear-gradient(180deg,#5b8bff,#3d6bff); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.em-hint { font-size: 12px; color: var(--text-2); }

/* 拖拽发送提示 */
.drop-hint { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(79,110,255,.10); backdrop-filter: blur(2px); border: 2px dashed rgba(79,110,255,.55); border-radius: 14px; pointer-events: none; }
.drop-hint[hidden] { display: none; }
.drop-hint .dh-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 28px;
  background: #fff; border-radius: 16px; box-shadow: 0 18px 40px rgba(20,30,70,.18); color: var(--text); }
.drop-hint .dh-box span { font-size: 30px; }
.drop-hint .dh-box b { font-size: 14px; }
.drop-hint .dh-box small { font-size: 12px; color: var(--text-2); }
.chat { position: relative; }


/* ================= 移动端 / 原生壳优化 ================= */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
.app { height: 100dvh; }

/* 刘海屏安全区 */
.composer { padding-bottom: calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))); }
.chat-head { padding-top: calc(14px + var(--safe-top, env(safe-area-inset-top, 0px))); }
.mp-panel { padding-top: var(--safe-top, env(safe-area-inset-top, 0px)); }

/* 触控目标 & iOS 输入缩放（<16px 会触发自动放大） */
@media (pointer: coarse) {
  .rail-btn, .icon-btn, .plus-btn, .emoji-btn, .send, .btn { min-height: 44px; }
  .rail-btn, .icon-btn, .plus-btn, .emoji-btn { min-width: 44px; }
  #input, .side-search input, .login-form input { font-size: 16px; }
}
@media (max-width: 760px) {
  .messages { padding: 14px 12px 6px; gap: 12px; }
  .msg { max-width: 88%; }
  .composer { padding-left: 10px; padding-right: 10px; }
  .chat-head { padding-left: 14px; padding-right: 14px; }
  .mp-panel { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .login-mask { backdrop-filter: none; }
  .toast { max-width: 86vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* 键盘可达性 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* 回到底部 */
.jump-bottom { position: absolute; right: 18px; bottom: 96px; z-index: 30; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); border-radius: 999px; min-width: 42px; height: 38px; padding: 0 12px;
  font-size: 13px; font-weight: 700; box-shadow: 0 10px 24px rgba(20,26,45,.16); display: inline-flex; align-items: center; gap: 4px; }
.jump-bottom[hidden] { display: none; }
.jump-bottom span:empty { display: none; }

/* 原生壳（iOS/Android WebView）下的细节 */
html.native-shell body { overscroll-behavior: none; }
html.native-shell .login-mask { backdrop-filter: none; }
html.native-shell .app { padding-top: var(--safe-top, env(safe-area-inset-top, 0px)); }

/* 消息骨架屏 */
.msg-skel { display: flex; gap: 10px; align-items: flex-start; max-width: 76%; }
.msg-skel.self { align-self: flex-end; flex-direction: row-reverse; }
.sk-avatar { width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(90deg, #e8f1fe 25%, #f5f9ff 37%, #e8f1fe 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.3s ease infinite; }
.sk-bubble { height: 38px; border-radius: 4px 12px 12px 12px;
  background: linear-gradient(90deg, #e8f1fe 25%, #f5f9ff 37%, #e8f1fe 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.3s ease infinite; }
.msg-skel.self .sk-bubble { border-radius: 12px 4px 12px 12px; }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ================= 手机端：会话列表 / 聊天 双视图 ================= */
.mobile-back { display: none; border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 0 6px 0 0; color: var(--accent); }
@media (max-width: 860px) {
  .app { position: relative; overflow: hidden; display: block; height: 100dvh; }
  .app .sidebar { display: flex; position: absolute; inset: 0; z-index: 25; border-radius: 0; box-shadow: none; }
  .app .chat { display: none; height: 100dvh; border-radius: 0; box-shadow: none; }
  .app.mobile-chat .sidebar { display: none; }
  .app.mobile-chat .chat { display: flex; }
  .mobile-back { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; }
}

/* 手机端底部导航：会话 / 通讯录 / 通话 / 发现 */
.mobile-nav { display: none; }
@media (max-width: 860px) {
  .mobile-nav {
    flex: none; display: flex; align-items: stretch; gap: 4px;
    border-top: 1px solid var(--line); background: #fff;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .mnav {
    flex: 1; position: relative; border: 0; background: transparent; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; font-size: 11px; color: var(--text-2);
  }
  .mnav span { font-size: 19px; line-height: 1; }
  .mnav b { font-weight: 500; }
  .mnav.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .mnav.active b { font-weight: 600; }
  .mnav-badge {
    position: absolute; top: 2px; left: 50%; margin-left: 2px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
    background: var(--danger); color: #fff; font-size: 10px; font-style: normal; line-height: 16px; text-align: center;
  }
  .mnav-badge[hidden] { display: none; }
}

/* ================= 我：独立整页 ================= */
.me-page[hidden] { display: none; }
.me-page {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
}
.me-page-head {
  display: flex; align-items: center; gap: 4px; flex: none;
  padding: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px))) 14px 12px;
  border-bottom: 1px solid var(--line);
}
.me-page-head b { font-size: 16px; }
.me-page-body { flex: 1; overflow-y: auto; padding: 18px 0 24px; }

.me-profile {
  display: flex; align-items: center; gap: 14px; width: calc(100% - 32px);
  margin: 0 16px 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel-2); text-align: left; cursor: pointer;
}
.me-profile:hover { border-color: #bbd4fb; }
.me-page-avatar { width: 54px; height: 54px; border-radius: 14px; font-size: 20px; cursor: pointer; flex: none; }
.me-profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.35; }
.me-profile-info b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-profile-info span { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chev { color: #b6bccb; font-size: 16px; flex: none; }

.me-group {
  margin: 0 16px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
/* 桌面端专属设置项：仅 Electron 壳显示，浏览器 Web 端隐藏 */
.desktop-only { display: none; }
html.desktop-shell .desktop-only { display: block; }
.me-cell {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 16px; border: 0; border-top: 1px solid var(--line);
  background: transparent; font-size: 14px; color: var(--text); text-align: left; cursor: pointer;
}
.me-cell:first-child { border-top: 0; }
.me-cell:hover { background: var(--panel-2); }
.me-ico { width: 22px; text-align: center; font-size: 15px; flex: none; color: #5b6478; }
.me-ico.me-ico-svg {
  width: 28px; height: 28px; border-radius: 7px; background: #f3f4f8;
  display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.me-ico.me-ico-svg svg { width: 20px; height: 20px; display: block; }
.me-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-cell .me-val { font-size: 12.5px; color: var(--text-2); flex: none; }
.me-cell.danger, .me-cell.danger .me-ico { color: var(--danger); }
.me-page-nav { display: none; flex: none; border-top: 1px solid var(--line); background: var(--panel); padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); }
.me-page-nav .mnav { flex: 1; }
.me-foot { margin: 18px 16px 0; text-align: center; font-size: 11.5px; color: #b6bccb; }

/* 设置页：只读行（微信号）/ 头像行 / 头部右侧按钮 */
.me-cell.readonly { cursor: default; }
.me-cell.readonly:hover { background: transparent; }
.me-cell.readonly .me-val { color: var(--text-2); }
.avatar.me-set-avatar { width: 34px; height: 34px; border-radius: 8px; font-size: 13px; }
.me-head-gap { flex: 1; }
.me-page-head .icon-btn { width: 30px; height: 30px; font-size: 18px; }
/* 二级页在桌面也显示返回按钮 */
#settingsPage .me-page-head .mobile-back,
#momentsPage .me-page-head .mobile-back,
#favPage .me-page-head .mobile-back { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; }

/* 我的朋友圈（个人相册） */
.my-moments-cover {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 6px; padding: 14px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.my-moments-cover .avatar { width: 48px; height: 48px; border-radius: 10px; font-size: 17px; flex: none; }
.my-moments-cover b { font-size: 15px; }
.my-moments-list { padding: 0 16px; }
.my-moments-list .moment { padding: 12px 2px; }
.my-moments-foot { display: flex; justify-content: center; padding: 6px 16px 0; }

/* ================= 收藏页 ================= */
.fav-search { padding: 10px 16px 6px; flex: none; }
.fav-search input {
  width: 100%; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 9px; padding: 8px 12px; font-size: 13px; outline: none;
}
.fav-search input:focus { border-color: #bbd4fb; background: #fff; }
.fav-tabs { display: flex; gap: 6px; padding: 4px 16px 10px; flex: none; overflow-x: auto; }
.fav-tab {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 5px 13px; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.fav-tab:hover { border-color: #bbd4fb; }
.fav-tab.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.fav-list { flex: 1; overflow-y: auto; padding: 0 16px 24px; }
.fav-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer;
}
.fav-item:hover { border-color: #bbd4fb; background: var(--panel-2); }
.fav-thumb { width: 46px; height: 46px; flex: none; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.fav-ico {
  width: 46px; height: 46px; flex: none; border-radius: 8px; background: #f3f4f8;
  display: grid; place-items: center; font-size: 20px; color: #5b6478;
}
.fav-ico.fav-ico-svg svg { width: 22px; height: 22px; display: block; }
.fav-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fav-item-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-sub { font-size: 12px; color: var(--text-2); line-height: 1.45; max-height: 2.9em; overflow: hidden; word-break: break-all; }
.fav-meta { font-size: 11px; color: #b6bccb; }

/* 收藏详情 */
.fav-detail { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.fav-detail-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fav-detail-imgs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--panel-2); }
.fav-detail-link b { display: block; font-size: 14px; margin-bottom: 4px; }
.fav-detail-link a { font-size: 12.5px; color: var(--accent); word-break: break-all; }
.fav-detail-from { font-size: 12px; color: var(--text-2); font-weight: 600; }
.fav-detail-text { font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.fav-detail-time { font-size: 11.5px; color: #b6bccb; }

/* 侧栏「我」区块：只留头像和昵称，整块可点 */
.me { cursor: pointer; min-height: 54px; }
.me:hover { background: #e9edf8; }
/* 侧栏 tab 上的「我」入口 */
.tab.me-tab { margin-left: auto; flex: none; padding-left: 10px; padding-right: 10px; }

/* 桌面：占用聊天区列，隐藏聊天面板 */
@media (min-width: 861px) {
  .app.me-open .chat { display: none; }
}
/* 手机：整页覆盖侧栏 */
@media (max-width: 860px) {
  .app.me-open .sidebar { display: none; }
  .app.me-open .chat { display: none; }
  .app .me-page {
    position: absolute; inset: 0; z-index: 26; border-radius: 0; box-shadow: none;
    display: flex;
  }
  .app .me-page[hidden] { display: none; }
  .app:not(.me-open) .me-page { display: none; }
  .me-page-head { display: flex; }
  .me-page-nav { display: flex; }
  .me-page-body { padding-bottom: 24px; }
}

/* 语音气泡（原生端发送的语音，点击播放） */
.voice-bubble { cursor: pointer; min-width: 84px; user-select: none; transition: opacity .15s; }
.voice-bubble:active { opacity: .8; }
.voice-bubble.playing { box-shadow: inset 0 0 0 2px rgba(30,120,237,.45); animation: voicePulse .9s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* 语音转文字 */
.voice-asr {
  display: inline-block; margin-left: 6px; padding: 0 4px;
  border-radius: 3px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.10); cursor: pointer; user-select: none;
}
.msg.self .voice-asr { background: rgba(255,255,255,.25); }
.voice-asr:hover { background: rgba(30,120,237,.18); }
.asr-text {
  margin-top: 4px; max-width: 260px; font-size: 12px; line-height: 1.5;
  color: var(--text-2); background: rgba(127,127,127,.10);
  padding: 6px 8px; border-radius: 6px; white-space: pre-wrap;
}

/* 大屏：输入栏与消息区居中收窄，避免横屏/桌面下一行拉太宽 */
@media (min-width: 1000px) {
  .composer { max-width: 900px; margin: 0 auto; width: 100%; }
  .messages { padding-left: max(16px, calc((100% - 900px) / 2)); padding-right: max(16px, calc((100% - 900px) / 2)); }
}
