:root {
  --wx-green: #07c160;
  --wx-green-deep: #06ad56;
  --bubble-me: #95ec69;
  --bubble-them: #ffffff;
  --bg-chat: #ebe6e1;
  --bg-list: #f7f7f7;
  --bg-rail: #2e2e2e;
  --line: rgba(0, 0, 0, 0.08);
  --text: #111;
  --muted: #888;
  --shadow: 0 12px 40px rgba(20, 30, 20, 0.12);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Outfit", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(7, 193, 96, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(40, 80, 60, 0.12), transparent 50%),
    linear-gradient(160deg, #dfe8e2 0%, #cfd9d3 45%, #e8efe9 100%);
}

.hidden { display: none !important; }
.app { height: 100%; }

.view { height: 100%; }

/* Login */
.login-view {
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 36px 28px 28px;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--wx-green), #0a9b4f);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  box-shadow: 0 8px 20px rgba(7, 193, 96, 0.35);
}
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: 0.02em;
}
.login-sub { color: var(--muted); margin: 10px 0 22px; }
.field { display: grid; gap: 8px; margin-bottom: 16px; font-size: 13px; color: #555; }
.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  outline: none;
  background: #fff;
}
.field input:focus { border-color: var(--wx-green); box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15); }
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: var(--wx-green);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn-primary:hover { background: var(--wx-green-deep); }
.btn-primary:active { transform: scale(0.98); }
.login-hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Main shell */
.main-view {
  display: grid;
  grid-template-columns: 64px 300px 1fr;
  max-width: 1180px;
  height: min(920px, calc(100% - 32px));
  margin: 16px auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

.rail {
  background: var(--bg-rail);
  color: #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 8px;
}
.rail-avatar {
  width: 40px;
  height: 40px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: var(--wx-green);
  color: #fff;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
  overflow: hidden;
}
.rail-avatar.has-img,
.avatar.has-img {
  background: #ddd !important;
  padding: 0;
}
.rail-avatar.has-img img,
.avatar.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-edit {
  display: flex;
  align-items: center;
  gap: 14px;
}
.rail-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  background: transparent;
  color: #9aa0a6;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.rail-btn:hover { background: rgba(255,255,255,0.08); color: #f2f2f2; }
.rail-btn.active {
  background: rgba(7, 193, 96, 0.18);
  color: #07c160;
}
.rail-btn:active { transform: scale(0.94); }
.rail-ico {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  line-height: 0;
}
.rail-ico svg { width: 22px; height: 22px; display: block; }
.rail-bobo {
  margin-top: auto;
  height: auto;
  min-height: 52px;
  padding: 8px 0 10px;
  gap: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e2b34a;
}
.rail-bobo:hover,
.rail-bobo:focus { color: #f0c86a; background: rgba(226, 179, 74, 0.12); }
.rail-bobo-amt {
  font-size: 10px;
  line-height: 1.1;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ddd;
}
.c2c-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.c2c-actions .btn-line { flex: 1; min-width: 100px; }
.c2c-card {
  border: 0;
  width: 220px;
  text-align: left;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(145deg, #2b6cb0, #1a4a7a);
  color: #fff;
  display: block;
}
.c2c-card small { display: block; opacity: 0.85; font-size: 11px; margin-top: 6px; }
.warn-panel {
  background: #fff8e8;
  border: 1px solid #f0d78c;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: #f5f5f5;
  padding: 10px;
  font: inherit;
  cursor: pointer;
  color: #666;
}
.auth-tab.active {
  background: #07c160;
  color: #fff;
  font-weight: 600;
}
.auth-pane.hidden { display: none; }
.scan-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.scan-qr-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.scan-qr-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.scan-overlay.hidden { display: none; }
.scan-hint {
  margin: 0;
  font-size: 13px;
  color: #666;
  text-align: center;
}
.btn-ghost {
  border: 1px solid var(--line);
  background: #f7f7f7;
  color: #333;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.login-hint {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin: 10px 0 0;
}
.panel small.ok { color: #07c160; font-weight: 500; }
.panel small.bad { color: #fa5151; font-weight: 500; }
.switch-panel { padding-top: 12px; padding-bottom: 12px; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.switch-row strong { display: block; font-size: 15px; }
.switch-row small { display: block; margin-top: 2px; font-size: 12px; }
.switch-row small.ok { color: #07c160; }
.switch-row small.bad { color: #fa5151; }
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: #c8c8c8;
  border-radius: 28px;
  cursor: pointer;
  transition: 0.2s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.switch input:checked + .switch-slider { background: #07c160; }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch-body.hidden { display: none; }
.btn-line:disabled { opacity: 0.45; cursor: not-allowed; }
.rail-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #fa5151;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 1px #2e2e2e;
}
.rail-badge:empty,
.rail-badge[data-count="0"] { display: none; }
.rail-spacer { flex: 1; }
.session-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #fa5151;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
  margin-left: 8px;
  flex-shrink: 0;
}
.session-unread[data-count="0"] { display: none; }
.session-item .session-meta { flex: 1; min-width: 0; }
.btn-plus {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.plus-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
  padding: 16px 10px 8px;
}
.plus-panel.hidden { display: none; }
.plus-item {
  border: 0;
  background: transparent;
  display: grid;
  gap: 8px;
  justify-items: center;
  cursor: pointer;
  font: inherit;
  color: #5c5c5c;
  transition: transform 0.15s ease;
}
.plus-item:active { transform: scale(0.94); }
.plus-item small {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.plus-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.plus-item:hover .plus-ico {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.plus-ico svg {
  width: 26px;
  height: 26px;
  display: block;
}
.plus-ico.ico-img {
  background: linear-gradient(145deg, #5b9cf5, #3a78d4);
  color: #fff;
}
.plus-ico.ico-rp {
  background: linear-gradient(145deg, #ff6b5a, #e23d2e);
  color: #e23d2e;
}
.plus-ico.ico-tf {
  background: linear-gradient(145deg, #f0b24a, #d99218);
  color: #fff;
}
.plus-ico.ico-wal {
  background: linear-gradient(145deg, #2fd07a, #0aa854);
  color: #fff;
}
.msg-img {
  max-width: min(220px, 60vw);
  border-radius: 6px;
  display: block;
  cursor: pointer;
}
.rp-card, .tf-card {
  border: 0;
  width: 210px;
  text-align: left;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  font: inherit;
  display: flex;
  gap: 10px;
  align-items: center;
}
.rp-card {
  background: linear-gradient(145deg, #f7b500, #e08900);
  color: #fff;
}
.rp-card small { display: block; opacity: 0.9; font-size: 11px; margin-top: 2px; }
.rp-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.25);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.tf-card {
  background: linear-gradient(145deg, #f0c060, #d4a017);
  color: #fff;
  flex-direction: column;
  align-items: flex-start;
}
.tf-amt { font-size: 22px; font-weight: 700; margin: 4px 0; }
.msg-sys {
  text-align: center;
  color: #9a9a9a;
  font-size: 12px;
  padding: 8px 16px;
}
.scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  overflow: hidden;
}
.scan-overlay.hidden { display: none; }
.scan-overlay video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: grid;
  place-items: center;
}
.scan-frame {
  position: relative;
  width: min(260px, 70vw);
  aspect-ratio: 1;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
}
.scan-frame .c {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #07c160;
}
.scan-frame .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.scan-frame .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.scan-frame .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.scan-frame .br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #07c160, transparent);
  animation: scanmove 2s linear infinite;
}
@keyframes scanmove {
  0% { top: 10%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 90%; opacity: 0.3; }
}
.scan-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  z-index: 2;
}
.scan-top h3 { margin: 0; flex: 1; text-align: center; font-size: 16px; }
.back-btn.light { color: #fff; background: rgba(0,0,0,0.25); border-radius: 8px; }
.scan-tip {
  position: absolute;
  left: 0; right: 0;
  bottom: 18%;
  text-align: center;
  z-index: 2;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}
.hub-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.hub-tabs button {
  flex: 1;
  border: 0;
  background: #fff;
  padding: 12px 8px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent;
}
.hub-tabs button.active {
  color: var(--wx-green-deep);
  border-bottom-color: var(--wx-green);
  font-weight: 600;
}

.col-list, .col-contacts, .col-friends, .col-me {
  background: var(--bg-list);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  grid-column: 2;
}
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}
.list-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}
.list-actions { display: flex; gap: 6px; }
.list-actions button, .ghost-btn, .back-btn {
  border: 0;
  background: #e9e9e9;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 16px;
}
.ghost-btn { width: auto; padding: 0 10px; font-size: 13px; }
.search-bar { padding: 0 12px 8px; }
.search-bar input {
  width: 100%;
  border: 0;
  background: #e9e9e9;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  outline: none;
}
.filter-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
}
.filter {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.filter.active { background: rgba(7, 193, 96, 0.12); color: var(--wx-green-deep); font-weight: 600; }

.session-list, .contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
.session-item, .contact-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.15s;
}
.session-item:hover, .contact-item:hover, .session-item.active { background: #dedede; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.green { background: linear-gradient(145deg, #07c160, #0a8f4a); }
.avatar.blue { background: linear-gradient(145deg, #4a90d9, #2f6fb3); }
.avatar.orange { background: linear-gradient(145deg, #f5a623, #d4890f); }
.session-meta { min-width: 0; flex: 1; }
.session-meta .name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.session-meta .preview {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-group {
  font-size: 10px;
  color: #fff;
  background: #4a90d9;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.time { color: var(--muted); font-size: 11px; font-weight: 400; }

.col-chat {
  grid-column: 3;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.25), transparent 40%),
    var(--bg-chat);
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: #777;
}
.empty-brand {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  color: rgba(0,0,0,0.12);
  margin-bottom: 8px;
}
.chat-panel { display: flex; flex-direction: column; height: 100%; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(245, 245, 245, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.chat-title-wrap { flex: 1; min-width: 0; }
.chat-head h3 { margin: 0; font-size: 16px; }
.chat-sub { color: var(--muted); font-size: 12px; }
.back-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.me-card { cursor: pointer; }
.me-card-arrow {
  margin-left: auto;
  color: #bbb;
  font-size: 22px;
  line-height: 1;
}
.menu-item.danger strong { color: #fa5151; }
.friend-pick-list { list-style: none; margin: 0; padding: 0; }
.friend-pick-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
}
.friend-pick-list li:hover { background: #f7f7f7; }
.friend-pick-list li:last-child { border-bottom: 0; }

.msg-scroll {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.msg-row {
  display: flex;
  gap: 10px;
  max-width: 78%;
  animation: pop 0.22s ease both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-row .av {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #bbb;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.msg-row.me .av { background: var(--wx-green); }
.msg-row.bot .av { background: #4a90d9; }
.bubble {
  padding: 10px 12px;
  border-radius: 6px;
  line-height: 1.5;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  position: relative;
}
.msg-row.them .bubble { background: var(--bubble-them); }
.msg-row.me .bubble { background: var(--bubble-me); }
.msg-row .sender-name {
  font-size: 11px;
  color: #8a8a8a;
  margin-bottom: 4px;
}
.typing {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 8px;
}

.composer {
  background: #f5f5f5;
  border-top: 1px solid var(--line);
  padding: 8px 12px 12px;
}
.composer-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.tool {
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: #444;
}
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
#input-msg {
  flex: 1;
  resize: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  max-height: 120px;
  outline: none;
  background: #fff;
}
.btn-send {
  border: 0;
  background: var(--wx-green);
  color: #fff;
  border-radius: 6px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.contact-item small { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }

.col-friends, .col-me {
  overflow: auto;
}
.menu-list.compact .menu-item { padding: 10px 14px; }
#friend-count { color: var(--muted); font-weight: 400; }
.notify-toast {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 200;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
  padding: 12px 14px;
  min-width: 220px;
  max-width: min(320px, 80vw);
  animation: rise 0.25s ease both;
  border-left: 4px solid var(--wx-green);
  cursor: pointer;
}
.notify-toast strong { display: block; font-size: 14px; margin-bottom: 4px; }
.notify-toast span { font-size: 12px; color: #666; line-height: 1.4; }
.me-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 16px;
  background: #fff;
  margin-bottom: 10px;
}
.me-card strong { display: block; font-size: 18px; }
.me-card small { color: var(--muted); }
.avatar.big { width: 56px; height: 56px; font-size: 22px; border-radius: 10px; }

.menu-list { list-style: none; margin: 0 0 10px; padding: 0; background: #fff; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
}
.menu-item:hover { background: #f3f3f3; }
.menu-item strong { display: block; font-size: 15px; }
.menu-item small { color: var(--muted); font-size: 12px; }
.menu-item > div { flex: 1; min-width: 0; }
.menu-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.menu-ico.green { background: var(--wx-green); }
.menu-ico.blue { background: #4a90d9; }
.menu-ico.orange { background: #f5a623; }
.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #fa5151;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.badge:empty, .badge[data-count="0"] { display: none; }
.section-label {
  padding: 10px 16px 6px;
  font-size: 12px;
  color: var(--muted);
}

.page-overlay {
  position: absolute;
  inset: 0;
  background: #ededed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  animation: rise 0.25s ease both;
}
.main-view { position: relative; }
.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
}
.page-head h3 { margin: 0; flex: 1; font-size: 16px; text-align: center; }
.page-head-space { width: 34px; }
.page-body { flex: 1; overflow: auto; padding: 12px; }

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.panel h4 { margin: 0 0 10px; font-size: 15px; }
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.row-between:last-child { border-bottom: 0; }
.form-grid { display: grid; gap: 10px; }
.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
  background: #fafafa;
}
.form-grid textarea { min-height: 72px; resize: vertical; }
.btn-line {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  background: var(--wx-green);
  color: #fff;
}
.btn-line.ghost { background: #e9e9e9; color: #333; }
.btn-line.danger { background: #fa5151; }
.wallet-hero {
  text-align: center;
  padding: 28px 12px;
  background: linear-gradient(145deg, #07c160, #0a8f4a);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
}
.wallet-hero .num {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.wallet-hero .unit { opacity: 0.9; margin-top: 4px; }
.qr-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qr-card {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  font-size: 12px;
}
.qr-card img {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  margin: 8px 0;
}
.avatar.orange { background: #f5a623; }
.badge-group.ai {
  background: #fff3e0;
  color: #e67e22;
  border-color: #f5c78a;
}
.my-qr-wrap {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.my-qr {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 8px;
  object-fit: contain;
}
.my-qr-link {
  font-size: 11px;
  color: #888;
  word-break: break-all;
  max-width: 100%;
  line-height: 1.4;
}
.btn-pair {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.highlight-panel {
  border: 1px solid #c8efd8;
  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.08);
}
.approve-row { align-items: flex-start; }
.status-tag.pending { background: #fff3e0; color: #d48806; }
.status-tag.accepted, .status-tag.joined { background: #e8f8ef; color: #07c160; }
.status-tag.rejected { background: #fdecea; color: #fa5151; }
#btn-open-ai {
  font-size: 11px;
  font-weight: 700;
  color: #e67e22;
}
.composer-tools.hidden { display: none; }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.amount-chips button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.amount-chips button.active {
  border-color: var(--wx-green);
  color: var(--wx-green-deep);
  background: rgba(7,193,96,0.08);
}
.empty-tip { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 13px; }
.status-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eee;
}
.status-tag.pending { background: #fff3cd; color: #8a6d1d; }
.status-tag.accepted { background: #d4edda; color: #1e6b3a; }
.status-tag.rejected { background: #f8d7da; color: #8a1f2b; }

@media (max-width: 860px) {
  .main-view {
    grid-template-columns: 1fr;
    height: 100%;
    margin: 0;
    border-radius: 0;
    max-width: none;
  }
  .rail {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    flex-direction: row;
    justify-content: space-around;
    padding: 6px 0;
    z-index: 30;
  }
  .rail-avatar, .rail-spacer, #btn-rail-bobo { display: none; }
  .col-list, .col-contacts, .col-friends, .col-me, .col-chat {
    height: calc(100% - 56px);
    border-right: 0;
    grid-column: auto;
  }
  .col-list.mobile-hide, .col-contacts.mobile-hide, .col-friends.mobile-hide, .col-me.mobile-hide { display: none !important; }
  .col-chat.mobile-hide { display: none !important; }
  body { background: #fff; }
  .qr-box { grid-template-columns: 1fr; }
}
