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

:root {
  --pink: #f9b8c8;
  --pink-light: #fde8ef;
  --pink-mid: #f2a0b5;
  --pink-deep: #e07898;
  --white: #fff;
  --text: #5a3a45;
  --text-light: #b88898;
  --radius: 20px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  background: var(--pink-light);
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text);
  overflow: hidden;
}

.page {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.page.active { display: flex; }

.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 110px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-scroll::-webkit-scrollbar { display: none; }

/* ---- 个人卡片：banner + 头像嵌入 ---- */
.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  box-shadow: 0 2px 16px #f2a0b520;
}
.profile-banner {
  background: var(--pink-light);
  height: 80px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--white);
  cursor: pointer;
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 12px #f2a0b530;
  z-index: 2;
}
.avatar { width: 100%; height: 100%; object-fit: cover; }
.profile-body {
  padding: 56px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-row { display: flex; gap: 12px; align-items: center; justify-content: center; }
.profile-ip, .profile-id {
  font-size: 13px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.profile-bio {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  background: var(--pink-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 60px;
  cursor: pointer;
}
.profile-deco {
  font-size: 12px;
  color: var(--pink-deep);
  text-align: center;
  letter-spacing: 2px;
  cursor: pointer;
}
.deco-bar { display: flex; align-items: center; gap: 8px; }
.deco-time {
  font-size: 12px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
}
.deco-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 11px;
  background: var(--pink);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.deco-text-bar {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  letter-spacing: 1px;
  cursor: pointer;
}

/* ---- 2x2 网格 ---- */
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.grid-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  overflow: hidden;
}

/* 备忘录：上粉下白 */
.memo-card { padding: 0; }
.memo-header {
  background: var(--pink-light);
  padding: 14px 16px 10px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.memo-body {
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.big-num { font-size: 40px; font-weight: 700; color: var(--pink); line-height: 1; }
.memo-line {
  font-size: 11px;
  color: var(--text-light);
  border-bottom: 1px solid var(--pink-light);
  padding-bottom: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 在一起天数卡 */
.couple-card { align-items: center; justify-content: center; padding: 16px; }
.mini-avatars { display: flex; justify-content: center; }
.mini-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -8px;
  object-fit: cover;
}
.mini-av:first-child { margin-left: 0; }
.mini-id { font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; text-align: center; }
.mini-sub { font-size: 11px; color: var(--text-light); cursor: pointer; text-align: center; }

/* 设置/美化独立格子 */
.func-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  cursor: pointer;
  transition: background .15s;
}
.func-card:active { background: var(--pink-light); }
.func-label { font-size: 15px; color: var(--pink-deep); font-weight: 500; }

/* ---- Tab Bar：INS胶囊风 ---- */
.tab-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  height: 64px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 40px;
  box-shadow: 0 4px 24px rgba(90,58,69,.13);
  padding: 6px 8px;
  border: none;
}
.tab-btn {
  width: 80px; height: 52px;
  border: none; background: transparent; color: #bbb;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; border-radius: 32px;
  transition: background .18s, color .18s;
  font-size: 11px; font-family: inherit;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { background: var(--pink-light); color: var(--pink-deep); }

/* ---- 占位页 ---- */
.placeholder-page {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; font-size: 20px; color: var(--text-light);
  padding-bottom: 80px;
}
.placeholder-page small { font-size: 13px; }

/* ---- 内联编辑框 ---- */
.edit-input {
  background: var(--pink-light);
  border: 1.5px solid var(--pink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  outline: none;
}

/* ========== 聊天页 ========== */
#page-chat { background: var(--pink-light); }
.chat-header {
  height: 56px; background: var(--white);
  border-bottom: 1px solid var(--pink-light);
  display: flex; align-items: center;
  padding: 0 8px 0 4px; flex-shrink: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
}
.back-btn {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--pink-deep); display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 50%;
}
.back-btn svg { width: 22px; height: 22px; }
.chat-name { flex: 1; font-size: 17px; font-weight: 600; color: var(--text); padding-left: 2px; }
.msg-list {
  flex: 1; overflow-y: auto;
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.msg-list::-webkit-scrollbar { display: none; }
.time-label { text-align: center; font-size: 11px; color: var(--text-light); margin: 8px 0; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.msg-row.right { flex-direction: row-reverse; }
.msg-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--white); }
.bubble-wrap { display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 100px); }
.msg-row.right .bubble-wrap { align-items: flex-end; }
.msg-row.left .bubble-wrap { align-items: flex-start; }
.bubble {
  padding: 10px 14px; border-radius: 18px;
  font-size: 15px; line-height: 1.5; word-break: break-word; max-width: 100%;
  position: relative; user-select: none;
}
.bubble.right { background: var(--pink); color: var(--text); border-bottom-right-radius: 4px; }
.bubble.left { background: var(--white); color: var(--text); border-bottom-left-radius: 4px; }
.bubble-wrap .bubble.right:not(:last-child) { border-radius: 18px; }
.bubble-wrap .bubble.left:not(:last-child) { border-radius: 18px; }
.img-bubble { padding: 4px; }
.msg-img { max-width: 180px; border-radius: 14px; display: block; }
.input-bar {
  background: var(--white); border-top: 1px solid var(--pink-light);
  display: flex; align-items: center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  gap: 6px; flex-shrink: 0;
}
.tool-btn {
  width: 38px; height: 38px; border: none; background: var(--pink-light);
  border-radius: 50%; color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn.active { background: var(--pink); color: var(--white); }
.msg-input {
  flex: 1; height: 38px; border: 1.5px solid var(--pink); border-radius: 20px;
  padding: 0 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--pink-light); outline: none;
}
.msg-input::placeholder { color: var(--text-light); }
.send-btn {
  width: 38px; height: 38px; border: none; background: var(--pink-deep);
  border-radius: 50%; color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:active { background: var(--pink-mid); }
.sticker-panel, .extra-panel {
  background: var(--white); border-top: 1px solid var(--pink-light);
  border-radius: 20px 20px 0 0; flex-shrink: 0;
  max-height: 0; overflow: hidden; transition: max-height .28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sticker-panel.open, .extra-panel.open { max-height: 320px; }
.sp-handle { width: 36px; height: 4px; background: var(--pink-light); border-radius: 2px; margin: 10px auto 0; }
.sp-top { padding: 8px 12px 0; }
.sp-search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sp-search-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--pink-light); border-radius: 20px; padding: 0 12px; gap: 6px;
}
.sp-search-wrap svg { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }
.sp-search { flex: 1; border: none; background: transparent; font-size: 14px; font-family: inherit; color: var(--text); outline: none; padding: 8px 0; }
.sp-search::placeholder { color: var(--text-light); }
.sp-action { font-size: 14px; color: var(--pink-deep); cursor: pointer; white-space: nowrap; }
.sp-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab { padding: 5px 14px; border-radius: 16px; font-size: 13px; color: var(--text-light); border: none; background: transparent; cursor: pointer; white-space: nowrap; font-family: inherit; border-bottom: 2px solid transparent; }
.sp-tab.active { color: var(--pink-deep); border-bottom-color: var(--pink-deep); font-weight: 600; }
.sp-add-tab { color: var(--text-light); font-size: 16px; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px 12px; overflow-y: auto; max-height: 140px; }
.sp-grid::-webkit-scrollbar { display: none; }
.sp-cell { aspect-ratio: 1; border: none; background: var(--pink-light); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .1s; }
.sp-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sp-cell:active { background: var(--pink); }
.sp-upload { flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-light); }
.sp-upload svg { width: 22px; height: 22px; }
.sp-bottom-tabs { display: flex; align-items: center; border-top: 1px solid var(--pink-light); padding: 6px 16px; position: relative; }
.spb { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-light); cursor: pointer; font-family: inherit; padding: 4px 0; }
.spb svg { width: 22px; height: 22px; }
.spb.active { color: var(--pink-deep); }
.sp-orb { position: absolute; right: 14px; bottom: 10px; width: 40px; height: 40px; background: var(--pink); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--white); box-shadow: 0 2px 8px #f2a0b540; }
.extra-list { overflow-y: auto; max-height: 260px; padding: 4px 0 8px; }
.extra-list::-webkit-scrollbar { display: none; }
.extra-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; cursor: pointer; transition: background .1s; }
.extra-row:active { background: var(--pink-light); }
.extra-row + .extra-row { border-top: 1px solid var(--pink-light); }
.extra-ico { width: 40px; height: 40px; background: var(--pink-light); border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.extra-ico svg { width: 20px; height: 20px; color: var(--pink-deep); }
.extra-row span { font-size: 15px; color: var(--text); }
.bubble-menu { position: fixed; z-index: 200; background: var(--white); border-radius: 12px; box-shadow: 0 4px 24px rgba(90,58,69,.18); display: none; overflow: hidden; min-width: 200px; }
.bubble-menu.show { display: flex; }
.bubble-menu button { flex: 1; border: none; background: transparent; padding: 14px 0; font-size: 14px; color: var(--text); cursor: pointer; font-family: inherit; border-right: 1px solid var(--pink-light); }
.bubble-menu button:last-child { border-right: none; }
.bubble-menu button:active { background: var(--pink-light); }
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); background: rgba(90,58,69,.82); color: #fff; font-size: 13px; padding: 8px 20px; border-radius: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; white-space: nowrap; z-index: 300; }
.toast.show { opacity: 1; }

:root {
  --pink: #f9b8c8;
  --pink-light: #fde8ef;
  --pink-mid: #f2a0b5;
  --pink-deep: #e07898;
  --white: #fff;
  --text: #5a3a45;
  --text-light: #b88898;
  --radius: 20px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  background: var(--pink-light);
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text);
  overflow: hidden;
}

.page {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.page.active { display: flex; }

.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 110px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-scroll::-webkit-scrollbar { display: none; }

/* ---- 个人卡片：banner + 头像嵌入 ---- */
.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  box-shadow: 0 2px 16px #f2a0b520;
}
.profile-banner {
  background: var(--pink-light);
  height: 80px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--white);
  cursor: pointer;
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 12px #f2a0b530;
  z-index: 2;
}
.avatar { width: 100%; height: 100%; object-fit: cover; }
.profile-body {
  padding: 56px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.profile-row { display: flex; gap: 12px; align-items: center; justify-content: center; }
.profile-ip, .profile-id {
  font-size: 13px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.profile-bio {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  background: var(--pink-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 60px;
  cursor: pointer;
}
.profile-deco {
  font-size: 12px;
  color: var(--pink-deep);
  text-align: center;
  letter-spacing: 2px;
  cursor: pointer;
}
.deco-bar { display: flex; align-items: center; gap: 8px; }
.deco-time {
  font-size: 12px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
}
.deco-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: 11px;
  background: var(--pink);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.deco-text-bar {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  letter-spacing: 1px;
  cursor: pointer;
}

/* ---- 2x2 网格 ---- */
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.grid-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  overflow: hidden;
}

/* 备忘录：上粉下白 */
.memo-card { padding: 0; }
.memo-header {
  background: var(--pink-light);
  padding: 14px 16px 10px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.memo-body {
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.big-num { font-size: 40px; font-weight: 700; color: var(--pink); line-height: 1; }
.memo-line {
  font-size: 11px;
  color: var(--text-light);
  border-bottom: 1px solid var(--pink-light);
  padding-bottom: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 在一起天数卡 */
.couple-card { align-items: center; justify-content: center; padding: 16px; }
.mini-avatars { display: flex; justify-content: center; }
.mini-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -8px;
  object-fit: cover;
}
.mini-av:first-child { margin-left: 0; }
.mini-id { font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; text-align: center; }
.mini-sub { font-size: 11px; color: var(--text-light); cursor: pointer; text-align: center; }

/* 设置/美化独立格子 */
.func-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  cursor: pointer;
  transition: background .15s;
}
.func-card:active { background: var(--pink-light); }
.func-label { font-size: 15px; color: var(--pink-deep); font-weight: 500; }

/* ---- Tab Bar：INS胶囊风 ---- */
.tab-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  height: 64px;
  background: var(--white);
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 40px;
  box-shadow: 0 4px 24px rgba(90,58,69,.13);
  padding: 6px 8px;
  border: none;
}
.tab-btn {
  width: 80px; height: 52px;
  border: none; background: transparent; color: #bbb;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; border-radius: 32px;
  transition: background .18s, color .18s;
  font-size: 11px; font-family: inherit;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { background: var(--pink-light); color: var(--pink-deep); }

/* ---- 占位页 ---- */
.placeholder-page {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; font-size: 20px; color: var(--text-light);
  padding-bottom: 80px;
}
.placeholder-page small { font-size: 13px; }

/* ---- 内联编辑框 ---- */
.edit-input {
  background: var(--pink-light);
  border: 1.5px solid var(--pink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  outline: none;
}

/* ========== 聊天页 ========== */
#page-chat { background: var(--pink-light); }
.chat-header {
  height: 56px; background: var(--white);
  border-bottom: 1px solid var(--pink-light);
  display: flex; align-items: center;
  padding: 0 8px 0 4px; flex-shrink: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
}
.back-btn {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--pink-deep); display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 50%;
}
.back-btn svg { width: 22px; height: 22px; }
.chat-name { flex: 1; font-size: 17px; font-weight: 600; color: var(--text); padding-left: 2px; }
.msg-list {
  flex: 1; overflow-y: auto;
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
}
.msg-list::-webkit-scrollbar { display: none; }
.time-label { text-align: center; font-size: 11px; color: var(--text-light); margin: 8px 0; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.msg-row.right { flex-direction: row-reverse; }
.msg-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--white); }
.bubble-wrap { display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 100px); }
.msg-row.right .bubble-wrap { align-items: flex-end; }
.msg-row.left .bubble-wrap { align-items: flex-start; }
.bubble {
  padding: 10px 14px; border-radius: 18px;
  font-size: 15px; line-height: 1.5; word-break: break-word; max-width: 100%;
  position: relative; user-select: none;
}
.bubble.right { background: var(--pink); color: var(--text); border-bottom-right-radius: 4px; }
.bubble.left { background: var(--white); color: var(--text); border-bottom-left-radius: 4px; }
.bubble-wrap .bubble.right:not(:last-child) { border-radius: 18px; }
.bubble-wrap .bubble.left:not(:last-child) { border-radius: 18px; }
.img-bubble { padding: 4px; }
.msg-img { max-width: 180px; border-radius: 14px; display: block; }
.input-bar {
  background: var(--white); border-top: 1px solid var(--pink-light);
  display: flex; align-items: center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  gap: 6px; flex-shrink: 0;
}
.tool-btn {
  width: 38px; height: 38px; border: none; background: var(--pink-light);
  border-radius: 50%; color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn.active { background: var(--pink); color: var(--white); }
.msg-input {
  flex: 1; height: 38px; border: 1.5px solid var(--pink); border-radius: 20px;
  padding: 0 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--pink-light); outline: none;
}
.msg-input::placeholder { color: var(--text-light); }
.send-btn {
  width: 38px; height: 38px; border: none; background: var(--pink-deep);
  border-radius: 50%; color: var(--white);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer;
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:active { background: var(--pink-mid); }
.sticker-panel, .extra-panel {
  background: var(--white); border-top: 1px solid var(--pink-light);
  border-radius: 20px 20px 0 0; flex-shrink: 0;
  max-height: 0; overflow: hidden; transition: max-height .28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sticker-panel.open, .extra-panel.open { max-height: 320px; }
.sp-handle { width: 36px; height: 4px; background: var(--pink-light); border-radius: 2px; margin: 10px auto 0; }
.sp-top { padding: 8px 12px 0; }
.sp-search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sp-search-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--pink-light); border-radius: 20px; padding: 0 12px; gap: 6px;
}
.sp-search-wrap svg { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }
.sp-search { flex: 1; border: none; background: transparent; font-size: 14px; font-family: inherit; color: var(--text); outline: none; padding: 8px 0; }
.sp-search::placeholder { color: var(--text-light); }
.sp-action { font-size: 14px; color: var(--pink-deep); cursor: pointer; white-space: nowrap; }
.sp-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab { padding: 5px 14px; border-radius: 16px; font-size: 13px; color: var(--text-light); border: none; background: transparent; cursor: pointer; white-space: nowrap; font-family: inherit; border-bottom: 2px solid transparent; }
.sp-tab.active { color: var(--pink-deep); border-bottom-color: var(--pink-deep); font-weight: 600; }
.sp-add-tab { color: var(--text-light); font-size: 16px; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px 12px; overflow-y: auto; max-height: 140px; }
.sp-grid::-webkit-scrollbar { display: none; }
.sp-cell { aspect-ratio: 1; border: none; background: var(--pink-light); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .1s; }
.sp-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sp-cell:active { background: var(--pink); }
.sp-upload { flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-light); }
.sp-upload svg { width: 22px; height: 22px; }
.sp-bottom-tabs { display: flex; align-items: center; border-top: 1px solid var(--pink-light); padding: 6px 16px; position: relative; }
.spb { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-light); cursor: pointer; font-family: inherit; padding: 4px 0; }
.spb svg { width: 22px; height: 22px; }
.spb.active { color: var(--pink-deep); }
.sp-orb { position: absolute; right: 14px; bottom: 10px; width: 40px; height: 40px; background: var(--pink); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--white); box-shadow: 0 2px 8px #f2a0b540; }
.extra-list { overflow-y: auto; max-height: 260px; padding: 4px 0 8px; }
.extra-list::-webkit-scrollbar { display: none; }
.extra-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; cursor: pointer; transition: background .1s; }
.extra-row:active { background: var(--pink-light); }
.extra-row + .extra-row { border-top: 1px solid var(--pink-light); }
.extra-ico { width: 40px; height: 40px; background: var(--pink-light); border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.extra-ico svg { width: 20px; height: 20px; color: var(--pink-deep); }
.extra-row span { font-size: 15px; color: var(--text); }
.bubble-menu { position: fixed; z-index: 200; background: var(--white); border-radius: 12px; box-shadow: 0 4px 24px rgba(90,58,69,.18); display: none; overflow: hidden; min-width: 200px; }
.bubble-menu.show { display: flex; }
.bubble-menu button { flex: 1; border: none; background: transparent; padding: 14px 0; font-size: 14px; color: var(--text); cursor: pointer; font-family: inherit; border-right: 1px solid var(--pink-light); }
.bubble-menu button:last-child { border-right: none; }
.bubble-menu button:active { background: var(--pink-light); }
.toast { position: fixed; bottom: 120px; left: 50%; transform: translateX(-50%); background: rgba(90,58,69,.82); color: #fff; font-size: 13px; padding: 8px 20px; border-radius: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; white-space: nowrap; z-index: 300; }
.toast.show { opacity: 1; }

:root {
  --pink: #f9b8c8;
  --pink-light: #fde8ef;
  --pink-mid: #f2a0b5;
  --pink-deep: #e07898;
  --white: #fff;
  --text: #5a3a45;
  --text-light: #b88898;
  --radius: 20px;
  --radius-sm: 12px;
  --tab-h: 72px;
}

html, body {
  height: 100%;
  background: var(--pink-light);
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', sans-serif;
  color: var(--text);
  overflow: hidden;
}

.page {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.page.active { display: flex; }

.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 110px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.home-scroll::-webkit-scrollbar { display: none; }

/* ---- 个人卡片 banner+头像嵌入 ---- */
.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  box-shadow: 0 2px 16px #f2a0b520;
}

.profile-banner {
  background: var(--pink-light);
  height: 80px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.avatar-wrap {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--white);
  cursor: pointer;
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 12px #f2a0b530;
  z-index: 2;
}
.avatar { width: 100%; height: 100%; object-fit: cover; }

.profile-body {
  padding: 56px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-row { display: flex; gap: 12px; align-items: center; justify-content: center; }

.profile-ip, .profile-id {
  font-size: 13px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}

.profile-bio {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  background: var(--pink-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 60px;
  cursor: pointer;
}

.profile-deco {
  font-size: 12px;
  color: var(--pink-deep);
  text-align: center;
  letter-spacing: 2px;
  cursor: pointer;
}

.deco-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deco-time {
  font-size: 12px;
  color: var(--text-light);
  background: var(--pink-light);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
}

.deco-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  font-size: 11px;
  background: var(--pink);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
}

.deco-text-bar {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  letter-spacing: 1px;
  cursor: pointer;
}

/* ---- 2x2 网格 ---- */
.grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  overflow: hidden;
}

/* 备忘录：上粉下白 */
.memo-card { padding: 0; }
.memo-header {
  background: var(--pink-light);
  padding: 14px 16px 10px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.memo-body {
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.big-num {
  font-size: 40px;
  font-weight: 700;
  color: var(--pink);
  line-height: 1;
}

.memo-line {
  font-size: 11px;
  color: var(--text-light);
  border-bottom: 1px solid var(--pink-light);
  padding-bottom: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 在一起天数卡 */
.couple-card {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mini-avatars { display: flex; justify-content: center; }

.mini-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--white);
  margin-left: -8px;
  object-fit: cover;
}
.mini-av:first-child { margin-left: 0; }

.mini-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.mini-sub {
  font-size: 11px;
  color: var(--text-light);
  cursor: pointer;
  text-align: center;
}

/* 设置/美化独立格子 */
.func-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px #f2a0b520;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  cursor: pointer;
  transition: background .15s;
}
.func-card:active { background: var(--pink-light); }
.func-label {
  font-size: 15px;
  color: var(--pink-deep);
  font-weight: 500;
}

.tab-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: 64px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 40px;
  box-shadow: 0 4px 24px rgba(90,58,69,.13);
  padding: 6px 8px;
  padding-bottom: 6px;
  border: none;
}

.tab-btn {
  width: 80px;
  height: 52px;
  border: none;
  background: transparent;
  color: #bbb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  border-radius: 32px;
  transition: background .18s, color .18s;
  font-size: 11px;
  font-family: inherit;
}
.tab-btn svg { width: 22px; height: 22px; }

.tab-btn:nth-child(2) {
  width: 80px;
  height: 52px;
  background: transparent;
  color: #bbb;
  border-radius: 32px;
  box-shadow: none;
  margin-bottom: 0;
}
.tab-btn:nth-child(2) svg { width: 22px; height: 22px; }
.tab-btn:nth-child(2).active { background: var(--pink-light); color: var(--pink-deep); }

.tab-btn.active {
  background: var(--pink-light);
  color: var(--pink-deep);
}

.placeholder-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  color: var(--text-light);
  padding-bottom: var(--tab-h);
}
.placeholder-page small { font-size: 13px; }

.edit-input {
  background: var(--pink-light);
  border: 1.5px solid var(--pink);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: inherit;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  outline: none;
}

/* ========== 聊天页 ========== */
#page-chat { background: var(--pink-light); }

.chat-header {
  position: relative;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--pink-light);
  display: flex;
  align-items: center;
  padding: 0 8px 0 4px;
  flex-shrink: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
}
.back-btn {
  width: 44px; height: 44px;
  border: none; background: transparent;
  color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 50%;
}
.back-btn svg { width: 22px; height: 22px; }
.chat-name {
  flex: 1; font-size: 17px; font-weight: 600; color: var(--text); padding-left: 2px;
}

.msg-list {
  flex: 1; overflow-y: auto;
  padding: 12px 12px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.msg-list::-webkit-scrollbar { display: none; }
.time-label {
  text-align: center; font-size: 11px; color: var(--text-light); margin: 8px 0;
}
.msg-row {
  display: flex; align-items: flex-end; gap: 8px; max-width: 100%;
}
.msg-row.right { flex-direction: row-reverse; }
.msg-av {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; border: 2px solid var(--white);
}
.bubble-wrap {
  display: flex; flex-direction: column; gap: 4px;
  max-width: calc(100% - 100px);
}
.msg-row.right .bubble-wrap { align-items: flex-end; }
.msg-row.left .bubble-wrap { align-items: flex-start; }
.bubble {
  padding: 10px 14px; border-radius: 18px;
  font-size: 15px; line-height: 1.5; word-break: break-word; max-width: 100%;
  position: relative; user-select: none;
}
.bubble.right { background: var(--pink); color: var(--text); border-bottom-right-radius: 4px; }
.bubble.left { background: var(--white); color: var(--text); border-bottom-left-radius: 4px; }
.bubble-wrap .bubble.right:not(:last-child) { border-radius: 18px; }
.bubble-wrap .bubble.left:not(:last-child) { border-radius: 18px; }
.img-bubble { padding: 4px; }
.msg-img { max-width: 180px; border-radius: 14px; display: block; }

/* 输入栏 */
.input-bar {
  background: var(--white); border-top: 1px solid var(--pink-light);
  display: flex; align-items: center;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  gap: 6px; flex-shrink: 0;
  transition: margin-bottom .25s;
}
.tool-btn {
  width: 38px; height: 38px; border: none;
  background: var(--pink-light); border-radius: 50%;
  color: var(--pink-deep);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.tool-btn svg { width: 20px; height: 20px; }
.tool-btn.active { background: var(--pink); color: var(--white); }
.msg-input {
  flex: 1; height: 38px;
  border: 1.5px solid var(--pink); border-radius: 20px;
  padding: 0 14px; font-size: 15px; font-family: inherit;
  color: var(--text); background: var(--pink-light); outline: none;
}
.msg-input::placeholder { color: var(--text-light); }
.send-btn {
  width: 38px; height: 38px; border: none;
  background: var(--pink-deep); border-radius: 50%;
  color: var(--white); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:active { background: var(--pink-mid); }

/* 贴图面板 */
.sticker-panel, .extra-panel {
  background: var(--white);
  border-top: 1px solid var(--pink-light);
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sticker-panel.open, .extra-panel.open { max-height: 320px; }

.sp-handle {
  width: 36px; height: 4px; background: var(--pink-light);
  border-radius: 2px; margin: 10px auto 0;
}

.sp-top { padding: 8px 12px 0; }
.sp-search-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.sp-search-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--pink-light); border-radius: 20px;
  padding: 0 12px; gap: 6px;
}
.sp-search-wrap svg { width: 16px; height: 16px; color: var(--text-light); flex-shrink: 0; }
.sp-search {
  flex: 1; border: none; background: transparent;
  font-size: 14px; font-family: inherit; color: var(--text);
  outline: none; padding: 8px 0;
}
.sp-search::placeholder { color: var(--text-light); }
.sp-action { font-size: 14px; color: var(--pink-deep); cursor: pointer; white-space: nowrap; }

.sp-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px;
}
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab {
  padding: 5px 14px; border-radius: 16px; font-size: 13px;
  color: var(--text-light); border: none; background: transparent;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  border-bottom: 2px solid transparent;
}
.sp-tab.active { color: var(--pink-deep); border-bottom-color: var(--pink-deep); font-weight: 600; }
.sp-add-tab { color: var(--text-light); font-size: 16px; }

.sp-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 8px 12px;
  overflow-y: auto; max-height: 140px;
}
.sp-grid::-webkit-scrollbar { display: none; }
.sp-cell {
  aspect-ratio: 1; border: none; background: var(--pink-light);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.sp-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sp-cell:active { background: var(--pink); }
.sp-upload {
  flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-light);
}
.sp-upload svg { width: 22px; height: 22px; }

/* 底部两tab */
.sp-bottom-tabs {
  display: flex; align-items: center;
  border-top: 1px solid var(--pink-light);
  padding: 6px 16px;
  position: relative;
}
.spb {
  flex: 1; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--text-light); cursor: pointer; font-family: inherit;
  padding: 4px 0;
}
.spb svg { width: 22px; height: 22px; }
.spb.active { color: var(--pink-deep); }
.sp-orb {
  position: absolute; right: 14px; bottom: 10px;
  width: 40px; height: 40px; background: var(--pink);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--white); box-shadow: 0 2px 8px #f2a0b540;
}

/* 颜文字grid（复用sp-grid，用js切换内容） */

/* 其他功能列表面板 */
.extra-list {
  overflow-y: auto; max-height: 260px; padding: 4px 0 8px;
}
.extra-list::-webkit-scrollbar { display: none; }
.extra-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  cursor: pointer; transition: background .1s;
}
.extra-row:active { background: var(--pink-light); }
.extra-row + .extra-row { border-top: 1px solid var(--pink-light); }
.extra-ico {
  width: 40px; height: 40px; background: var(--pink-light);
  border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.extra-ico svg { width: 20px; height: 20px; color: var(--pink-deep); }
.extra-row span { font-size: 15px; color: var(--text); }

/* 气泡菜单 */
.bubble-menu {
  position: fixed; z-index: 200;
  background: var(--white); border-radius: 12px;
  box-shadow: 0 4px 24px rgba(90,58,69,.18);
  display: none; gap: 0; overflow: hidden;
  min-width: 200px;
}
.bubble-menu.show { display: flex; }
.bubble-menu button {
  flex: 1; border: none; background: transparent;
  padding: 14px 0; font-size: 14px; color: var(--text);
  cursor: pointer; font-family: inherit;
  border-right: 1px solid var(--pink-light);
}
.bubble-menu button:last-child { border-right: none; }
.bubble-menu button:active { background: var(--pink-light); }

/* Toast */
.toast {
  position: fixed; bottom: 120px;
  left: 50%; transform: translateX(-50%);
  background: rgba(90,58,69,.82); color: #fff;
  font-size: 13px; padding: 8px 20px; border-radius: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  white-space: nowrap; z-index: 300;
}
.toast.show { opacity: 1; }