/* ============================================================
   恋爱手账 — design system
   warm cream · rose · soft glass.  Mobile-first, iOS-flavoured.
   ============================================================ */

:root {
  --bg: #fff8f4;
  --bg-deep: #ffefe8;
  --card: #ffffff;
  --card-soft: #fffdfc;
  --line: rgba(150, 84, 106, 0.1);
  --line-strong: rgba(150, 84, 106, 0.18);

  --ink: #2b1f26;
  --ink-2: #6d5a63;
  --ink-3: #a8949d;
  --ink-4: #c9b8bf;

  --rose: #ee5c7c;
  --rose-deep: #d63e63;
  --rose-soft: #ffe4ea;
  --peach: #ffab8f;
  --lav: #b9a5f0;
  --mint: #7fd0bb;
  --amber: #f7b955;

  --grad-hero: linear-gradient(148deg, #ffb096 0%, #f8728c 46%, #e63f6b 100%);
  --grad-rose: linear-gradient(135deg, #ff8fa3, #ee5c7c);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --sh-card: 0 10px 30px -12px rgba(196, 92, 124, 0.22), 0 2px 6px -2px rgba(196, 92, 124, 0.08);
  --sh-hero: 0 22px 44px -20px rgba(226, 62, 100, 0.55), 0 6px 14px -8px rgba(226, 62, 100, 0.3);
  --sh-bar: 0 12px 34px -12px rgba(150, 60, 90, 0.32);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

@media (min-width: 560px) {
  body {
    background:
      radial-gradient(120% 70% at 15% 0%, #ffe7dd 0%, rgba(255, 231, 221, 0) 60%),
      radial-gradient(90% 60% at 100% 10%, #ffe3ef 0%, rgba(255, 227, 239, 0) 55%),
      #f7eee9;
  }
}

button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img { display: block; }
a { color: inherit; }

/* ---------- shell ---------- */

.app {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  background-image:
    radial-gradient(150% 55% at 50% -12%, #fff2ea 0%, rgba(255, 242, 234, 0) 62%),
    radial-gradient(90% 40% at 100% 0%, #ffe9f0 0%, rgba(255, 233, 240, 0) 60%);
  /* `clip` (not `hidden`) — `hidden` would make .app a scroll container and
     break `position: sticky` descendants such as the chat header. */
  overflow-x: clip;
}

@media (min-width: 560px) {
  .app {
    max-width: 440px;
    margin: 28px auto;
    height: calc(100dvh - 56px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 40px;
    box-shadow: 0 40px 90px -40px rgba(120, 50, 70, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    overflow: hidden;
  }
}

.view {
  padding: calc(var(--safe-t) + 8px) 20px calc(var(--tab-h) + var(--safe-b) + 34px);
  animation: pageIn 0.3s ease both;
}

/* Opacity only: any transform here would make .view a containing block and
   break position:fixed children (the floating action button). */
@keyframes pageIn {
  from { opacity: 0; }
}

@media (min-width: 560px) {
  .view {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 20px calc(var(--tab-h) + 40px);
  }
}

/* ---------- type ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.h1 { font-size: 27px; font-weight: 750; letter-spacing: -0.02em; margin: 0; }
.h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.h3 { font-size: 15px; font-weight: 650; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 18px;
}

.topbar .greet-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 3px; letter-spacing: 0.02em; }
.topbar .greet-main { font-size: 25px; font-weight: 750; letter-spacing: -0.025em; }

.pair {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 16px -8px rgba(180, 80, 110, 0.35), 0 0 0 1px rgba(150, 84, 106, 0.06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.pair .avatar { box-shadow: 0 0 0 2px #fff; }
.pair .avatar + .avatar { margin-left: -10px; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 19px;
  background: linear-gradient(140deg, #ffd9c9, #ffb9cb);
  overflow: hidden;
  flex: 0 0 auto;
}
.avatar.sm { width: 30px; height: 30px; font-size: 15px; }
.avatar.lg { width: 62px; height: 62px; font-size: 30px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.you { background: linear-gradient(140deg, #d9d2ff, #b6c8ff); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  color: #fff;
  background: var(--grad-hero);
  box-shadow: var(--sh-hero);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -30%;
  height: 130%;
  background: radial-gradient(50% 50% at 30% 20%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 70%);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  right: -34px; top: -28px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 65%);
  z-index: -1;
}
.hero-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.92;
  display: flex; align-items: center; gap: 6px;
}
.hero-days {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 2px;
}
.hero-days .n {
  font-size: 68px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.055em;
  text-shadow: 0 2px 10px rgba(150, 20, 50, 0.18);
}
.hero-days .u { font-size: 17px; font-weight: 600; opacity: 0.9; }
.hero-sub { font-size: 13.5px; opacity: 0.88; }
.hero-foot {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.hero-foot .cell { flex: 1; min-width: 0; }
.hero-foot .k {
  font-size: 11px; opacity: 0.75; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-foot .v { font-size: 15.5px; font-weight: 680; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- sections ---------- */

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head .h2 { font-size: 17px; }
.link {
  font-size: 13px;
  font-weight: 600;
  color: var(--rose);
  display: inline-flex; align-items: center; gap: 2px;
}

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
}
.row + .row { margin-top: 8px; }
.row .grow { flex: 1; min-width: 0; }
.row .chev { color: var(--ink-4); flex: 0 0 auto; }

.press { transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.16s; }
.press:active { transform: scale(0.975); opacity: 0.9; }

/* ---------- countdown scroll ---------- */

.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 20px 12px;
  margin: 0 -20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.cd {
  scroll-snap-align: start;
  flex: 0 0 auto;
  min-width: 128px;
  padding: 14px 15px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--sh-card);
  position: relative;
  overflow: hidden;
}
.cd .emoji { font-size: 20px; }
.cd .t { font-size: 13.5px; font-weight: 650; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 132px; }
.cd .d { display: flex; align-items: baseline; gap: 3px; margin-top: 3px; color: var(--rose-deep); }
.cd .d b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.cd .d span { font-size: 12px; font-weight: 600; opacity: 0.85; }
.cd .when { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.cd.today { background: var(--grad-rose); color: #fff; }
.cd.today .d, .cd.today .when, .cd.today .t { color: #fff; }
.cd.today .when { opacity: 0.8; }

/* ---------- mood ---------- */

.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px 10px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--sh-card);
  border: 1.5px solid transparent;
  transition: transform 0.16s, border-color 0.2s, background 0.2s;
}
.mood:active { transform: scale(0.95); }
.mood .e { font-size: 24px; line-height: 1; }
.mood .l { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.mood.on { border-color: var(--rose); background: #fff3f5; }
.mood.on .l { color: var(--rose-deep); }

.mood-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px 6px 8px; border-radius: 999px;
  background: #fff; box-shadow: var(--sh-card);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}

/* ---------- timeline ---------- */

.tl-group { margin-bottom: 22px; }
.tl-month {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-3);
}
.tl-month::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.entry {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 15px 16px 14px;
  margin-bottom: 10px;
}
.entry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.entry-day {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 700; color: var(--rose-deep);
  background: var(--rose-soft);
  padding: 3px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.entry-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.entry-text {
  font-size: 14px; line-height: 1.62; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.entry.open .entry-text { -webkit-line-clamp: unset; }
.entry-photos { display: flex; gap: 6px; margin-top: 10px; }
.entry-photos img {
  width: 76px; height: 76px; border-radius: 12px; object-fit: cover;
  background: var(--bg-deep);
}
.entry-photos .more {
  width: 76px; height: 76px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg-deep); color: var(--ink-3); font-weight: 700; font-size: 14px;
}
.entry-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- photo grid ---------- */

.seg {
  display: flex; gap: 2px; padding: 3px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 16px;
}
.seg button {
  flex: 1; padding: 8px 0; border-radius: 999px;
  font-size: 13.5px; font-weight: 650; color: var(--ink-3);
  transition: background 0.22s, color 0.22s, box-shadow 0.22s;
}
.seg button.on {
  background: #fff; color: var(--ink);
  box-shadow: 0 4px 12px -6px rgba(180, 80, 110, 0.4), 0 0 0 1px rgba(150, 84, 106, 0.05);
}

.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pgrid figure {
  position: relative; margin: 0; aspect-ratio: 1;
  border-radius: 12px; overflow: hidden; background: var(--bg-deep);
}
.pgrid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.pgrid figure:active img { transform: scale(1.03); }
.pgrid .daytag {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(6px);
  padding: 2px 6px; border-radius: 6px;
}

/* ---------- chat ---------- */

.chat-page { padding-bottom: 0; }
.chat-list {
  display: flex; flex-direction: column; gap: 3px;
  padding: 6px 0 18px;
}
.msg-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.msg-row.me { flex-direction: row-reverse; }
.msg-col { display: flex; flex-direction: column; max-width: 76%; gap: 4px; }
.msg-row.me .msg-col { align-items: flex-end; }

.bubble {
  padding: 10px 14px;
  border-radius: 19px;
  font-size: 14.5px; line-height: 1.5;
  background: #fff;
  box-shadow: 0 4px 14px -8px rgba(150, 84, 106, 0.3), 0 0 0 1px rgba(150, 84, 106, 0.05);
  word-break: break-word;
  white-space: pre-wrap;
  border-bottom-left-radius: 7px;
}
.msg-row.me .bubble {
  background: var(--grad-rose);
  color: #fff;
  border-bottom-left-radius: 19px;
  border-bottom-right-radius: 7px;
  box-shadow: 0 8px 18px -10px rgba(226, 62, 100, 0.6);
}
.msg-time { font-size: 10.5px; color: var(--ink-4); padding: 0 6px; }

.bubble.voice { display: flex; align-items: center; gap: 9px; min-width: 116px; padding: 11px 14px; }
.bubble.voice .wave { display: flex; align-items: center; gap: 2.5px; height: 18px; }
.bubble.voice .wave i {
  display: block; width: 2.5px; border-radius: 3px;
  background: currentColor; opacity: 0.55;
  animation: wave 1.1s ease-in-out infinite;
}
.bubble.voice .wave i:nth-child(odd) { animation-delay: 0.15s; }
.bubble.voice .wave i:nth-child(3n) { animation-delay: 0.3s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 15px; } }
.bubble.voice .dur { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; opacity: 0.9; }

.chat-inputbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 6px;
  border-radius: 24px;
  background: #fff;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 12px 28px -14px rgba(150, 60, 90, 0.38), 0 0 0 1px rgba(150, 84, 106, 0.07);
}

.cfield {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: flex-end;
  background: #f7f2f4;
  border-radius: 18px;
  padding: 2px 10px 2px 14px;
  transition: background 0.2s, box-shadow 0.2s;
}
.cfield:focus-within { background: #fbf7f8; box-shadow: inset 0 0 0 1.5px rgba(238, 92, 124, 0.35); }
.cfield textarea {
  width: 100%; border: 0; outline: 0; resize: none;
  background: transparent;
  padding: 9px 0;
  font-size: 15px; line-height: 1.35;
  max-height: 96px;
}
.cfield textarea::placeholder { color: var(--ink-4); }
@media (min-width: 560px) {
  .chat-inputbar {
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: 400px;
    bottom: calc(var(--tab-h) + 56px);
  }
}
.chat-inputbar textarea {
  flex: 1; border: 0; outline: 0; resize: none;
  background: transparent;
  padding: 9px 6px 9px 10px;
  font-size: 15px; line-height: 1.35;
  max-height: 108px;
}
.chat-inputbar textarea::placeholder { color: var(--ink-4); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  color: var(--ink-2);
  transition: transform 0.15s, background 0.2s, color 0.2s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn.send { background: var(--grad-rose); color: #fff; box-shadow: 0 8px 16px -8px rgba(226, 62, 100, 0.8); }
.icon-btn.rec { background: #fff; box-shadow: 0 0 0 1.5px var(--line-strong); }
.icon-btn.rec.on { background: var(--rose); color: #fff; box-shadow: 0 0 0 6px rgba(238, 92, 124, 0.18); }

.recording-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 18px;
  background: #fff3f5; border: 1px solid rgba(238, 92, 124, 0.25);
  font-size: 13px; color: var(--rose-deep); font-weight: 600;
  margin-bottom: 10px;
}
.recording-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rose); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.notice {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed var(--line-strong);
  font-size: 11.5px; line-height: 1.55; color: var(--ink-3);
  margin-bottom: 4px;
}

/* ---------- wishes ---------- */

.progress-card { padding: 18px; display: flex; align-items: center; gap: 16px; }
.ring { width: 66px; height: 66px; flex: 0 0 auto; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-weight: 750; color: var(--rose-deep);
}

.wish {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--card); border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  margin-bottom: 8px;
  transition: opacity 0.25s;
}
.wish .box {
  width: 23px; height: 23px; border-radius: 8px; flex: 0 0 auto;
  border: 1.8px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent; margin-top: 1px;
  transition: all 0.2s;
}
.wish.done .box { background: var(--rose); border-color: var(--rose); color: #fff; }
.wish .wt { font-size: 15px; font-weight: 620; line-height: 1.4; }
.wish.done .wt { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.wish .wn { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.wish .wd { font-size: 11px; color: var(--ink-4); margin-top: 6px; }

/* ---------- "us" page ---------- */

.profile-card { padding: 20px; text-align: center; }
.profile-pair { display: flex; align-items: center; justify-content: center; gap: 6px; }
.profile-pair .avatar.lg { box-shadow: 0 8px 20px -10px rgba(180, 70, 100, 0.5); }
.heart-mid { font-size: 20px; margin: 0 2px; opacity: 0.9; }
.profile-names { margin-top: 12px; font-size: 17px; font-weight: 720; letter-spacing: -0.01em; }
.profile-date { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat {
  padding: 13px 6px; border-radius: 16px; background: var(--bg-deep);
  text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 780; letter-spacing: -0.03em; color: var(--rose-deep); }
.stat span { font-size: 11px; color: var(--ink-3); }

.setting-list { margin-top: 10px; }
.setting {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  box-shadow: var(--sh-card);
  width: 100%; text-align: left;
}
.setting .ic {
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 16px;
  background: var(--bg-deep);
}
.setting .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.setting .st { display: block; font-size: 14.5px; font-weight: 600; }
.setting .sd { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.setting .sv { font-size: 13px; color: var(--ink-3); margin-left: auto; }

.footer-note {
  text-align: center; font-size: 11px; color: var(--ink-4);
  margin-top: 26px; line-height: 1.7;
}

/* ---------- tabbar ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 10px);
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 412px;
  height: var(--tab-h);
  display: flex;
  align-items: stretch;
  padding: 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--sh-bar), 0 0 0 1px rgba(150, 84, 106, 0.07);
  z-index: 50;
}
@media (min-width: 560px) {
  .tabbar { position: absolute; bottom: 18px; max-width: 396px; }
}

.tab {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border-radius: 18px;
  color: var(--ink-4);
  transition: color 0.2s, background 0.25s, transform 0.15s;
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: 10px; font-weight: 650; letter-spacing: 0.01em; }
.tab.on { color: var(--rose-deep); background: rgba(238, 92, 124, 0.1); }
.tab:active { transform: scale(0.94); }

/* ---------- FAB ---------- */

.fab {
  position: fixed;
  right: max(20px, calc(50% - 260px + 20px));
  bottom: calc(var(--tab-h) + var(--safe-b) + 26px);
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-rose);
  color: #fff;
  box-shadow: 0 16px 30px -12px rgba(226, 62, 100, 0.8);
  z-index: 40;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.fab:active { transform: scale(0.9) rotate(90deg); }
@media (min-width: 560px) {
  .fab { position: fixed; right: calc(50% - 198px); bottom: calc(var(--tab-h) + 46px); }
}

/* ---------- empty ---------- */

.empty {
  text-align: center;
  padding: 44px 20px 30px;
  color: var(--ink-3);
}
.empty .art { font-size: 40px; margin-bottom: 12px; opacity: 0.85; }
.empty .et { font-size: 15px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.empty .ed { font-size: 13px; line-height: 1.6; max-width: 260px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px; font-weight: 680;
  background: #fff; color: var(--ink);
  box-shadow: var(--sh-card);
  transition: transform 0.15s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--grad-rose); color: #fff; box-shadow: 0 12px 24px -12px rgba(226, 62, 100, 0.85); }
.btn.ghost { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.danger { color: var(--rose-deep); }

/* ---------- bottom sheet ---------- */

.backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(52, 26, 36, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  z-index: 91;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(80, 20, 40, 0.4);
  animation: sheetUp 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding-bottom: var(--safe-b);
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet.closing { animation: sheetDown 0.22s ease-in both; }
@keyframes sheetDown { to { transform: translate(-50%, 100%); } }

.sheet-grab {
  width: 38px; height: 4px; border-radius: 3px;
  background: var(--line-strong);
  margin: 9px auto 0;
  flex: 0 0 auto;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 8px;
  flex: 0 0 auto;
}
.sheet-body { overflow-y: auto; padding: 4px 20px 20px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 20px 16px; flex: 0 0 auto; }
.sheet-title { font-size: 18px; font-weight: 730; letter-spacing: -0.01em; }
.sheet-close { font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 4px; }

/* ---------- forms ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 650;
  color: var(--ink-3); letter-spacing: 0.03em;
  margin: 0 0 7px 4px;
}
.input, textarea.input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 15px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 15px;
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus { border-color: rgba(238, 92, 124, 0.55); box-shadow: 0 0 0 4px rgba(238, 92, 124, 0.1); }
textarea.input { resize: none; line-height: 1.55; min-height: 96px; }
.input::placeholder { color: var(--ink-4); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 9px 14px; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: all 0.18s;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: #fff3f5; box-shadow: inset 0 0 0 1.5px var(--rose); color: var(--rose-deep); }

.picker-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.picker-strip::-webkit-scrollbar { display: none; }
.picker-strip .p {
  flex: 0 0 auto; width: 62px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 0 8px; border-radius: 15px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 11px; color: var(--ink-3); font-weight: 600;
}
.picker-strip .p .e { font-size: 22px; }
.picker-strip .p.on { box-shadow: inset 0 0 0 2px var(--rose); background: #fff3f5; color: var(--rose-deep); }

.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.upload-cell {
  position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--bg-deep);
}
.upload-cell img { width: 100%; height: 100%; object-fit: cover; }
.upload-cell .x {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); color: #fff;
  display: grid; place-items: center; font-size: 12px;
  backdrop-filter: blur(4px);
}
.upload-add {
  aspect-ratio: 1; border-radius: 13px;
  display: grid; place-items: center;
  border: 1.5px dashed var(--line-strong);
  color: var(--ink-3); background: rgba(255, 255, 255, 0.5);
}

/* ---------- toast ---------- */

.toast-root {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b) + 34px);
  z-index: 120;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 84%;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(43, 31, 38, 0.92);
  color: #fff;
  font-size: 13px; font-weight: 550;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast.out { animation: toastOut 0.25s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px) scale(0.96); } }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 110;
  background: #161013;
  display: flex; flex-direction: column;
  animation: fadeIn 0.2s ease both;
}
.lightbox-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) 16px 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}
.lightbox-body {
  flex: 1; overflow: hidden;
  display: flex; align-items: center;
}
.lightbox-track {
  display: flex; height: 100%;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox-track figure {
  flex: 0 0 100vw; max-width: 520px;
  margin: 0; display: grid; place-items: center; height: 100%;
}
.lightbox img { max-width: 94%; max-height: 78dvh; object-fit: contain; border-radius: 8px; }
.lightbox-foot { padding: 12px 20px calc(var(--safe-b) + 18px); }
.lightbox-foot .meta { color: rgba(255, 255, 255, 0.65); font-size: 12px; text-align: center; margin-bottom: 12px; }

/* ---------- misc ---------- */

.hide { display: none !important; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; } .mb8 { margin-bottom: 8px; }
.gap-col { display: flex; flex-direction: column; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- page specific ---------- */

.chat-page { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 104px); }
body.sheet-open { overflow: hidden; }

.bubble.voice.playing .dur::after { content: " ···"; }
.bubble.voice.playing { animation: vpulse 1.6s ease-in-out infinite; }
@keyframes vpulse { 50% { filter: brightness(1.06); } }

.empty .btn { margin-top: 18px; }

/* ---------- onboarding ---------- */

.onboard {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.3s ease both;
}
.onboard.out { animation: obOut 0.32s ease forwards; }
@keyframes obOut { to { opacity: 0; transform: scale(1.03); } }

.ob-bg {
  position: absolute; inset: 0 0 auto 0; height: 46dvh;
  background:
    radial-gradient(60% 70% at 20% 0%, #ffe0d2 0%, rgba(255, 224, 210, 0) 70%),
    radial-gradient(55% 65% at 88% 12%, #ffd9e6 0%, rgba(255, 217, 230, 0) 65%);
  pointer-events: none;
}
.ob-inner {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 46px) 24px 40px;
  display: flex; flex-direction: column;
  min-height: 100dvh;
}
.ob-hero { text-align: center; }
.ob-heart {
  font-size: 54px; line-height: 1;
  filter: drop-shadow(0 12px 22px rgba(226, 62, 100, 0.3));
  animation: floaty 3.6s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translateY(-6px); } }
.ob-title {
  margin: 16px 0 0; font-size: 33px; font-weight: 800; letter-spacing: -0.035em;
  background: linear-gradient(120deg, #e2466c, #ff8f6b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ob-sub { margin: 9px 0 0; font-size: 14px; color: var(--ink-3); letter-spacing: 0.02em; }

.ob-card {
  margin-top: 30px;
  background: #fff;
  border-radius: 26px;
  padding: 22px 20px;
  box-shadow: 0 24px 50px -26px rgba(190, 90, 120, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}
.ob-label {
  font-size: 12px; font-weight: 650; letter-spacing: 0.05em;
  color: var(--ink-3); margin: 0 0 9px 4px;
}
.ob-names { display: flex; align-items: center; gap: 9px; }
.ob-names .input { text-align: center; font-weight: 620; }
.ob-amp { color: var(--rose); font-weight: 700; font-size: 15px; flex: 0 0 auto; }

.ob-demo {
  display: flex; gap: 11px; align-items: flex-start;
  width: 100%; text-align: left;
  margin-top: 20px; padding: 13px;
  border-radius: 15px;
  background: var(--bg);
  transition: background 0.2s;
}
.ob-demo.on { background: #fff4f6; }
.ob-check {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
  border: 1.6px solid var(--line-strong);
  display: grid; place-items: center;
  color: transparent; margin-top: 1px;
  transition: all 0.2s;
}
.ob-demo.on .ob-check { background: var(--rose); border-color: var(--rose); color: #fff; }
.ob-demo-t { display: block; font-size: 13.5px; font-weight: 650; }
.ob-demo-d { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.ob-cta { margin-top: 22px; padding: 17px; font-size: 16px; }
.ob-note { text-align: center; font-size: 11px; color: var(--ink-4); margin: 14px 0 0; }

/* pages with a floating action button need extra room */
.view:has(.fab) { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 92px); }

/* ---------- 通话界面 ---------- */

.call-screen {
  position: fixed; inset: 0; z-index: 300;
  display: none; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #3a2028 0%, #1a1116 58%, #100b0e 100%);
  color: #fff;
}
.call-screen.show { display: block; animation: callIn 0.28s ease both; }
@keyframes callIn { from { opacity: 0; } }

.call-bg { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 40% at 50% 100%, rgba(238, 92, 124, 0.18), transparent 70%); }

.call-remote-wrap { position: absolute; inset: 0; display: none; background: #000; }
.call-screen.remote-ready .call-remote-wrap { display: block; }
.call-remote { width: 100%; height: 100%; object-fit: cover; }

.call-local-wrap {
  position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 88px);
  width: 92px; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  background: #000; display: none; z-index: 7;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.call-screen.local-ready.video .call-local-wrap { display: block; }
.call-local { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }

.call-head { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 20px); text-align: center; z-index: 8; }
.call-peer { font-size: 21px; font-weight: 750; letter-spacing: -0.01em; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.call-status { font-size: 13px; opacity: 0.72; margin-top: 6px; }
.call-timer { font-size: 13px; opacity: 0.8; margin-top: 6px; font-variant-numeric: tabular-nums; }
.call-sas { display: none; margin-top: 10px; font-size: 12px; font-weight: 650; color: #ffe08a; }
.call-sas.on { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 224, 138, 0.14); }

.call-faces { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 20px; }
.call-screen.remote-ready .call-faces { display: none; }
.call-faces .avatar { width: 92px; height: 92px; font-size: 46px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.call-screen[data-state="incoming"] .call-faces .avatar { animation: facePulse 1.6s ease-in-out infinite; }
@keyframes facePulse { 50% { transform: scale(1.05); } }

.call-actions {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 42px);
  display: flex; justify-content: center; gap: 20px; z-index: 8;
}
.call-btn {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; font-size: 23px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; transition: transform 0.15s, background 0.2s;
}
.call-btn:active { transform: scale(0.9); }
.call-btn.on { background: rgba(255, 255, 255, 0.55); }
.call-btn.danger { background: #e5484d; }
.call-btn.ok { background: #35c08a; }

.call-hint {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 14px);
  text-align: center; font-size: 11px; opacity: 0.55; z-index: 8; padding: 0 20px;
}

.chat-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- 登录 / 注册 ---------- */

.auth-screen {
  position: fixed; inset: 0; z-index: 210;
  background: var(--bg); overflow-y: auto;
  animation: fadeIn 0.3s ease both;
}
.auth-screen.out { animation: obOut 0.26s ease forwards; }
.auth-bg {
  position: absolute; inset: 0 0 auto 0; height: 46dvh; pointer-events: none;
  background:
    radial-gradient(60% 70% at 20% 0%, #ffe0d2 0%, rgba(255, 224, 210, 0) 70%),
    radial-gradient(55% 65% at 88% 12%, #ffd9e6 0%, rgba(255, 217, 230, 0) 65%);
}
.auth-inner {
  position: relative; max-width: 400px; margin: 0 auto;
  padding: calc(var(--safe-t) + 54px) 24px 40px;
  display: flex; flex-direction: column; min-height: 100dvh;
}
.auth-heart { font-size: 48px; text-align: center; line-height: 1;
  filter: drop-shadow(0 12px 22px rgba(226, 62, 100, 0.28)); animation: floaty 3.6s ease-in-out infinite; }
.auth-title {
  margin: 14px 0 0; text-align: center; font-size: 29px; font-weight: 800; letter-spacing: -0.035em;
  background: linear-gradient(120deg, #e2466c, #ff8f6b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-sub { margin: 8px 0 0; text-align: center; font-size: 13.5px; color: var(--ink-3); }

.auth-card {
  margin-top: 28px; background: #fff; border-radius: 24px; padding: 18px 20px 22px;
  box-shadow: 0 24px 50px -26px rgba(190, 90, 120, 0.45);
}
.auth-tabs {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--bg); margin-bottom: 18px;
}
.auth-tabs button {
  flex: 1; padding: 9px 0; border-radius: 999px;
  font-size: 13.5px; font-weight: 650; color: var(--ink-3);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.auth-tabs button.on {
  background: #fff; color: var(--ink);
  box-shadow: 0 4px 12px -6px rgba(180, 80, 110, 0.4);
}
.auth-label {
  display: block; font-size: 12px; font-weight: 650; color: var(--ink-3);
  margin: 0 0 6px 4px; letter-spacing: 0.03em;
}
.auth-body .input { margin-bottom: 14px; }
.auth-submit { margin-top: 6px; padding: 14px; font-size: 15px; }
.auth-msg { min-height: 18px; margin-top: 10px; font-size: 12.5px; color: var(--rose-deep); text-align: center; }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 11.5px; color: var(--ink-4); }

/* ---------- 歌单 ---------- */

.songlist { display: flex; flex-direction: column; gap: 8px; }
.song {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--card); border-radius: 16px;
  box-shadow: var(--sh-card);
  transition: transform 0.16s;
}
.song:active { transform: scale(0.985); }
.song-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(140deg, #ffe3ea, #ffd2dd);
}
.song-title { font-size: 14.5px; font-weight: 650; }
.song-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-play {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 650; color: var(--rose-deep);
  background: var(--rose-soft); padding: 6px 12px; border-radius: 999px;
  text-decoration: none;
}

.song.playing { box-shadow: 0 0 0 1.5px rgba(238, 92, 124, 0.45), var(--sh-card); }
.song.playing .song-ico { animation: songPulse 1.2s ease-in-out infinite; }
@keyframes songPulse { 50% { transform: scale(1.08); } }
.song-play.off { color: var(--ink-4); background: #f3eef0; }


/* ---------- 聊天页：底部导航让位给输入栏 ---------- */

.app:has(.chat-page) .tabbar {
  transform: translateX(-50%) translateY(150%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s;
}

.chat-page { padding-bottom: calc(var(--safe-b) + 96px); }

/* 输入栏：整条贴底，不再悬浮 */
.chat-inputbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  z-index: 60;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 10px calc(8px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  background: #fff;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 -10px 26px -16px rgba(150, 60, 90, 0.4), 0 0 0 1px rgba(150, 84, 106, 0.06);
}

@media (min-width: 560px) {
  .chat-inputbar {
    width: 440px;
    max-width: 440px;
    bottom: 28px;
    border-radius: 0 0 40px 40px;
    padding-bottom: 14px;
  }
}

.chat-back {
  width: 34px; height: 34px; margin-right: 2px; margin-bottom: 4px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px; line-height: 1; font-weight: 500;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px -6px rgba(150, 60, 90, 0.35), 0 0 0 1px rgba(150, 84, 106, 0.06);
  flex: 0 0 auto;
  transition: transform 0.15s;
  padding-bottom: 3px;
}
.chat-back:active { transform: scale(0.9); }

/* ---------- 同步 / 配对（恢复） ---------- */

.connect-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff3f6, #fff8f2);
  border: 1px dashed rgba(238, 92, 124, 0.35);
  margin-bottom: 6px;
}
.cc-main { flex: 1; min-width: 0; }
.cc-title { font-size: 14px; font-weight: 700; }
.cc-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }

.conn-strip {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 4px;
  font-size: 11.5px;
}
.dot-ind { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--ink-4); }
.dot-ind.ok { background: #35c08a; box-shadow: 0 0 0 3px rgba(53, 192, 138, 0.16); }
.dot-ind.wait { background: var(--amber); animation: pulse 1.2s infinite; }
.dot-ind.bad { background: #e0576f; }
.cs-text { font-weight: 650; color: var(--ink-2); }
.cs-file { margin-left: auto; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.cs-more { color: var(--rose); font-weight: 650; font-size: 11.5px; padding: 2px 4px; }

.msg-state { margin-left: 5px; }
.msg-state.ok { color: #35b183; }
.msg-state.bad { color: #e0576f; font-weight: 600; }

.pair-card { padding: 4px 2px 2px; }
.pc-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.pc-note { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 6px; }
.pc-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pc-row:last-of-type { border-bottom: 0; }
.pc-k { font-size: 13px; color: var(--ink-3); }
.pc-v { font-size: 13.5px; font-weight: 650; }

.invite-box {
  margin-top: 6px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--sh-card);
  text-align: center;
}
.ib-label { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.ib-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.5;
  word-break: break-all;
  color: var(--ink);
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 12px 10px;
  margin-bottom: 12px;
  -webkit-user-select: all; user-select: all;
}
.ib-fp { font-size: 11.5px; color: var(--ink-3); margin-top: 12px; }
.ib-fp b { color: var(--rose-deep); letter-spacing: 0.05em; }

/* ---------- 音频选择 ---------- */
.audio-pick .btn { font-size: 13px; }

/* ---------- 非安全上下文提示 ---------- */
.insecure-banner {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top) + 8px);
  width: calc(100% - 24px);
  max-width: 480px;
  z-index: 250;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff4e5;
  border: 1px solid #f0c98a;
  color: #8a5a10;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 8px 24px -12px rgba(140, 90, 20, 0.4);
}
.insecure-banner span { font-size: 11px; opacity: 0.85; }
.insecure-banner .ib-close {
  position: absolute; top: 6px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  color: #b08a4a; font-size: 11px; line-height: 1;
}
/* 有提示条时，内容整体下移，避免遮住标题 */
body.has-insecure-banner .view { padding-top: calc(var(--safe-t) + 92px); }
body.has-insecure-banner .chat-page { padding-top: 82px; }
body.has-insecure-banner .chat-page .topbar { top: 82px; }

.insecure-composer {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff4e5;
  border: 1px solid #f0c98a;
  color: #8a5a10;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.insecure-composer b { display: block; margin-bottom: 3px; font-size: 13px; }

.waiting-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 10px;
  border-radius: 14px; background: var(--bg-deep);
  font-size: 12.5px; color: var(--ink-3);
}
.waiting-hint.ok { background: #eafaf1; color: #1e7a4e; font-weight: 650; }
.wh-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose); animation: pulse 1.2s infinite;
}

/* ---------- 连接页 ---------- */
.connect-hero {
  text-align: center;
  padding: 18px 12px 22px;
}
.connect-hero .ch-emoji { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.connect-hero h2 { font-size: 19px; font-weight: 750; margin-bottom: 8px; }
.connect-hero p {
  font-size: 13px; color: var(--ink-3);
  line-height: 1.7; max-width: 300px; margin: 0 auto;
}
.connect-hero.done .ch-emoji { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

.big-choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 16px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--sh-card);
  transition: transform .12s ease;
}
.big-choice:active { transform: scale(0.985); }
.big-choice.primary {
  background: linear-gradient(135deg, #fff1f5, #ffeaf1);
  box-shadow: 0 10px 30px -18px rgba(220, 80, 120, .55);
}
.bc-icon { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.bc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bc-main b { font-size: 15px; font-weight: 700; }
.bc-main small { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.bc-go { color: #d9ccd3; font-size: 20px; }

.connect-tip {
  margin-top: 16px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg-deep);
  font-size: 11.5px; color: var(--ink-3); line-height: 1.65;
}

.waiting-card {
  text-align: center;
  padding: 22px 12px 18px;
}
.wc-pulse { display: flex; justify-content: center; gap: 7px; margin-bottom: 14px; }
.wc-pulse span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rose); animation: wcp 1.1s infinite ease-in-out;
}
.wc-pulse span:nth-child(2) { animation-delay: .18s; }
.wc-pulse span:nth-child(3) { animation-delay: .36s; }
@keyframes wcp {
  0%, 80%, 100% { transform: scale(.6); opacity: .35; }
  40% { transform: scale(1); opacity: 1; }
}
.wc-text { font-size: 16px; font-weight: 700; }
.wc-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }

.ib-link {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  color: var(--ink-2);
  background: var(--bg-deep);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 10px;
  -webkit-user-select: all; user-select: all;
}
.hide { display: none !important; }

/* 连接页顶栏：标题跟在返回键后面，不要被推到右边 */
.topbar-title {
  font-size: 19px; font-weight: 750; letter-spacing: -0.02em;
  margin-right: auto;
}
