:root {
  --rose: #e0526d;
  --coral: #f58a65;
  --gold: #f2c14e;
  --ink: #2a1b20;
  --muted: #8c747c;
  --bg: #fdf7f5;
  --card: #ffffff;
  --line: rgba(90, 50, 60, 0.1);
  --nav: rgba(255, 253, 252, 0.9);
  --bubble: #ffffff;
  --bubble-ink: #342329;
  --shadow: 0 18px 42px rgba(76, 26, 40, 0.14);
  --hero-shadow: 0 14px 30px rgba(224, 82, 109, 0.28);
}

[data-theme="dark"] {
  --ink: #f7eef1;
  --muted: #b9a3aa;
  --bg: #171215;
  --card: #231a1e;
  --line: rgba(255, 255, 255, 0.1);
  --nav: rgba(28, 21, 25, 0.92);
  --bubble: #2e2429;
  --bubble-ink: #f7eef1;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

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

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(900px 600px at 5% -10%, rgba(255, 196, 178, 0.45), transparent 65%),
    radial-gradient(800px 600px at 105% 10%, rgba(198, 160, 255, 0.28), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

#app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}

@media (min-width: 620px) {
  #app {
    box-shadow: 0 30px 80px rgba(60, 20, 34, 0.22);
  }
}

.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  animation: screen-in 0.2s ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 14px;
}

.ic {
  display: block;
  flex: none;
}

/* 登录 */
.login-screen {
  position: relative;
  height: 100%;
  overflow-y: auto;
  padding: 34px 22px calc(30px + env(safe-area-inset-bottom));
  background:
    radial-gradient(420px 420px at 0% 0%, rgba(255, 255, 255, 0.22), transparent 70%),
    radial-gradient(520px 520px at 100% 100%, rgba(242, 193, 78, 0.22), transparent 70%),
    linear-gradient(135deg, #ff9a8b 0%, #ff6a88 45%, #c86dd7 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 23px;
  background: linear-gradient(135deg, #ff8fa3, #ff6a88);
  display: grid;
  place-items: center;
  font-size: 34px;
  box-shadow: 0 18px 38px rgba(80, 20, 40, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.login-brand h1 {
  margin: 0;
  font-size: 38px;
  letter-spacing: 12px;
  font-weight: 900;
  text-indent: 12px;
}

.login-brand p {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: 3px;
  opacity: 0.9;
}

.login-card {
  background: var(--card);
  color: var(--ink);
  border-radius: 28px;
  padding: 24px 22px 18px;
  box-shadow: 0 30px 70px rgba(70, 18, 36, 0.3);
}

.login-card h2 {
  margin: 0 0 5px;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.3px;
}

.login-card .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 15px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 12px;
}

.field input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  min-width: 0;
}

.field input::placeholder {
  color: var(--muted);
}

.primary-btn {
  width: 100%;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 12px 26px rgba(224, 82, 109, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:active {
  transform: scale(0.985);
}

.login-note {
  margin-top: 16px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.login-version {
  margin-top: 14px;
  text-align: center;
  font-size: 9.5px;
  color: var(--muted);
  opacity: 0.8;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 7px;
  flex: none;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  box-shadow: 0 7px 16px rgba(224, 82, 109, 0.28);
  flex: none;
}

.topbar-main {
  flex: 1;
  min-width: 0;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  line-height: 1.1;
}

.pill {
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(224, 82, 109, 0.12);
  color: var(--rose);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: none;
}

.icon-btn:active {
  background: var(--line);
}

/* 首页 Hero */
.hero {
  position: relative;
  margin: 5px 14px 11px;
  padding: 15px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  box-shadow: var(--hero-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: none;
}

.hero::after {
  content: "♥";
  position: absolute;
  right: -10px;
  top: -30px;
  font-size: 108px;
  opacity: 0.1;
  pointer-events: none;
}

.hero-main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-sub {
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.86;
}

.hero-avatars {
  display: flex;
  margin-top: 9px;
  height: 25px;
}

.hero-avatars .avatar {
  width: 25px;
  height: 25px;
  font-size: 10px;
  margin-right: -7px;
  border: 1.5px solid var(--rose);
}

.hero-btn {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 8px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.19);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* 搜索 */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 11px;
  padding: 0 13px;
  height: 40px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 12.5px;
}

.search input::placeholder {
  color: var(--muted);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 6px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* 会话 */
.chat-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px;
  padding: 9px 8px;
  border-radius: 17px;
  transition: background 0.15s;
}

.chat-row:active,
.chat-row.active {
  background: rgba(224, 82, 109, 0.075);
}

.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  position: relative;
  letter-spacing: 0;
}

.avatar.online::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #34c759;
  border: 2px solid var(--bg);
}

.chat-main {
  flex: 1;
  min-width: 0;
}

.chat-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  margin-left: auto;
  flex: none;
  font-size: 8.5px;
  color: var(--muted);
}

.chat-preview {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  margin-left: auto;
  flex: none;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.badge.dim {
  background: #cbb8be;
}

.tiny-ic {
  color: var(--muted);
  opacity: 0.75;
}

/* 底部导航 */
.bottom-nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  background: var(--nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
}

.nav-item.on {
  color: var(--rose);
}

.nav-item .nav-icon {
  width: 30px;
  height: 24px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.nav-item.on .nav-icon {
  background: rgba(224, 82, 109, 0.11);
}

.nav-badge {
  position: absolute;
  top: 0;
  right: calc(50% - 20px);
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--rose);
  color: #fff;
  font-size: 6.5px;
  display: grid;
  place-items: center;
  border: 1px solid var(--bg);
}

/* 聊天页 */
.chat-screen {
  background: var(--bg);
}

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.chat-head .avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.chat-head-main {
  flex: 1;
  min-width: 0;
}

.chat-head-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head-sub {
  margin-top: 1px;
  font-size: 8.5px;
  color: var(--muted);
}

.wall {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  background:
    radial-gradient(circle, rgba(224, 82, 109, 0.075) 1.6px, transparent 2px) 0 0 / 44px 44px,
    radial-gradient(circle, rgba(245, 138, 101, 0.05) 1.2px, transparent 1.8px) 19px 23px / 44px 44px,
    linear-gradient(150deg, var(--bg), rgba(255, 232, 222, 0.5) 60%, var(--bg));
}

[data-theme="dark"] .wall {
  background:
    radial-gradient(circle, rgba(224, 82, 109, 0.08) 1.6px, transparent 2px) 0 0 / 44px 44px,
    linear-gradient(150deg, #171215, #21181c 60%, #171215);
}

.wall-spacer {
  flex: 1 1 auto;
  min-height: 4px;
}

.day {
  width: fit-content;
  margin: 6px auto 11px;
  padding: 4px 11px;
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  font-size: 8.5px;
  box-shadow: 0 2px 8px rgba(70, 30, 42, 0.04);
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.msg.right {
  justify-content: flex-end;
}

.msg .avatar {
  width: 27px;
  height: 27px;
  font-size: 10px;
}

.msg-col {
  max-width: 76%;
  min-width: 0;
}

.msg.right .msg-col {
  align-items: flex-end;
}

.bubble {
  display: inline-block;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 16px 16px 16px 5px;
  background: var(--bubble);
  color: var(--bubble-ink);
  font-size: 13px;
  line-height: 1.48;
  word-break: break-word;
  box-shadow: 0 3px 9px rgba(70, 30, 42, 0.06);
  user-select: none;
  -webkit-user-select: none;
}

.msg.right .bubble {
  border-radius: 16px 16px 5px 16px;
  background: linear-gradient(135deg, var(--rose), #ef7b70);
  color: #fff;
  box-shadow: 0 6px 16px rgba(224, 82, 109, 0.22);
}

.msg-meta {
  margin-top: 3px;
  font-size: 7.5px;
  color: var(--muted);
  padding: 0 3px;
}

.msg.right .msg-meta {
  text-align: right;
}

.msg-meta .read {
  color: var(--rose);
  font-weight: 600;
}

.recall {
  width: fit-content;
  margin: 8px auto;
  padding: 4px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 8px;
}

[data-theme="dark"] .recall {
  background: rgba(255, 255, 255, 0.06);
}

.typing {
  width: fit-content;
  margin: 4px 0 8px 33px;
  padding: 6px 10px;
  border-radius: 11px;
  background: var(--card);
  color: var(--muted);
  font-size: 8px;
  box-shadow: 0 3px 9px rgba(70, 30, 42, 0.05);
}

.typing i {
  font-style: normal;
  color: var(--rose);
  letter-spacing: 1px;
  animation: blink 1.1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.composer-wrap {
  flex: none;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 7px 7px 8px;
}

.composer .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.composer-input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 11px;
}

.composer textarea {
  width: 100%;
  min-height: 34px;
  max-height: 96px;
  padding: 7px 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  box-shadow: 0 6px 14px rgba(224, 82, 109, 0.28);
}

.send-btn:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.emoji-strip {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.emoji-strip button {
  font-size: 22px;
  padding: 3px 6px;
  flex: none;
}

/* 通讯录 */
.shortcuts {
  display: flex;
  gap: 9px;
  padding: 3px 14px 13px;
}

.shortcut {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border-radius: 17px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  box-shadow: 0 5px 14px rgba(70, 30, 42, 0.05);
}

.shortcut-ic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(224, 82, 109, 0.1);
  color: var(--rose);
  position: relative;
}

.shortcut-label {
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--rose);
  color: #fff;
  font-size: 7px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--card);
}

.section-letter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px 4px;
  color: var(--rose);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.section-letter::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 18px;
}

.contact-row:active {
  background: rgba(224, 82, 109, 0.06);
}

.contact-row .avatar {
  width: 42px;
  height: 42px;
  font-size: 15px;
}

.contact-name {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.online-chip {
  font-size: 7.5px;
  color: #1f8b3b;
  background: rgba(52, 199, 89, 0.12);
  padding: 1px 5px;
  border-radius: 5px;
}

.contact-sign {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 46px 30px;
  text-align: center;
  color: var(--muted);
}

.empty .empty-ic {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(224, 82, 109, 0.1);
  color: var(--rose);
  display: grid;
  place-items: center;
}

.empty b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 5px;
}

.empty span {
  font-size: 10.5px;
  line-height: 1.6;
}

/* 发现 / 朋友圈 */
.cover {
  position: relative;
  margin: 4px 14px 12px;
  height: 138px;
  border-radius: 23px;
  overflow: hidden;
  box-shadow: var(--shadow);
  flex: none;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 8, 12, 0.08), rgba(22, 8, 14, 0.78));
}

.cover-text {
  position: absolute;
  left: 17px;
  bottom: 15px;
  right: 100px;
  color: #fff;
  z-index: 1;
}

.cover-text b {
  display: block;
  font-size: 21px;
  letter-spacing: 1px;
  font-weight: 900;
}

.cover-text span {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  opacity: 0.88;
}

.cover-btn {
  position: absolute;
  right: 14px;
  bottom: 15px;
  z-index: 1;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #2a1b20;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
}

.quick {
  flex: 1;
  background: var(--card);
  border-radius: 15px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--rose);
  box-shadow: 0 4px 12px rgba(70, 30, 42, 0.045);
}

.quick span {
  font-size: 8.5px;
  color: var(--ink);
}

.moment {
  margin: 0 14px 11px;
  padding: 13px 13px 9px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 7px 18px rgba(70, 30, 42, 0.06);
}

.moment-head {
  display: flex;
  gap: 9px;
}

.moment-head .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.moment-main {
  flex: 1;
  min-width: 0;
}

.moment-name {
  color: var(--rose);
  font-size: 11.5px;
  font-weight: 700;
}

.moment-time {
  margin-left: auto;
  font-size: 8px;
  color: var(--muted);
}

.moment-text {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.moment-images {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.moment-images.one {
  grid-template-columns: 1fr;
}

.moment-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: var(--bg);
}

.moment-images.one img {
  aspect-ratio: 4 / 3;
}

.moment-place {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
}

.moment-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 7px;
}

.moment-action {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 9px;
}

.moment-action.on {
  color: var(--rose);
}

.moment-comments {
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 9.5px;
  line-height: 1.5;
}

.moment-comments .who {
  color: var(--rose);
  font-weight: 600;
}

/* 我 */
.profile-hero {
  position: relative;
  margin: 4px 14px 12px;
  padding: 20px 18px;
  border-radius: 23px;
  background:
    radial-gradient(300px 200px at 100% 0%, rgba(242, 193, 78, 0.4), transparent 70%),
    linear-gradient(135deg, #ff9a8b, #ff6a88 50%, #c86dd7);
  color: #fff;
  box-shadow: 0 18px 40px rgba(150, 50, 90, 0.28);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 13px;
}

.profile-hero::after {
  content: "♥";
  position: absolute;
  right: -8px;
  top: -36px;
  font-size: 130px;
  opacity: 0.1;
}

.profile-hero .avatar {
  width: 64px;
  height: 64px;
  font-size: 24px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #ffb199, #ff6a88);
}

.profile-name {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.profile-id {
  margin-top: 2px;
  font-size: 9px;
  opacity: 0.82;
}

.profile-sign {
  margin-top: 6px;
  font-size: 10.5px;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  display: flex;
  margin: 0 14px 11px;
  padding: 14px 0;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 6px 16px rgba(70, 30, 42, 0.05);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.stat span {
  font-size: 9px;
  color: var(--muted);
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.group-label {
  padding: 6px 22px 4px;
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.4px;
}

.menu {
  margin: 0 14px 11px;
  background: var(--card);
  border-radius: 19px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(70, 30, 42, 0.05);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.menu-row:last-child {
  border-bottom: 0;
}

.menu-row:active {
  background: rgba(224, 82, 109, 0.05);
}

.menu-ic {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--rose);
  background: rgba(224, 82, 109, 0.09);
}

.menu-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 12.5px;
}

.menu-sub {
  font-size: 8.5px;
  color: var(--muted);
  margin-top: 1px;
}

.chev {
  color: var(--muted);
  opacity: 0.5;
}

.footer-mark {
  text-align: center;
  padding: 16px 0 8px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.6;
}

.footer-mark .mini-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  margin: 0 auto 7px;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
}

/* 弹层 / 操作表 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.overlay.open {
  display: block;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 12, 17, 0.45);
  animation: fade-in 0.18s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 25px 25px 0 0;
  background: var(--card);
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px rgba(30, 10, 18, 0.25);
  animation: sheet-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sheet-up {
  from { transform: translateY(30px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.sheet-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
}

.sheet-profile {
  text-align: center;
  margin-bottom: 8px;
}

.sheet-profile .avatar {
  width: 76px;
  height: 76px;
  font-size: 28px;
  margin: 0 auto 10px;
}

.sheet-profile h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.sheet-profile p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.sheet-actions {
  display: flex;
  gap: 9px;
  margin: 16px 0 12px;
}

.sheet-btn {
  flex: 1;
  height: 44px;
  border-radius: 13px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sheet-btn.primary {
  background: linear-gradient(135deg, var(--rose), var(--coral));
  color: #fff;
  box-shadow: 0 8px 18px rgba(224, 82, 109, 0.24);
}

.sheet-info {
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.action-list {
  margin-top: 4px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
  width: 100%;
}

.action-item:last-child {
  border-bottom: 0;
}

.action-item.danger {
  color: #d4384f;
}

.action-item .ic {
  color: var(--muted);
}

.action-item.danger .ic {
  color: #d4384f;
}

.sheet textarea {
  width: 100%;
  min-height: 100px;
  max-height: 200px;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
  resize: none;
  font-size: 13px;
  line-height: 1.5;
}

.image-picker {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0 8px;
}

.image-pick {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
}

.image-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-pick.on {
  border-color: var(--rose);
}

.image-pick .tick {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  color: #fff;
}

.sheet-hint {
  color: var(--muted);
  font-size: 9.5px;
  margin: 6px 0 2px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  max-width: 78vw;
  padding: 9px 14px;
  border-radius: 11px;
  background: rgba(30, 18, 24, 0.92);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 80;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .topbar-title {
    font-size: 18px;
  }

  .hero {
    padding: 13px 13px;
  }

  .hero-title {
    font-size: 13.5px;
  }

  .hero-btn {
    display: none;
  }

  .chat-name,
  .contact-name {
    font-size: 13px;
  }

  .msg-col {
    max-width: 74%;
  }
}

.chat-row {
  width: calc(100% - 16px);
  text-align: left;
}

.contact-row {
  width: 100%;
  text-align: left;
}

.image-pick .tick {
  display: none;
}

.image-pick.on .tick {
  display: grid;
}
