:root {
  --page: #ededed;
  --nav: #ededed;
  --cell: #fff;
  --tabbar: #f6f6f6d1;
  --fg0: #000000e5;
  --fg1: #0000008c;
  --fg2: #0000004d;
  --line: #0000001a;
  --brand: #07c160;
  --blue: #10aeff;
  --red: #fa5151;
  --orange: #fa9d3b;
  --yellow: #ffbb00;
  --purple: #6467f0;
  --live: #ff6146;
  --search-h: 36px;
  --tab-h: 49px;
  --nav-h: 44px;
  --avatar: 52px;
  --contact-avatar: 40px;
  --cell-h: 56px;
  --contact-h: 55px;
  --head: 64px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--fg0);
  font-family: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}

.icon,
.cell-ico.mask,
.tab-ico i,
.plus-menu i,
.scan-more i,
.scan-actions i {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.icon {
  display: block;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: var(--nav);
}

.nav h1 {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: var(--nav-h);
  letter-spacing: 0.2px;
  text-align: center;
  pointer-events: none;
}

.plus {
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--fg0);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plus-svg {
  width: 24px;
  height: 24px;
  display: block;
  flex: none;
  transition: transform 0.2s ease;
}

.plus.open .plus-svg {
  transform: rotate(45deg);
}

html.on-discover .plus,
html.on-me .plus {
  visibility: hidden;
  pointer-events: none;
}

.plus-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: transparent;
}

.plus-menu {
  position: fixed;
  top: calc(var(--nav-h) + env(safe-area-inset-top) + 2px);
  right: 8px;
  z-index: 31;
  width: 176px;
  padding: 0;
  background: #4c4c4c;
  border-radius: 4px;
  box-shadow: 0 4px 12px #00000033;
}

.plus-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: #4c4c4c;
  transform: rotate(45deg);
}

.plus-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 17px;
  text-align: left;
}

.plus-menu button + button {
  position: relative;
}

.plus-menu button + button::before {
  content: "";
  position: absolute;
  left: 52px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: #ffffff1a;
}

.plus-menu i {
  width: 24px;
  height: 24px;
  flex: none;
  background: #fff;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.search-wrap {
  padding: 0 8px 8px;
  background: var(--nav);
}

.search {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--search-h);
  border-radius: 4px;
  background: #fff;
  color: var(--fg2);
  font-size: 15px;
}

.search .icon {
  width: 14px;
  height: 14px;
  --src: url("./assets/icons/search-outlined.svg?v=20261012001849");
}

.page[hidden] {
  display: none;
}

.list {
  background: var(--cell);
}

.chat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 0 16px;
  color: inherit;
  text-decoration: none;
  min-height: 72px;
}

.avatar {
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  display: block;
}

.avatar.svg {
  overflow: hidden;
}

.meta {
  flex: 1;
  min-width: 0;
  padding: 8px 0 11px;
  border-bottom: 0.5px solid var(--line);
}

.chat:last-child .meta {
  border-bottom: 0;
}

.line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.line strong {
  font-size: 17px;
  font-weight: 400;
  color: var(--fg0);
}

.line time {
  color: var(--fg2);
  font-size: 11px;
  flex: none;
}

.meta p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--fg2);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.avatar-wrap {
  position: relative;
  flex: none;
}

.group {
  margin-top: 8px;
  background: var(--cell);
}

.group:first-child {
  margin-top: 0;
}

.cell {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--cell-h);
  padding: 0 16px;
  color: inherit;
  text-decoration: none;
  background: var(--cell);
}

.cell + .cell {
  position: relative;
}

.cell + .cell::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--line);
}

.cell-ico {
  width: 24px;
  height: 24px;
  flex: none;
}

.cell-ico.mask {
  background: var(--tint);
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.cell-ico img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.cell > span:not(.cell-ico) {
  flex: 1;
  font-size: 17px;
  font-weight: 400;
}

.arrow {
  width: 8px;
  height: 16px;
  flex: none;
  color: var(--fg2);
  --src: url("./assets/icons/arrow-outlined.svg?v=20261012001849");
}

.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--contact-h);
  padding: 0 16px;
  color: inherit;
  text-decoration: none;
  background: var(--cell);
}

.contact + .contact {
  position: relative;
}

.contact + .contact::before {
  content: "";
  position: absolute;
  left: 68px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--line);
}

.contact-ico,
.contact-av {
  width: var(--contact-avatar);
  height: var(--contact-avatar);
  border-radius: 4px;
  flex: none;
  object-fit: cover;
}

.contact-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint);
}

.contact-ico i {
  width: 22px;
  height: 22px;
  background: #fff;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.avatar.pay {
  background: #07c160;
}

.contact strong {
  font-size: 17px;
  font-weight: 400;
}

.letter {
  height: 24px;
  padding: 0 16px;
  background: var(--page);
  color: var(--fg1);
  font-size: 14px;
  line-height: 24px;
}

.index {
  position: fixed;
  top: 50%;
  right: 2px;
  z-index: 8;
  transform: translateY(-50%);
  color: #555;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.me-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 16px;
  background: var(--cell);
  color: inherit;
  text-decoration: none;
}

.me-av {
  width: var(--head);
  height: var(--head);
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}

.me-meta {
  flex: 1;
  min-width: 0;
}

.me-meta strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.me-meta p {
  margin: 6px 0 0;
  color: var(--fg1);
  font-size: 14px;
}

.me-qr {
  width: 18px;
  height: 18px;
  color: var(--fg0);
  --src: url("./assets/icons/qr-code-outlined.svg?v=20261012001849");
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.tabbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--line);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 0;
  background: none;
  color: var(--fg0);
  font: inherit;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

.tab-ico {
  width: 28px;
  height: 28px;
  position: relative;
}

.tab-ico i {
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.tab-ico .wx-logo,
.tab-ico .on,
.tab-ico .off {
  position: absolute;
  inset: 0;
  width: 28px;
  height: 28px;
  display: block;
}

.tab-ico .on,
.tab-ico .wx-logo.on {
  opacity: 0;
}

.tab-ico .off,
.tab-ico .wx-logo.off {
  opacity: 1;
}

.tab.on {
  color: var(--brand);
}

.tab.on .tab-ico .off,
.tab.on .tab-ico .wx-logo.off {
  opacity: 0;
}

.tab.on .tab-ico .on,
.tab.on .tab-ico .wx-logo.on {
  opacity: 1;
}

html.on-scan,
html.on-scan body {
  background: #000;
  padding: 0;
}

html.on-scan .nav,
html.on-scan .tabbar,
html.on-scan .page,
html.on-scan .plus-mask,
html.on-scan .plus-menu {
  display: none;
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #111;
  color: #fff;
  overflow: hidden;
}

.scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.scan::before,
.scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.scan::before {
  top: 0;
  height: 120px;
  background: linear-gradient(#0009, #0000);
}

.scan::after {
  bottom: 0;
  height: 220px;
  background: linear-gradient(#0000, #000a 70%, #000c);
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 46px;
  z-index: 1;
  background: url("./assets/scan/scanline.png?v=20261012001849") center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  animation: scan-move 2.8s linear infinite;
  pointer-events: none;
}

.scan-hit {
  position: absolute;
  z-index: 5;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #3dff6a;
  box-shadow: 0 0 0 4px #3dff6a55, 0 0 14px #07c160;
  pointer-events: none;
}

@keyframes scan-move {
  0% { top: 18%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 62%; opacity: 0; }
}

.scan-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
}

.scan-nav-space {
  flex: 1;
}

.scan-close,
.scan-more {
  width: 44px;
  height: 44px;
  border: 0;
  padding: 0;
  background: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-close svg {
  width: 22px;
  height: 22px;
  display: block;
}

.scan-more i {
  width: 24px;
  height: 24px;
  background: #fff;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.scan-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 36px;
}

.scan-actions button {
  border: 0;
  background: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 11px;
  width: 72px;
}

.scan-act-ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff26;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-actions i {
  width: 24px;
  height: 24px;
  background: #fff;
  -webkit-mask: var(--src) center / contain no-repeat;
  mask: var(--src) center / contain no-repeat;
}

.scan-torch img {
  width: 22px;
  height: 28px;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
}

.scan-torch.on .scan-act-ico {
  background: #07c16066;
}

.scan-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 36px;
  height: calc(52px + env(safe-area-inset-bottom));
  padding: 0 24px env(safe-area-inset-bottom);
}

.scan-tabs button {
  border: 0;
  background: none;
  color: #b2b2b2;
  font: inherit;
  font-size: 15px;
  padding: 0 4px 10px;
}

.scan-tabs button.on {
  color: #fff;
  font-weight: 600;
}

.scan-tip {
  position: fixed;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  max-width: min(88vw, 320px);
  margin: 0;
  padding: 10px 14px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}
