:root {
  --pink: #ff6b9d;
  --pink-soft: #ff9a9e;
  --violet: #a18cd1;
  --ink: #432c3b;
  --ink-2: #7d5a6d;
  --line: #f2dbe5;
  --card: rgba(255, 255, 255, 0.92);
  --danger: #ff4d6d;
  --ok: #22c55e;
  --shadow: 0 18px 50px rgba(190, 90, 140, 0.16);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 85% -10%, var(--pink-soft) 0%, transparent 55%),
    radial-gradient(900px 600px at -10% 90%, var(--violet) 0%, transparent 55%),
    linear-gradient(160deg, #fff5f8, #f4ecff);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.hidden { display: none !important; }
.scrollable { overflow-y: auto; overscroll-behavior: contain; }

.page { display: flex; justify-content: center; }

.view {
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
}

.view-enter {
  animation: llViewIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes llViewIn {
  from { opacity: 0; transform: translateY(12px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------- 通用组件 ---------------- */

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.btn-primary, .btn-secondary {
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  color: #fff;
  transition: transform 0.08s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--pink), #ff8fb2); box-shadow: 0 8px 22px rgba(255, 107, 157, 0.35); }
.btn-secondary { background: linear-gradient(135deg, #b497ff, #8f7bff); box-shadow: 0 8px 22px rgba(148, 122, 255, 0.3); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-1px); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.6; cursor: default; }

.btn-ghost, .text-btn, .danger-link {
  border: 0;
  background: transparent;
  color: var(--ink-2);
}
.danger-link { color: var(--danger); font-size: 13px; text-decoration: underline; }
.text-btn { font-size: 14px; color: var(--ink-2); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff0f5, #ffe9f2);
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(255, 130, 170, 0.25);
  user-select: none;
}
.avatar.sm { width: 38px; height: 38px; font-size: 20px; }
.avatar.lg { width: 74px; height: 74px; font-size: 40px; }
.avatar.xl { width: 108px; height: 108px; font-size: 58px; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #fff;
  background: #d6c4cc;
}
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16); }

.badge {
  min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 0 5px;
  margin-left: 6px;
}

/* ---------------- 底部导航 ---------------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - 24px);
  z-index: 80;
  display: flex;
  align-items: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(25px);
  -webkit-backdrop-filter: saturate(180%) blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(180, 90, 140, 0.16);
}

.tab-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 88px;
  background: #1d1d1f;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  z-index: 1;
  pointer-events: none;
  will-change: left;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn {
  position: relative;
  z-index: 2;
  width: 88px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: #99999e;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.25s ease, transform 0.08s ease;
}
.tab-btn:active { transform: scale(0.96); }
.tab-icon-wrap { position: relative; display: inline-flex; }
.tab-btn .tab-icon { width: 20px; height: 20px; fill: currentColor; display: block; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.tab-btn.active { color: #ffffff; }
.tab-btn.active .tab-icon { transform: scale(1.08); }
.tab-unread {
  position: absolute;
  top: -4px;
  right: -7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

body.logged-in .home-body,
body.logged-in .page-shell .scrollable {
  padding-bottom: 96px;
}

/* ---------------- 通用页面头 ---------------- */

.page-head {
  padding: max(18px, env(safe-area-inset-top)) 20px 4px;
}
.page-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 1px;
}
.page-sub {
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 4px;
}

.home-page-sub {
  margin: 0 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ---------------- 信息页 ---------------- */

.conversation-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.conversation-row:active { transform: scale(0.985); }
.conversation-avatar { position: relative; flex-shrink: 0; line-height: 0; }
.conversation-avatar .avatar { width: 52px; height: 52px; font-size: 28px; }
.conversation-avatar .dot { position: absolute; right: 0; bottom: 2px; }
.conversation-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.conversation-top,
.conversation-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.conversation-name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-time { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.conversation-preview {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-arrow { color: #d8c1cd; font-size: 22px; line-height: 1; flex-shrink: 0; }
.messages-call-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------------- 聊天页顶部通话入口 ---------------- */

.chat-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-call-btn { width: 36px; height: 36px; }

/* ---------------- 通话页 ---------------- */

.empty-icon { font-size: 52px; margin-bottom: 6px; animation: floaty 3s ease-in-out infinite; }
.call-page-card { text-align: center; margin-top: 18px; padding: 26px 20px; }
.call-page-partner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call-page-name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.call-page-status { font-size: 13px; color: var(--ok); }
.call-page-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}
.call-big-btn {
  border: 0;
  border-radius: 22px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
  transition: transform 0.08s ease;
}
.call-big-btn:active { transform: scale(0.96); }
.call-big-btn.voice { background: linear-gradient(150deg, #6ec6ff, #3aa6ff); box-shadow: 0 10px 24px rgba(70, 160, 255, 0.28); }
.call-big-btn.video { background: linear-gradient(150deg, var(--pink), #b86bff); box-shadow: 0 10px 24px rgba(255, 107, 157, 0.30); }
.call-big-btn .cbb-icon { font-size: 34px; }
.call-big-btn:disabled { opacity: 0.55; }

/* ---------------- 我的页 ---------------- */

.me-edit-card { margin-top: 18px; display: flex; flex-direction: column; }
.me-avatar-center { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; }
.avatar-tip { font-size: 12px; color: var(--ink-2); }
.me-edit-card .avatar-picker { justify-content: center; margin-bottom: 16px; }
.me-edit-card .btn-primary { margin-top: 4px; }
.account-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.account-line .account-value { color: var(--ink); font-weight: 600; }
.me-actions {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 24px 0 8px;
}
.me-actions .danger-link { font-size: 14px; text-decoration: none; }

.security-card { margin-top: 16px; padding: 10px 18px; }
.security-title { font-size: 13px; color: var(--ink-2); font-weight: 700; margin: 6px 0 4px; }
.security-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  padding: 13px 0;
}
.security-row.static { border-bottom: 0; }
.row-arrow { color: #c3a3b2; font-size: 20px; }
.row-value { color: var(--ink-2); font-size: 12px; max-width: 60%; text-align: right; overflow-wrap: anywhere; }

.modal-form { text-align: left; margin: 14px 0 4px; }
.modal-form .field { margin-bottom: 10px; }
.modal-form .form-error { margin: 0 0 4px; }
.modal-btn-row { display: flex; gap: 10px; }
.modal-btn-row .half { flex: 1; padding: 11px 8px; font-size: 14px; }

/* ---------------- 登录页 ---------------- */

.view-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 36px 26px 24px;
  min-height: 0;
  backdrop-filter: blur(12px);
}

.auth-logo { font-size: 56px; animation: floaty 3s ease-in-out infinite; }
.auth-logo-wrap {
  display: flex;
  justify-content: center;
}
.auth-logo-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 6px;
  animation: floaty 3s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.auth-title { margin: 8px 0 2px; font-size: 30px; letter-spacing: 3px; }
.auth-title span { font-size: 14px; letter-spacing: 1px; color: var(--ink-2); font-weight: 400; margin-left: 8px; }
.auth-sub { color: var(--ink-2); margin: 4px 0 24px; font-size: 14px; }

.mode-tabs {
  display: flex;
  background: #fbeef4;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.mode-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 0;
  transition: all 0.2s ease;
}
.mode-tab.active {
  background: #fff;
  color: var(--pink);
  box-shadow: 0 3px 10px rgba(255, 130, 170, 0.2);
}

.auth-form { text-align: left; }
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin: 0 0 6px 4px;
  font-weight: 500;
}
.field input, .code-input, .msg-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .code-input:focus, .msg-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.12);
}

.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-picker .pick {
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #fff4f8;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.avatar-picker .pick.active { border-color: var(--pink); background: #ffe7f0; transform: scale(1.06); }

.form-error {
  color: var(--danger);
  font-size: 13px;
  background: rgba(255, 77, 109, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 2px 0 12px;
}

.auth-form .btn-primary { width: 100%; margin-top: 4px; }
.privacy-note { margin: 20px 0 0; font-size: 11px; color: #b293a3; }
.auth-cs-btn {
  display: block;
  margin: 12px auto 0;
  font-size: 13px;
  color: var(--pink);
  text-decoration: underline;
}

/* ---------------- 首页 ---------------- */

.home-shell { height: 100dvh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 18px 10px;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: 1px; }
.site-logo {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 2px;
  vertical-align: -7px;
}

.home-body { flex: 1; padding: 10px 18px max(24px, env(safe-area-inset-bottom)); }
.pair-card { text-align: center; }
.pair-card h2 { margin: 4px 0 10px; font-size: 19px; }
.hint { color: var(--ink-2); font-size: 13px; line-height: 1.7; margin: 0 0 16px; }

.code-wrap { margin-top: 16px; }
.invite-code {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 10px;
  font-variant-numeric: tabular-nums;
  color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  text-align: center;
  margin: 8px 0;
}
.code-wrap .btn-ghost { font-size: 13px; text-decoration: underline; }

.or-divider { display: flex; align-items: center; gap: 12px; color: #c3a3b2; font-size: 12px; margin: 18px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: #f0dbe6; }

.inline-form { display: flex; gap: 8px; }
.inline-form .code-input {
  text-align: center;
  font-size: 20px;
  letter-spacing: 7px;
  font-weight: 700;
  flex: 1;
}
.inline-form .btn-primary { padding: 12px 18px; white-space: nowrap; }

.us-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.me-card, .partner-card { text-align: center; padding: 18px 8px; }
.heart-between { font-size: 28px; animation: beat 1.3s ease-in-out infinite; }
.role-tag {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 8px;
  background: #fdf0f6;
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
}
.name { font-weight: 700; margin-top: 9px; overflow-wrap: anywhere; }
.partner-head { display: inline-block; position: relative; }
.partner-head .dot { position: absolute; right: 2px; bottom: 5px; }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
}

.love-days { text-align: center; margin-top: 16px; padding: 18px 20px; }
.days-label { font-size: 13px; color: var(--ink-2); }
.days-num { font-size: 34px; font-weight: 800; margin: 4px 0 2px; color: var(--pink); }
.online-text { font-size: 13px; color: var(--ok); }

.big-action { position: relative; width: 100%; margin-top: 18px; }

.call-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.shortcut-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.shortcut-btn:active { transform: scale(0.97); }
.sc-icon { font-size: 24px; }

#unbindBtn { display: block; margin: 22px auto 0; }

/* ---------------- 聊天页 ---------------- */

.chat-shell { height: 100dvh; }
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
}
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(190, 90, 140, 0.12);
  color: var(--pink);
  transition: transform 0.08s ease;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.chat-partner { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.chat-partner-text { min-width: 0; }
.chat-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-status { font-size: 12px; color: var(--ink-2); }
.chat-status.typing { color: var(--pink); }

.chat-actions { display: flex; gap: 6px; }
.chat-actions .icon-btn { background: linear-gradient(135deg, #fff, #ffeef5); }

.chat-msgs {
  flex: 1;
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-sep {
  align-self: center;
  font-size: 11px;
  color: #b797a7;
  background: rgba(255, 255, 255, 0.65);
  padding: 4px 12px;
  border-radius: 999px;
  margin: 12px 0 4px;
}

.msg-row { display: flex; align-items: flex-end; gap: 7px; animation: msgIn 0.2s ease; max-width: 82%; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.partner { align-self: flex-start; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.msg-row .mini-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}
.mini-avatar img,
.replay-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.msg-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg-row.me .msg-bubble {
  background: linear-gradient(135deg, var(--pink), #ff88b0);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg-row.partner .msg-bubble {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(190, 90, 140, 0.10);
  border-bottom-left-radius: 6px;
}
.msg-time { font-size: 10px; color: #b293a3; margin-top: 3px; text-align: right; padding: 0 4px; }

.heart-msg .msg-bubble {
  background: transparent !important;
  box-shadow: none !important;
  font-size: 34px;
  padding: 0;
  text-align: center;
  animation: pulseHeart 1s ease-in-out infinite;
}
@keyframes pulseHeart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.msg-row .msg-bubble.media-bubble {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  white-space: normal;
}
.chat-media-img {
  display: block;
  width: min(240px, 64vw);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(120, 60, 100, 0.16);
}
.chat-media-video {
  display: block;
  width: min(268px, 74vw);
  max-height: 320px;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 6px 18px rgba(120, 60, 100, 0.16);
}
.voice-msg-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  cursor: pointer;
  user-select: none;
}
.voice-msg-bubble.playing .voice-play-icon { animation: voicePulse 1s infinite; }
@keyframes voicePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.voice-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
}
.voice-bars i {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}
.voice-bars i:nth-child(2) { height: 10px; }
.voice-bars i:nth-child(3) { height: 6px; }
.voice-bars i:nth-child(4) { height: 14px; }
.voice-msg-bubble.playing .voice-bars i {
  animation: voiceWave 0.7s ease-in-out infinite alternate;
}
.voice-msg-bubble.playing .voice-bars i:nth-child(2) { animation-delay: 0.12s; }
.voice-msg-bubble.playing .voice-bars i:nth-child(3) { animation-delay: 0.24s; }
.voice-msg-bubble.playing .voice-bars i:nth-child(4) { animation-delay: 0.36s; }
@keyframes voiceWave {
  from { height: 4px; }
  to { height: 16px; }
}
.voice-duration {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  margin-left: 3px;
}
.msg-row.me .voice-bars i { background: #fff; }
.msg-row.partner .voice-bars i { background: #777; }
.sticker-bubble {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 58px;
  line-height: 1;
}
.msg-row .msg-bubble.sticker-bubble { background: transparent !important; }

.typing-tip {
  padding: 0 18px 5px;
  font-size: 12px;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 5px;
}
.typing-tip span {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: blinkDot 1s infinite;
}
.typing-tip span:nth-child(2) { animation-delay: 0.2s; }
.typing-tip span:nth-child(3) { animation-delay: 0.4s; }

.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}
.msg-input { flex: 1; border-radius: 999px; }
.composer-heart, .send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.composer-heart { background: #fff2f7; font-size: 22px; transition: transform 0.1s ease; }
.composer-heart:active { transform: scale(0.86); }
.composer-media-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pink-2);
  transition: transform 0.08s ease, background 0.2s ease;
}
.composer-media-btn svg { width: 22px; height: 22px; }
.composer-media-btn:active { transform: scale(0.86); background: #f4eefb; }
.composer-media-btn.voice-active {
  background: #ffe6ef;
  color: var(--pink);
}
.voice-hold {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.voice-hold.recording {
  background: #ffe6ef;
  color: var(--pink);
  border-color: var(--pink);
}
.emoji-panel {
  max-height: 250px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 8px 4px;
  overflow-y: auto;
}
.emoji-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.emoji-tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
}
.emoji-tab.active { background: #ffe9f2; color: var(--pink); font-weight: 600; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 24px;
  border-radius: 8px;
  padding: 5px 0;
}
.emoji-grid button:active { background: #f6edf2; transform: scale(1.1); }
.sticker-grid { grid-template-columns: repeat(4, 1fr); }
.sticker-grid button {
  font-size: 42px;
  height: 68px;
  background: #fff;
  border: 1px solid #f2e4eb;
  border-radius: 12px;
}
.chat-plus-panel {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 8px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.chat-plus-panel button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}
.chat-plus-panel button span {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff4f8;
  border-radius: 14px;
  font-size: 26px;
}
.chat-plus-panel button:active span { background: #ffe7f0; transform: scale(0.94); }
.chat-plus-panel em { font-style: normal; }
.send-btn {
  background: linear-gradient(135deg, var(--pink), #ff8fb2);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.35);
}
.send-btn svg { width: 20px; height: 20px; fill: #fff; stroke: #fff; stroke-width: 0.4; }

/* ---------------- 爱心飘屏 ---------------- */

.burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}
.burst-heart {
  position: absolute;
  bottom: -40px;
  animation: floatUp 2.6s ease-in forwards;
  will-change: transform, opacity;
  text-shadow: 0 4px 18px rgba(255, 90, 140, 0.35);
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(-115vh) scale(1.15) rotate(var(--rot, 12deg)); opacity: 0; }
}

/* ---------------- 通话浮层 ---------------- */

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 130, 170, 0.55), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(161, 140, 209, 0.5), transparent 45%),
    linear-gradient(160deg, #2b1a2b, #171022);
  color: #fff;
  overflow: hidden;
}

.call-video-stage { position: absolute; inset: 0; z-index: 0; }
.call-video-stage video { display: none; pointer-events: none; }
.call-overlay.video-mode .call-video-stage video { display: block; width: 100%; height: 100%; object-fit: cover; }
#localVideo {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 116px;
  height: 160px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  background: #000;
  z-index: 3;
  pointer-events: none;
  transform: scaleX(-1);
}
#remoteAudio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.call-info {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: max(30px, env(safe-area-inset-top));
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.call-overlay.video-mode .call-info { position: absolute; left: 0; right: 0; top: 0; padding: 120px 0 0; pointer-events: none; }
.call-overlay.video-mode .call-info .avatar { width: 82px; height: 82px; font-size: 44px; }
.call-name { font-size: 25px; font-weight: 700; letter-spacing: 1px; max-width: 80%; overflow-wrap: anywhere; }
.call-status { font-size: 15px; opacity: 0.85; min-height: 22px; font-variant-numeric: tabular-nums; }

.call-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 10px 20px max(32px, env(safe-area-inset-bottom));
  background: rgba(15, 8, 18, 0.28);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.call-btn {
  width: 78px;
  border: 0;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
  transition: transform 0.08s ease, background 0.2s ease;
}
.call-btn:active { transform: scale(0.94); }
.call-btn .cb-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255,255,255,0.12); }
.call-btn.accept .cb-icon { background: var(--ok); }
.call-btn.reject .cb-icon, .call-btn.hangup .cb-icon { background: var(--danger); }
.call-btn.off .cb-icon { background: rgba(255, 255, 255, 0.08); opacity: 0.55; }
.call-btn.off { opacity: 0.7; }

.ring-pulse { animation: ringPulse 1.5s ease-out infinite; }
@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
  100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0); }
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 38px;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(30, 20, 30, 0.9);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 86vw;
  text-align: center;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 账号提示弹窗 ---------------- */

.app-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(35, 18, 32, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  backdrop-filter: blur(4px);
}
.app-modal-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 22px 60px rgba(0,0,0,0.25);
  padding: 28px 24px 22px;
  text-align: center;
}
.app-modal-icon { font-size: 44px; }
.app-modal-card h3 { margin: 10px 0 8px; font-size: 18px; }
.app-modal-card p { color: var(--ink-2); font-size: 14px; line-height: 1.7; margin: 0 0 16px; }
.cs-card {
  background: #fff4f8;
  border: 1px solid #f6d9e6;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 18px;
}
.cs-label { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.app-modal-card .btn-primary { width: 100%; }

/* 桌面端美化 */
@media (min-width: 760px) {
  .page { padding: 0; }
  .shell { box-shadow: 0 0 80px rgba(200, 130, 170, 0.18); border-left: 1px solid rgba(255,255,255,0.55); border-right: 1px solid rgba(255,255,255,0.55); }
}

/* ==================================================
   首页：情侣头像条 + 参考站时光卡（复刻至 lgnewui-day-wrapper 结束）
   ================================================== */

.home-lovers-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 18px 16px 14px;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(190, 90, 140, 0.12);
  text-align: center;
}

.home-lovers-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
  width: 100%;
}

.home-lover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 64px;
}

.home-lover-avatar {
  width: 58px;
  height: 58px;
  font-size: 30px;
}

.home-lover-avatar-wrap {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.home-lover-avatar-wrap .dot {
  position: absolute;
  right: -2px;
  bottom: 1px;
}

.home-lover-name {
  max-width: 96px;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-lovers-heart {
  margin-top: 16px;
  font-size: 24px;
  animation: beat 1.3s ease-in-out infinite;
}

.home-online-text {
  font-size: 12px;
  color: var(--ok);
}

/* ---- 参考站时光卡 ---- */

.lgnewui-day-wrapper {
  --ll-day-card-bg: rgba(255, 255, 255, 0.88);
  --ll-day-text-main: #2d3748;
  --ll-day-text-sub: #718096;
  --ll-day-text-light: #a0aec0;
  --ll-day-accent: #e53e3e;
  --ll-day-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  --ll-day-font-cn-serif: Georgia, "Songti SC", "Noto Serif SC", "STSong", serif;
  --ll-day-font-nums: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, ui-monospace, monospace;
  width: 100%;
  box-sizing: border-box;
  margin: 16px auto 0;
  animation: ll-home-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes ll-home-rise {
  0% { opacity: 0; transform: translateY(10px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.lgnewui-day-fusion-card {
  background-color: var(--ll-day-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 46px 28px 34px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 10px 20px -10px rgba(0, 0, 0, 0.04);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 34px;
  overflow: hidden;
  border: 1px solid rgba(227, 227, 227, 0.6);
  text-align: center;
}

.lgnewui-day-ambient-light {
  position: absolute;
  bottom: -150px;
  right: -100px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.45) 0%, rgba(230, 230, 250, 0.28) 40%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  filter: blur(58px);
  z-index: 0;
  pointer-events: none;
}

.lgnewui-day-mac-dots {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 7px;
  z-index: 10;
}

.lgnewui-day-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.lgnewui-day-dot-red { background-color: #ff5f57; }
.lgnewui-day-dot-yellow { background-color: #ffbd2e; }
.lgnewui-day-dot-green { background-color: #28c840; }

.lgnewui-day-left-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.lgnewui-day-title-container {
  margin-bottom: 26px;
  text-align: left;
}

.lgnewui-day-poetic-title {
  font-family: var(--ll-day-font-cn-serif);
  font-size: 25px;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.6;
  letter-spacing: 0.05em;
  margin: 0;
}

.lgnewui-day-start-date-capsule {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 5px 12px 5px 5px;
  border-radius: 50px;
  gap: 10px;
  width: fit-content;
  transition: all 0.3s ease;
  cursor: default;
}

.lgnewui-day-start-date-capsule:hover {
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.lgnewui-day-icon-circle {
  width: 28px;
  height: 28px;
  background-color: var(--ll-day-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 93, 122, 0.32);
}

.lgnewui-day-icon-circle svg {
  width: 15px;
  height: 15px;
  animation: lgnewui-day-heartbeat 2s infinite ease-in-out;
}

.lgnewui-day-timer-val.lgnewui-day-anim-active {
  animation: lgnewui-day-silky-reveal 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes lgnewui-day-silky-reveal {
  0% { opacity: 0; transform: translateY(5px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lgnewui-day-heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

.lgnewui-day-date-text-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  justify-content: center;
}

.lgnewui-day-date-label-small {
  font-family: var(--ll-day-font-ui);
  font-size: 9px;
  color: var(--ll-day-text-light);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.lgnewui-day-date-value-clean {
  font-family: var(--ll-day-font-nums);
  font-size: 14px;
  font-weight: 600;
  color: var(--ll-day-text-sub);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.lgnewui-day-right-section {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.lgnewui-day-main-days-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.lgnewui-day-main-days-number {
  font-family: var(--ll-day-font-nums);
  font-variant-numeric: tabular-nums;
  font-size: 6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #1a202c 0%, #4a5568 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #1a202c;
  display: inline-block;
}

.lgnewui-day-days-divider {
  width: 40px;
  height: 4px;
  background-color: var(--ll-day-accent);
  border-radius: 2px;
  margin: 5px auto 10px;
}

.lgnewui-day-days-label {
  font-family: var(--ll-day-font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--ll-day-text-light);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  margin-right: -0.4em;
}

.lgnewui-day-digital-timer {
  display: flex;
  gap: 26px;
  justify-content: center;
}

.lgnewui-day-timer-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lgnewui-day-timer-val {
  font-family: var(--ll-day-font-nums);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 600;
  color: var(--ll-day-text-main);
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.lgnewui-day-timer-label {
  margin-top: 8px;
  font-family: var(--ll-day-font-ui);
  font-size: 10px;
  color: var(--ll-day-text-light);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

@media (max-width: 480px) {
  .lgnewui-day-fusion-card {
    padding: 42px 22px 30px;
  }
  .lgnewui-day-main-days-number {
    font-size: 20vw;
  }
  .lgnewui-day-digital-timer {
    gap: 20px;
  }
  .lgnewui-day-timer-val {
    font-size: 24px;
  }
}

@media (min-width: 768px) {
  .lgnewui-day-fusion-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 48px 54px;
    gap: 42px;
    text-align: left;
  }
  .lgnewui-day-left-section {
    align-items: flex-start;
  }
  .lgnewui-day-title-container { margin-bottom: 0; }
  .lgnewui-day-right-section { align-items: flex-end; }
  .lgnewui-day-digital-timer { justify-content: flex-end; }
}

/* ==================================================
   首页：背景轮播 hero
   ================================================== */

.home-hero {
  position: relative;
  height: 330px;
  min-height: 300px;
  margin-top: 8px;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 18px 44px rgba(120, 60, 100, 0.24);
  -webkit-tap-highlight-color: transparent;
}

.home-hero-slides {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  background-size: cover;
  background-position: center;
  will-change: opacity, transform;
}

.home-hero-slide.active {
  opacity: 1;
  animation: home-hero-kenburns 18s ease-in-out infinite alternate;
}

.home-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes home-hero-kenburns {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

/* 场景 1：暮色霞光 */
.home-bg-sunset {
  background:
    radial-gradient(circle at 70% 26%, rgba(255, 247, 214, 0.96) 0 46px, rgba(255, 247, 214, 0) 48px),
    radial-gradient(circle at 18% 76%, rgba(255, 255, 255, 0.28) 0 90px, rgba(255, 255, 255, 0) 91px),
    linear-gradient(178deg, #ffdde9 0%, #ffb3ab 48%, #f76d6d 100%);
}

.home-bg-sunset::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -24%;
  height: 55%;
  background: linear-gradient(180deg, rgba(116, 38, 60, 0) 0%, rgba(116, 38, 60, 0.55) 100%);
  clip-path: polygon(0 42%, 12% 25%, 24% 45%, 38% 18%, 52% 42%, 65% 28%, 78% 46%, 90% 24%, 100% 42%, 100% 100%, 0 100%);
}

/* 场景 2：星光夜色 */
.home-bg-starry {
  background:
    radial-gradient(1.5px 1.5px at 18% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 32% 66%, #ffe9f2, transparent),
    radial-gradient(1.5px 1.5px at 55% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 74% 42%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 70%, #ffe9f2, transparent),
    radial-gradient(2px 2px at 42% 46%, #ffffffcc, transparent),
    linear-gradient(176deg, #191245 0%, #35206a 48%, #6b3f96 100%);
}

.home-bg-starry::before {
  content: "";
  position: absolute;
  top: 16%;
  right: 18%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #fffdf0 0 12px, #f9eecb 13px 19px, rgba(249, 238, 203, 0) 20px);
  box-shadow: 0 0 34px rgba(255, 241, 190, 0.65);
}

.home-bg-starry::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(42, 20, 84, 0) 0%, rgba(20, 10, 52, 0.68) 100%);
  clip-path: polygon(0 52%, 14% 30%, 29% 56%, 44% 22%, 60% 58%, 75% 34%, 90% 60%, 100% 44%, 100% 100%, 0 100%);
}

/* 场景 3：海风晨光 */
.home-bg-seaside {
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.9) 0 30px, rgba(255, 255, 255, 0) 31px),
    radial-gradient(circle at 30% 72%, rgba(255, 255, 255, 0.2) 0 110px, rgba(255, 255, 255, 0) 111px),
    linear-gradient(176deg, #a8e6ff 0%, #7fd8ff 42%, #6ec6ff 60%, #ffc9e2 100%);
}

.home-bg-seaside::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background: linear-gradient(178deg, rgba(50, 122, 175, 0.12) 0%, rgba(50, 122, 175, 0.34) 52%, rgba(32, 92, 140, 0.58) 100%);
  clip-path: polygon(0 30%, 10% 62%, 22% 34%, 34% 70%, 46% 38%, 60% 74%, 72% 44%, 84% 68%, 100% 40%, 100% 100%, 0 100%);
}

/* 场景 4：花海梦境 */
.home-bg-blossom {
  background:
    radial-gradient(7px 7px at 16% 24%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(6px 6px at 28% 18%, #ffe3f0, transparent),
    radial-gradient(8px 8px at 62% 28%, #fff, transparent),
    radial-gradient(7px 7px at 78% 20%, #ffe3f0, transparent),
    radial-gradient(9px 9px at 42% 34%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(8px 8px at 88% 40%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(6px 6px at 52% 22%, rgba(255, 255, 255, 0.7), transparent),
    linear-gradient(176deg, #ffe0ef 0%, #dcc8ff 55%, #9d8bff 100%);
}

.home-bg-blossom::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -32%;
  height: 60%;
  background: radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.22) 0 46px, rgba(255, 255, 255, 0) 48px),
    radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.18) 0 52px, rgba(255, 255, 255, 0) 54px),
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.22) 0 42px, rgba(255, 255, 255, 0) 44px);
  clip-path: polygon(0 62%, 14% 28%, 28% 66%, 42% 34%, 56% 70%, 70% 38%, 84% 72%, 100% 42%, 100% 100%, 0 100%);
}

.home-hero-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.16) 48%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
}

.home-hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  pointer-events: none;
}

.home-hero-couple {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
}

.home-hero-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  min-width: 76px;
}

.home-hero-avatar {
  width: 72px;
  height: 72px;
  font-size: 38px;
  border-width: 3px;
  box-shadow: 0 8px 24px rgba(40, 20, 60, 0.28);
}

.home-hero-avatar-wrap {
  position: relative;
  display: inline-flex;
  line-height: 0;
}

.home-hero-avatar-wrap .dot {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.home-hero-heart {
  margin-top: 22px;
  font-size: 26px;
  filter: drop-shadow(0 4px 10px rgba(180, 30, 90, 0.35));
  animation: beat 1.3s ease-in-out infinite;
}

.home-hero-name {
  max-width: 104px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hero-online {
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.home-hero-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.home-hero-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.home-hero-dot.active {
  width: 20px;
  background: #fff;
}

@media (max-width: 480px) {
  .home-hero {
    height: 300px;
  }
  .home-hero-avatar {
    width: 64px;
    height: 64px;
    font-size: 34px;
  }
}

/* ==================================================
   信息页：对话回放入口
   ================================================== */

.replay-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(190, 90, 140, 0.08);
  color: var(--ink);
  text-align: left;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}

.replay-entry:active {
  transform: scale(0.985);
  box-shadow: 0 4px 14px rgba(190, 90, 140, 0.12);
}

.replay-entry-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1d1d1f 0%, #4b5563 100%);
  box-shadow: 0 6px 16px rgba(29, 29, 31, 0.2);
}

.replay-entry-icon svg {
  width: 21px;
  height: 21px;
}

.replay-entry-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.replay-entry-title {
  font-size: 15px;
  font-weight: 700;
}

.replay-entry-sub {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-entry-arrow {
  font-size: 22px;
  color: #d8c1cd;
}

/* ==================================================
   对话回放页（参考 about.php 聊天设备效果）
   ================================================== */

.replay-shell {
  position: relative;
  height: 100dvh;
}

.replay-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  z-index: 5;
}

.replay-body {
  flex: 1;
  padding: 18px 16px 108px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 214, 229, 0.55) 0 90px, rgba(255, 255, 255, 0) 92px),
    radial-gradient(circle at 92% 88%, rgba(216, 204, 255, 0.5) 0 130px, rgba(255, 255, 255, 0) 132px),
    linear-gradient(180deg, #fbf6fa 0%, #f4f0fb 100%);
}

.replay-loading {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-2);
  font-size: 13px;
}

.replay-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  animation: replay-dot 1.1s ease-in-out infinite;
}

.replay-loading span:nth-child(2) { animation-delay: 0.15s; }
.replay-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes replay-dot {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

.replay-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 16px;
}

.replay-notice::before,
.replay-notice::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1));
}

.replay-notice::after {
  background: linear-gradient(to left, transparent, rgba(0, 0, 0, 0.1));
}

.replay-notice span {
  background: rgba(0, 0, 0, 0.04);
  color: #a1a1a6;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.replay-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 9px 0;
  max-width: 88%;
  animation: replay-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes replay-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.replay-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(180, 90, 140, 0.12);
}

.replay-row .replay-bubble {
  max-width: 76%;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 20px;
  overflow-wrap: anywhere;
  transition: transform 0.1s;
}

.replay-row.partner {
  align-self: flex-start;
  justify-content: flex-start;
}

.replay-row.partner .replay-bubble {
  background: #ffffff;
  color: #1d1d1f;
  border-bottom-left-radius: 4px;
}

.replay-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.replay-row.mine .replay-bubble {
  background: #007aff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.replay-row.mine .replay-bubble.replay-heart {
  background: linear-gradient(135deg, #ff6b9d, #ff8fb2);
  box-shadow: 0 6px 18px rgba(255, 107, 157, 0.28);
}

.replay-row.partner .replay-bubble.replay-heart {
  background: linear-gradient(135deg, #ff8fb2, #ffb3c6);
}

.replay-row .replay-bubble.replay-media-bubble {
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden;
}
.replay-media-img {
  display: block;
  width: min(220px, 58vw);
  border-radius: 16px;
}
.replay-media-video {
  display: block;
  width: min(250px, 68vw);
  max-height: 300px;
  border-radius: 16px;
  background: #000;
}
.replay-row .replay-bubble.replay-sticker-bubble {
  padding: 0;
  background: transparent !important;
  font-size: 58px;
  line-height: 1;
}

.replay-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 12px;
  background: #fff;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
}

.replay-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.replay-typing i:nth-child(1) { animation-delay: -0.32s; }
.replay-typing i:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.replay-console {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(120, 60, 100, 0.16);
  z-index: 20;
}

.replay-ctl-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #333;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.08s ease, background 0.2s ease;
}

.replay-ctl-btn svg {
  width: 18px;
  height: 18px;
}

.replay-ctl-btn:active {
  transform: scale(0.9);
}

.replay-ctl-btn.replay-ctl-main {
  width: 46px;
  height: 46px;
  background: #1d1d1f;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

#replaySpeedBtn {
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}

/* ---- 信息页内联对话回放（自动播放，不跳转新页面） ---- */

#view-messages .home-body {
  display: flex;
  flex-direction: column;
}

#messages-bound {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.replay-inline {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  margin: 12px 0 20px;
  padding: 16px 14px 12px;
  overflow: hidden;
  height: min(520px, max(320px, calc(100dvh - 350px)));
}

.replay-inline-head {
  text-align: left;
  margin-bottom: 4px;
}

.replay-inline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}

.replay-inline-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-2);
}

.lgnewui-replay-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 18px 18px 0 0;
  margin-top: 10px;
}

.lgnewui-replay-avatar {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.lgnewui-replay-header-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lgnewui-replay-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: #1d1d1f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lgnewui-replay-status {
  font-size: 12px;
  color: #8e8e93;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}

.lgnewui-chat-status-dot {
  width: 8px;
  height: 8px;
  background: #34c759;
  border-radius: 50%;
  flex-shrink: 0;
}

.replay-inline-status {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pink);
}

.replay-body-inline {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  margin: 12px 0 2px;
  padding: 20px 14px 24px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 0 0 18px 18px;
  background: #f5f5f7;
  scrollbar-width: none;
}

.replay-body-inline .replay-loading {
  min-height: 90px;
}

.replay-console-inline {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: auto;
  min-width: 250px;
  justify-content: center;
  margin-top: 8px;
  align-self: center;
  justify-content: space-between;
  gap: 2px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 26px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
}

.replay-console-inline .replay-ctl-btn {
  width: 40px;
  height: 40px;
}

.replay-console-inline .replay-ctl-btn.replay-ctl-main {
  width: 44px;
  height: 44px;
}

.replay-console-inline .replay-ctl-main.paused {
  background: #ff2d55;
  animation: pulse-pink 2s infinite;
}

@keyframes pulse-pink {
  0% { box-shadow: 0 0 0 0 rgba(255, 45, 85, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 45, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 85, 0); }
}

/* ==================================================
   我的页（微信式整洁列表 + 编辑资料内页）
   ================================================== */

.me-profile-row {
  width: 100%;
  padding: 18px 16px;
  margin-top: 0;
}

.me-list-avatar {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  font-size: 30px;
}

.wechat-me-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid #f5edf1;
  font-size: 14px;
}

button.wechat-me-row {
  cursor: pointer;
}

.wechat-me-row:active {
  background: #faf2f6;
}

.wechat-me-row.static {
  cursor: default;
}

.wechat-me-row.danger .me-row-name {
  color: var(--danger);
  text-align: center;
}

.wechat-me-row.danger {
  justify-content: center;
}

.me-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.me-row-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-row-sub {
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-row-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 17px;
  background: #f7f0f4;
}
.me-row-icon svg { width: 19px; height: 19px; }

.me-list-group {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #f3e9ee;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(190, 90, 140, 0.06);
}

.me-list-group .wechat-me-row:last-child {
  border-bottom: 0;
}

.me-list-actions {
  margin-bottom: 8px;
}

.profile-edit-title {
  font-size: 16px;
  font-weight: 700;
}

.profile-edit-card {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(190, 90, 140, 0.1);
  padding: 22px 18px 20px;
}

/* ==================================================
   图片 / 视频全屏查看
   ================================================== */

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.media-viewer-body {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mediaViewerIn 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.media-viewer-body img,
.media-viewer-body video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

.media-viewer-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 42px;
  height: 42px;
  z-index: 501;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.media-viewer-close svg {
  width: 21px;
  height: 21px;
}

@keyframes mediaViewerIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 130, 170, 0.4), transparent 42%),
    radial-gradient(circle at 84% 80%, rgba(161, 140, 209, 0.36), transparent 42%),
    linear-gradient(160deg, #fff7fa, #f7f1ff);
}

.boot-loading p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: 1px;
}

.boot-loading-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 107, 157, 0.2);
  border-top-color: var(--pink);
  animation: bootSpin 0.8s linear infinite;
}

@keyframes bootSpin {
  to { transform: rotate(360deg); }
}
