/* ============================================================
   Talko v6 — iOS-grade design system. Original work, no assets.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --accent: #00a795;
  --accent-2: #00c2b8;
  --accent-deep: #008a7d;
  --accent-soft: rgba(0, 194, 184, .13);
  --accent-grad: linear-gradient(135deg, #00c2b8, #0089a0);
  --bg: #f3f4f8;
  --card: #ffffff;
  --text: #101418;
  --text-2: #8a939c;
  --line: rgba(60, 70, 80, .09);
  --danger: #ff3b30;
  --bubble-in: #ffffff;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-float: 0 10px 34px rgba(0, 60, 70, .22);
  --r-lg: 18px; --r-md: 13px; --r-sm: 10px;
  --nav-h: 48px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "SF Pro SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
::-webkit-scrollbar { width: 0; height: 0; }
img.avatar { object-fit: cover; }

/* ================= nav (large title) ================= */
.nav { padding: 10px 18px 4px; background: transparent; position: sticky; top: 0; z-index: 6;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
.nav-row { height: 40px; display: flex; align-items: center; gap: 14px; }
.nav-brand { font-size: 19px; font-weight: 800; letter-spacing: .4px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-flex { flex: 1; }
.nav-large { font-size: 30px; font-weight: 800; letter-spacing: .3px; padding: 2px 0 10px; }
.nav-btn { border: none; background: rgba(120,130,140,.1); width: 34px; height: 34px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; transition: transform .14s; }
.nav-btn:active { transform: scale(.86); }
.nav-btn span { display: flex; width: 20px; height: 20px; }
.page { min-height: 100vh; padding-bottom: 110px; }
.main-view { min-height: 100vh; }

/* ================= iOS capsule tabbar ================= */
.tabbar {
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: min(430px, 92%); height: 62px; border-radius: 999px; z-index: 30;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 12px 40px rgba(10, 30, 40, .18), inset 0 0 0 .5px rgba(255,255,255,.6);
  display: flex; align-items: center; padding: 0 8px; gap: 2px;
}
.tab {
  flex: 1; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: #98a1ab; cursor: pointer; position: relative; transition: all .22s cubic-bezier(.3,.9,.4,1.2); font-size: 12.5px; font-weight: 600;
}
.tab i { display: flex; width: 22px; height: 22px; }
.tab span { display: none; }
.tab.active { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(0, 150, 150, .4); }
.tab.active span { display: block; }
.tab:active { transform: scale(.93); }
.dot { position: absolute; top: 7px; right: 22%; width: 9px; height: 9px; background: var(--danger);
  border-radius: 50%; box-shadow: 0 0 0 2.5px #fff; }
.tab.active .dot { right: auto; left: 18px; top: 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.9); }

/* ================= lists / cells ================= */
.list { list-style: none; background: var(--card); border-radius: var(--r-lg); margin: 0 12px; overflow: hidden; box-shadow: var(--shadow-1); }
.list li { padding: 13px 15px; display: flex; align-items: center; gap: 12px;
  border-bottom: .5px solid var(--line); transition: background .12s; }
.list li:last-child { border-bottom: none; }
.list li:active { background: #f4f5f7; }

.wx-group { margin: 10px 12px; background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.wx-cell { display: flex; align-items: center; gap: 13px; padding: 13.5px 16px; cursor: pointer; transition: background .12s; }
.wx-cell:active { background: #f2f3f6; }
.wx-cell + .wx-cell { border-top: .5px solid var(--line); }
.wx-ico { width: 29px; height: 29px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; color: #fff; flex: none; box-shadow: inset 0 -2px 6px rgba(0,0,0,.14), 0 2px 7px rgba(15,40,50,.16); }
.wx-ico svg { width: 16.5px; height: 16.5px; }
.ico-orange { background: linear-gradient(145deg, #ffb257, #f79020); }
.ico-green  { background: linear-gradient(145deg, #1fd06c, #06a94f); }
.ico-blue   { background: linear-gradient(145deg, #43c3ff, #0d9ce8); }
.ico-teal   { background: var(--accent-grad); }
.ico-red    { background: linear-gradient(145deg, #ff7a7a, #f43f3f); }
.ico-gray   { background: linear-gradient(145deg, #c3c9cf, #9aa3ab); }
.ico-rainbow { background: linear-gradient(135deg, #ffc36b 0%, #fa5f9e 55%, #8f6bff 100%); }
.wx-label { font-size: 16px; font-weight: 500; flex: 1; }
.wx-label.dim { color: #b6bdc3; }
.wx-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; font-weight: 400; }
.chev { color: #c6ccd2; font-size: 19px; margin-left: auto; font-weight: 600; }
.chev.big { font-size: 22px; }
.wx-cell .badge { margin-left: auto; }
.wx-cell .chev { margin-left: 0; }

.avatar { width: 50px; height: 50px; border-radius: 15px; flex: none; position: relative;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 19px;
  background: linear-gradient(135deg, #35c7c0, #0a8f96); box-shadow: 0 3px 9px rgba(0, 120, 130, .2); }
.avatar svg { width: 24px; height: 24px; }
.av-sm { width: 42px !important; height: 42px !important; border-radius: 13px !important; }
.me-av { width: 76px !important; height: 76px !important; border-radius: 22px !important; font-size: 30px; }

.cell-main { flex: 1; min-width: 0; }
.cell-title { font-size: 16.5px; font-weight: 500; }
.cell-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2.5px; }
.cell-right { font-size: 11.5px; color: #b4bcc2; text-align: right; flex: none; }
.cell-right .badge { margin-top: 5px; }

.badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11.5px;
  min-width: 19px; height: 19px; line-height: 19px; text-align: center; padding: 0 6px;
  display: inline-block; font-weight: 700; box-shadow: 0 0 0 2.5px var(--card); }
.count { color: var(--text-2); font-size: 12px; font-weight: normal; }
.section-label { font-size: 12.5px; color: var(--text-2); padding: 15px 20px 7px;
  display: flex; align-items: center; gap: 6px; letter-spacing: .3px; }

/* ================= buttons ================= */
.input { border: 1.2px solid transparent; border-radius: var(--r-md); padding: 13px 15px;
  font-size: 15.5px; background: #eef0f4; outline: none; color: var(--text); width: 100%;
  transition: border .15s, box-shadow .15s, background .15s; }
.input:focus { border-color: var(--accent-2); background: #fff; box-shadow: 0 0 0 3.5px var(--accent-soft); }
.btn-primary { background: var(--accent-grad); color: #fff; border: none; border-radius: var(--r-md);
  padding: 13px 24px; font-size: 15.5px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 140, 150, .3);
  transition: transform .14s, opacity .14s; cursor: pointer; }
.btn-primary:active { transform: scale(.96); opacity: .9; }
.btn-danger { display: block; width: calc(100% - 32px); margin: 26px auto; padding: 14.5px;
  border: none; border-radius: var(--r-md); background: #fff; color: var(--danger); font-size: 16px;
  font-weight: 600; box-shadow: var(--shadow-1); cursor: pointer; }
.btn-mini { border: 1.4px solid var(--accent-2); color: var(--accent); background: #fff;
  border-radius: 9px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .12s; }
.btn-mini:active { transform: scale(.93); }

.empty { text-align: center; color: var(--text-2); padding: 60px 20px; font-size: 14px; }
.empty svg { width: 76px; height: 76px; margin-bottom: 13px; opacity: .5; }
.empty-sub { font-size: 12.5px; margin-top: 7px; }

/* ================= me page ================= */
.me-header { display: flex; gap: 16px; align-items: center; padding: 24px 18px;
  margin: 10px 12px; background: linear-gradient(160deg, #ffffff, #f4fbfa);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); cursor: pointer; }
:root[data-theme='pink'] .me-header { background: linear-gradient(160deg, #ffffff, #fff0f6); }
.me-header .me-info { flex: 1; }
.me-name { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.me-sub { font-size: 13px; color: var(--text-2); margin-top: 4.5px; }
.gender-chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; color: #fff; vertical-align: 2.5px; font-weight: 700; }
.gender-chip.male { background: linear-gradient(135deg, #43c3ff, #2b8fd8); }
.gender-chip.female { background: linear-gradient(135deg, #ff9dc2, #f0568f); }

.cell { justify-content: space-between; }
.cell-sub { font-size: 13px; color: var(--text-2); }
.theme-picker { display: flex; gap: 6px; }
.theme-picker .btn-mini.on { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* ================= pop menu ================= */
.pop-menu { position: fixed; top: 66px; right: 14px; background: rgba(38, 46, 52, .96);
  backdrop-filter: blur(12px); border-radius: 14px; z-index: 40; padding: 5px 0;
  min-width: 176px; box-shadow: 0 14px 40px rgba(0,0,0,.32); animation: popIn .16s ease; }
.pop-menu::before { content: ''; position: absolute; top: -6px; right: 16px;
  border: 6px solid transparent; border-bottom-color: rgba(38,46,52,.96); border-top: none; }
.pop-item { color: #fff; font-size: 14.5px; padding: 12.5px 18px; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; }
.pop-item:active { background: rgba(255,255,255,.08); }
.pop-ico { display: inline-flex; width: 20px; height: 20px; margin-right: 10px; color: #3fd4c1; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.95); } to { opacity: 1; transform: none; } }

/* ================= chat overlay ================= */
.chat-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; z-index: 20; animation: fadeUp .18s ease; }
.chat-bar { height: var(--nav-h); display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: rgba(255,255,255,.86); backdrop-filter: blur(20px) saturate(160%);
  border-bottom: .5px solid var(--line); position: relative; z-index: 5; }
.btn-back { border: none; background: none; width: 36px; height: 36px; cursor: pointer;
  color: var(--text); display: flex; align-items: center; justify-content: center; transition: transform .13s; }
.btn-back:active { transform: translateX(-2px) scale(.9); }
.btn-back span { display: flex; width: 23px; height: 23px; }
.chat-title { font-weight: 700; font-size: 17px; }
.msg-list { flex: 1; overflow-y: auto; padding: 16px 14px 10px; }
.msg-row { display: flex; margin-bottom: 14px; gap: 9px; animation: msgIn .2s ease; }
.msg-row.mine { flex-direction: row-reverse; }
@keyframes msgIn { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: none; } }
.msg-bubble {
  max-width: 74%; padding: 11px 14px; font-size: 16px; line-height: 1.45;
  border-radius: 19px; border-bottom-left-radius: 6px; word-break: break-word; white-space: pre-wrap;
  position: relative; background: var(--bubble-in); color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}
.msg-row.mine .msg-bubble {
  background: var(--accent-grad); color: #fff; border-radius: 19px; border-bottom-left-radius: 19px;
  border-bottom-right-radius: 6px; box-shadow: 0 5px 15px rgba(0, 140, 150, .32);
}
.msg-bubble-img { padding: 4px !important; }
.msg-img { max-width: min(215px, 58vw); max-height: 250px; border-radius: 15px; display: block; cursor: zoom-in; }
.msg-avatar-box { flex: none; }
.msg-col { display: flex; flex-direction: column; max-width: 76%; }
.msg-col .sender { font-size: 11.5px; color: var(--text-2); margin: 0 7px 3.5px; }
.msg-row.mine .msg-col { align-items: flex-end; }
.msg-col .msg-bubble { max-width: 100%; }
.msg-recalled { text-align: center; font-size: 12px; color: var(--text-2);
  background: rgba(120, 130, 140, .1); border-radius: 999px; padding: 7px 16px;
  margin: 0 auto 13px; max-width: 76%; }
.chat-input-bar { display: flex; gap: 8px; padding: 9px 11px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.9); backdrop-filter: blur(18px);
  border-top: .5px solid var(--line); align-items: center; }
.chat-input-bar .input { flex: 1; background: #eceef2; border-radius: 999px; padding: 10.5px 17px; }
.chat-input-bar .input:focus { background: #fff; }
.input-extra { border: none; background: none; width: 34px; height: 34px; cursor: pointer;
  color: var(--text); display: flex; align-items: center; justify-content: center; border-radius: 999px; }
.input-extra:active { background: rgba(0,0,0,.05); transform: scale(.9); }
.input-extra span { display: flex; width: 23px; height: 23px; }
.btn-send { border: none; background: var(--accent-grad); color: #fff; width: 40px; height: 40px;
  border-radius: 999px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 140, 150, .35); transition: transform .13s; }
.btn-send:active { transform: scale(.88); }
.btn-send span { display: flex; width: 19px; height: 19px; }

/* emoji panel */
.emoji-panel { height: 212px; background: var(--card); border-top: .5px solid var(--line);
  display: grid; grid-template-columns: repeat(8, 1fr); overflow-y: auto; padding: 8px; flex: none; }
.emoji-cell { font-size: 23px; background: none; border: none; padding: 5px 0;
  border-radius: 9px; cursor: pointer; transition: background .1s; }
.emoji-cell:active { background: var(--accent-soft); }

/* ================= calls ================= */
.call-overlay { position: fixed; inset: 0; z-index: 70; background: #0b1518; overflow: hidden; }
.remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call-bg { position: absolute; inset: 0;
  background: linear-gradient(165deg, #123f46 0%, #0a252b 60%, #04141a 100%); }
.call-overlay.video-on .call-bg { display: none; }
.local-video { position: absolute; right: 16px; top: calc(60px + env(safe-area-inset-top));
  width: 108px; height: 152px; object-fit: cover; border-radius: 16px; z-index: 3;
  box-shadow: 0 8px 26px rgba(0,0,0,.5); border: 1.5px solid rgba(255,255,255,.25); }
.call-head { position: absolute; top: calc(52px + env(safe-area-inset-top)); left: 0; right: 0;
  text-align: center; color: #fff; z-index: 2; }
.call-name { font-size: 25px; font-weight: 800; letter-spacing: .3px; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.call-status { font-size: 13.5px; opacity: .8; margin-top: 7px; letter-spacing: .5px; }
.call-controls { position: absolute; bottom: calc(46px + env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 26px; z-index: 3; }
.call-ctl { width: 64px; height: 64px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  backdrop-filter: blur(10px); transition: transform .14s, background .14s; }
.call-ctl:active { transform: scale(.88); }
.call-ctl span { display: flex; width: 25px; height: 25px; }
.call-ctl i { font-style: normal; font-size: 10px; opacity: .85; }
.call-ctl.off { background: #fff; color: #0b1518; }
.call-ctl.danger { background: var(--danger); box-shadow: 0 8px 24px rgba(255, 59, 48, .45); }

.ring-overlay { position: fixed; inset: 0; z-index: 71; }
.ring-bg { position: absolute; inset: 0; background: linear-gradient(165deg, #0f3a41 0%, #0a252b 60%, #04141a 100%); }
.ring-body { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; gap: 8px; padding-bottom: 8vh; }
.ring-avatar { width: 108px; height: 108px; border-radius: 34px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); animation: ringPulse 1.6s ease-in-out infinite; }
.ring-avatar .avatar, .ring-avatar img.avatar { width: 108px; height: 108px; border-radius: 34px; font-size: 42px; }
@keyframes ringPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.ring-name { font-size: 26px; font-weight: 800; margin-top: 10px; }
.ring-status { font-size: 14px; opacity: .8; letter-spacing: .5px; }
.ring-actions { display: flex; gap: 54px; margin-top: 7vh; }
.ring-btn { width: 70px; height: 70px; border-radius: 999px; border: none; cursor: pointer;
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .14s; }
.ring-btn:active { transform: scale(.88); }
.ring-btn span { display: flex; width: 27px; height: 27px; }
.ring-btn i { font-style: normal; font-size: 11px; opacity: .9; }
.ring-btn.decline { background: var(--danger); box-shadow: 0 10px 28px rgba(255,59,48,.45); }
.ring-btn.accept { background: #06c167; box-shadow: 0 10px 28px rgba(6,193,103,.45); }

/* ================= toast / viewer / sheet ================= */
.toast { position: fixed; top: 16%; left: 50%; transform: translateX(-50%);
  background: rgba(24, 30, 36, .9); color: #fff; font-size: 13.5px;
  padding: 11px 19px; border-radius: 13px; z-index: 99; max-width: 86%;
  animation: popIn .18s ease; box-shadow: 0 12px 34px rgba(0,0,0,.3); }
.img-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 80;
  display: flex; align-items: center; justify-content: center; animation: sheetDim .15s ease; }
.img-viewer img { max-width: 96vw; max-height: 92vh; border-radius: 10px; }
.sheet { position: fixed; inset: 0; background: rgba(12, 18, 24, .5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; animation: sheetDim .2s ease; }
@keyframes sheetDim { from { opacity: 0; } to { opacity: 1; } }
.sheet-card { width: 100%; max-width: 520px; background: var(--card); border-radius: 24px 24px 0 0;
  padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto;
  animation: sheetUp .28s cubic-bezier(.2,.9,.3,1); }
@keyframes sheetUp { from { transform: translateY(50px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-card::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 999px;
  background: #e3e6ea; margin: 0 auto 13px; }
.sheet-title { font-size: 17px; font-weight: 800; margin-bottom: 13px; display: flex; align-items: center; }
.sheet-title .x { margin-left: auto; border: none; background: none; font-size: 19px; color: var(--text-2); cursor: pointer; }
.sheet .field { margin-bottom: 12px; }
.sheet .field .input, .sheet textarea { width: 100%; }
.opt-row { display: flex; gap: 8px; margin-bottom: 8px; }
.opt-row .input { flex: 1; }
.add-card { display: flex; align-items: center; gap: 12px; background: var(--card);
  margin: 7px 0; padding: 12.5px 15px; border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.add-card .btn-mini { flex: none; }

/* ================= animations ================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= desktop preview ================= */
@media (min-width: 720px) {
  .main-view, .chat-overlay, .login-view, .fullpage {
    max-width: 480px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  }
  .tabbar { left: 50%; transform: translateX(-50%); }
  .chat-overlay { inset: 0 auto; width: 480px; }
  .pop-menu { right: calc(50% - 226px); }
}

/* ================= dark mode ================= */
:root[data-mode='dark'] {
  --bg: #000000; --card: #1b1f24; --text: #eef2f5; --text-2: #8b959e;
  --line: rgba(255,255,255,.08); --bubble-in: #262b31;
  --shadow-1: 0 1px 2px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.4);
}
:root[data-theme='pink'][data-mode='dark'] { --card: #241820; --accent-soft: rgba(255, 123, 169, .16); }
:root[data-mode='dark'] .nav { background: rgba(0,0,0,.4); }
:root[data-mode='dark'] .tabbar { background: rgba(28, 32, 38, .75); box-shadow: 0 12px 40px rgba(0,0,0,.6), inset 0 0 0 .5px rgba(255,255,255,.08); }
:root[data-mode='dark'] .tab.active .dot { box-shadow: 0 0 0 2px rgba(20,20,20,.9); }
:root[data-mode='dark'] .dot { box-shadow: 0 0 0 2.5px #14171a; }
:root[data-mode='dark'] .list li:active, :root[data-mode='dark'] .wx-cell:active { background: #23282e; }
:root[data-mode='dark'] .chat-bar { background: rgba(16,18,21,.88); }
:root[data-mode='dark'] .chat-input-bar { background: rgba(16,18,21,.9); }
:root[data-mode='dark'] .chat-input-bar .input { background: #1e2329; }
:root[data-mode='dark'] .input { background: #1b2026; color: var(--text); }
:root[data-mode='dark'] .chat-input-bar .input:focus { background: #232932; }
:root[data-mode='dark'] .me-header { background: linear-gradient(160deg, #1b1f24, #17231f); }
:root[data-theme='pink'][data-mode='dark'] .me-header { background: linear-gradient(160deg, #241820, #2a1a24); }
:root[data-mode='dark'] .btn-danger { background: var(--card); }
:root[data-mode='dark'] .sheet-card { background: var(--card); }
:root[data-mode='dark'] .add-card, :root[data-mode='dark'] .wx-group, :root[data-mode='dark'] .list { background: var(--card); }
:root[data-mode='dark'] .notice-bar { background: rgba(0,194,184,.08); }
:root[data-mode='dark'] .badge { box-shadow: 0 0 0 2.5px #14171a; }
:root[data-mode='dark'] .chev { color: #48525a; }
:root[data-mode='dark'] .pop-menu { background: rgba(36, 42, 48, .97); }
:root[data-mode='dark'] .pop-menu::before { border-bottom-color: rgba(36,42,48,.97); }
:root[data-mode='dark'] .emoji-panel { background: #14181c; }
:root[data-mode='dark'] .composer textarea { background: #1b2026; color: var(--text); }
:root[data-mode='dark'] .calc-key, :root[data-mode='dark'] .calc-screen { background: #1b2127; }
:root[data-mode='dark'] .calc-screen { color: var(--text); }
:root[data-mode='dark'] .mini-card, :root[data-mode='dark'] .ch-post, :root[data-mode='dark'] .channel-card,
:root[data-mode='dark'] .nearby-card, :root[data-mode='dark'] #mePanel, :root[data-mode='dark'] .work-hero { background: var(--card); }
:root[data-mode='dark'] .mode-btn.active { background: #2a3138; color: var(--accent-2); }
:root[data-mode='dark'] .bar-mode { background: rgba(255,255,255,.07); }
:root[data-mode='dark'] .gender-card { background: rgba(255,255,255,.04); }
:root[data-mode='dark'] .auth-card { background: rgba(24, 30, 34, .88); }
:root[data-mode='dark'] .auth-card .input { background: rgba(255,255,255,.06); color: var(--text); }
:root[data-mode='dark'] .login-card { background: rgba(24, 30, 34, .88); }
:root[data-mode='dark'] .login-card .input { background: rgba(255,255,255,.06); color: var(--text); }

/* ============================================================
   v6.3 — 胶囊菜单比例修正 + 桌面端微信式左右分栏（列表+聊天一体）
   ============================================================ */

/* --- 胶囊底栏：更小更精致（所有视口） --- */
.tabbar {
  width: min(390px, 88%); height: 52px; padding: 0 5px;
  box-shadow: 0 8px 28px rgba(10, 30, 40, .16), inset 0 0 0 .5px rgba(255,255,255,.6);
}
.tab { height: 44px; gap: 5px; font-size: 11.5px; }
.tab i { width: 19px; height: 19px; }
.tab svg { width: 19px; height: 19px; }
.tab span { font-size: 11.5px; }
.tab.active::before { display: none; }
.dot { width: 8px; height: 8px; top: 6px; right: 26%; }

/* --- 桌面端 ≥960px：左栏列表 + 右栏聊天（一体窗口） --- */
@media (min-width: 960px) {
  .main-view {
    position: fixed; top: 0; bottom: 0; left: calc(50% - 490px);
    width: 490px; max-width: none; margin: 0;
    border: none; border-right: 1px solid var(--line);
    overflow-y: auto; padding-bottom: 96px;
  }
  .chat-overlay {
    left: 50%; right: 0; width: auto; max-width: none; margin: 0;
    border-left: 1px solid var(--line);
  }
  .login-view { max-width: 480px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; }
  .tabbar {
    left: calc(50% - 490px + 25px); transform: none;
    width: 440px; bottom: 16px;
  }
  .pop-menu { left: calc(50% - 490px + 250px); right: auto; }
  .toast { left: calc(50% - 245px); }
  .desk-hint {
    position: fixed; left: 50%; right: 0; top: 0; bottom: 0; z-index: 4;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; color: var(--text-2); background: var(--bg); border-left: 1px solid var(--line);
  }
  .desk-hint svg { width: 76px; height: 76px; opacity: .35; }
  .desk-hint b { font-size: 21px; color: var(--text); }
  .desk-hint span { font-size: 13.5px; }
  .notice-bar { margin: 10px 12px 0; }
}
@media (max-width: 959px) { .desk-hint { display: none !important; } }

/* ============================================================
   v7 — 对标微信原版配色与移动端交互
   ============================================================ */

/* --- 微信配色（覆盖双主题主色） --- */
:root {
  --accent: #07c160;
  --accent-2: #2bc76a;
  --accent-deep: #05904d;
  --accent-soft: rgba(7, 193, 96, .12);
  --accent-grad: linear-gradient(135deg, #2bc76a, #07c160);
  --bg: #ededed;
}
:root[data-theme='pink'] {
  --accent: #f0568f; --accent-2: #ff7ba9; --accent-deep: #d63d7a;
  --accent-soft: rgba(255, 123, 169, .13);
  --accent-grad: linear-gradient(135deg, #ff8fb8, #ee5295);
  --bg: #fbf2f6;
}
:root[data-mode='dark'] { --bg: #111111; --card: #1e1e1e; --text: #e8eaed; --text-2: #8b9298; --line: rgba(255,255,255,.07); }
:root[data-theme='pink'][data-mode='dark'] { --card: #231419; }
:root[data-mode='dark'] .nav-large { color: var(--text); }

/* --- 底部导航：微信式（透明磨砂底、全宽、常显文字、绿色选中） --- */
.tabbar {
  left: 0; right: 0; bottom: 0; transform: none; width: auto; max-width: none;
  height: calc(54px + env(safe-area-inset-bottom)); padding: 0 0 env(safe-area-inset-bottom);
  border-radius: 0; background: rgba(247, 247, 247, .96);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: .5px solid rgba(0, 0, 0, .08); box-shadow: none;
}
.tab { height: 54px; background: none !important; box-shadow: none !important; gap: 2px; }
.tab i { width: 23px; height: 23px; }
.tab svg { width: 23px; height: 23px; }
.tab span { display: block; font-size: 10px; font-weight: 500; }
.tab.active { background: none !important; color: #07c160; }
:root[data-theme='pink'] .tab.active { color: #ee5295; }
.tab.active span { display: block; }
:root[data-mode='dark'] .tabbar { background: rgba(24, 24, 24, .96); border-top-color: rgba(255,255,255,.08); }
:root[data-mode='dark'] .tab { color: #7d8085; }
:root[data-mode='dark'] .tab.active { color: #07c160; }
:root[data-theme='pink'][data-mode='dark'] .tab.active { color: #ff7ba9; }

/* --- 移动端聊天页：整页跳转（右侧滑入/滑出），首页隐藏 --- */
@media (max-width: 959px) {
  .chat-overlay { transform: translateX(100%); transition: transform .24s cubic-bezier(.3,.8,.3,1); }
  .chat-overlay.slide-in { transform: translateX(0); }
  .chat-overlay.slide-out { transform: translateX(100%); }
  body.chat-open .main-view { visibility: hidden; }
  body.chat-open .tabbar { visibility: hidden; }
}

/* --- 首页导航：微信式同色顶栏 --- */
.nav { background: transparent; }
.nav-row { height: 44px; }

/* --- 登录/注册卡：收敛毛玻璃，微信式简洁 --- */
.auth-card { border-radius: 16px; padding: 22px 20px; }
.auth-card .input { border-radius: 10px; }
.reg-avatar-row { display: flex; flex-direction: column; align-items: center; margin-bottom: 14px; }
.reg-avatar { width: 72px; height: 72px; border-radius: 50%; background: #e8ebee; color: #9aa1a8;
  display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;
  border: 1.5px dashed #c3c9cf; transition: all .15s; }
.reg-avatar svg { width: 26px; height: 26px; }
.reg-avatar.has-img { border-style: solid; border-color: var(--accent-2); }
.reg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.reg-avatar-tip { font-size: 11.5px; color: var(--text-2); margin-top: 6px; }

/* --- 我 页：微信式分区 --- */
.me-header { background: var(--card); border-radius: 0; margin: 8px 0 0; box-shadow: none; }
.wx-group { border-radius: 0; margin: 8px 0 0; box-shadow: none; }
.list { border-radius: 0; margin: 0; box-shadow: none; }
.btn-danger { margin-top: 26px; }

/* --- 桌面端分栏保留（tabbar 已改为全宽微信式，桌面左栏内定位） --- */
@media (min-width: 960px) {
  .tabbar { left: calc(50% - 490px); width: 490px; bottom: 0; transform: none; border-radius: 0; }
  body.chat-open .main-view { visibility: visible; }
}