/* =========================================================
   贴贴 · 两个人的小桌宠
   奶油纸张 + 番茄红 + 墨绿，无外部字体与图片依赖
   ========================================================= */

:root {
  --paper: #fbf3e8;
  --paper-deep: #f4e5d4;
  --card: #fffaf2;
  --card-bright: #fffdf8;
  --ink: #43302a;
  --ink-soft: #5f4a40;
  --muted: #918075;
  --muted-light: #b4a396;
  --line: #e7d6c4;
  --line-strong: #4a352d;
  --coral: #e87867;
  --coral-deep: #cf5d4d;
  --coral-soft: #f9d9cf;
  --peach: #f6c9b8;
  --butter: #f4c56b;
  --butter-soft: #fbe9c4;
  --teal: #4c8b7e;
  --teal-soft: #dcece5;
  --shadow-sm: 0 4px 0 rgba(74, 53, 45, .08);
  --shadow: 0 22px 55px -24px rgba(84, 55, 42, .28);
  --shadow-card: 0 12px 34px -18px rgba(84, 55, 42, .28);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-body: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Consolas", monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(900px 620px at -6% -4%, #f8d9c5 0, rgba(248, 217, 197, 0) 58%),
    radial-gradient(780px 560px at 105% -8%, #f6e1ba 0, rgba(246, 225, 186, 0) 55%),
    linear-gradient(180deg, #fbf4e9 0%, #f8eee1 62%, #faf2e7 100%);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .36;
  background-image: radial-gradient(rgba(86, 60, 47, .13) .65px, transparent .7px);
  background-size: 7px 7px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

input,
textarea {
  min-width: 0;
}

button,
input,
textarea,
a {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(76, 139, 126, .38);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--ink);
  background: var(--butter);
}

/* ---------- 背景装饰 ---------- */

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(1px);
  opacity: .7;
}

.bg-shape-one {
  width: 210px;
  height: 210px;
  right: -86px;
  bottom: 10%;
  border: 2px dashed rgba(230, 120, 103, .24);
}

.bg-shape-two {
  width: 90px;
  height: 90px;
  left: 4.5%;
  bottom: 13%;
  background: rgba(244, 197, 107, .22);
  transform: rotate(-16deg);
  border-radius: 26px;
}

.bg-shape-three {
  width: 150px;
  height: 150px;
  left: -78px;
  top: 18%;
  border: 2px solid rgba(76, 139, 126, .16);
}

/* ---------- 应用骨架 ---------- */

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100% - 64px));
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: 18px;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 16px 2px 10px;
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 4px;
  background: var(--card);
  border: 1.7px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(74, 53, 45, .13);
  transform: rotate(-4deg);
  transition: transform .25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(2deg) translateY(-1px);
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.brand-copy strong {
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: 2px;
  line-height: 1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.head-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 3px;
  padding: 6px 12px;
  color: var(--ink-soft);
  background: rgba(255, 250, 242, .68);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.status-dot,
.presence-line i,
.connection-pin {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(76, 139, 126, .13);
}

.status-dot.is-offline,
.connection-pin.is-offline {
  background: var(--muted-light);
  box-shadow: 0 0 0 3px rgba(145, 128, 117, .1);
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink-soft);
  background: rgba(255, 250, 242, .7);
  border: 1.4px solid var(--line);
  border-radius: 14px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.icon-button:hover {
  background: var(--card-bright);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: translateY(0);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-button.small {
  width: 37px;
  height: 37px;
  border-radius: 12px;
}

.icon-button.small svg {
  width: 18px;
  height: 18px;
}

.icon-button.has-alert::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -18px 0 0 18px;
  background: var(--coral);
  border: 1.5px solid var(--card);
  border-radius: 999px;
}

.main-stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.view {
  width: 100%;
  animation: view-in .45s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .035em;
  flex: none;
}

.foot-dot {
  color: var(--coral);
}

/* ---------- 通用文字 ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 17px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(232, 120, 103, .12);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-weight: 700;
}

.quiet-line {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 13px 19px;
  color: #fffaf2;
  background: var(--coral);
  border: 1.6px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--line-strong), 0 12px 20px -14px rgba(74, 53, 45, .6);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .015em;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.primary-button:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--line-strong), 0 16px 24px -15px rgba(74, 53, 45, .55);
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--line-strong);
}

.button-arrow {
  font-size: 19px;
  line-height: 1;
  transition: transform .18s ease;
}

.primary-button:hover .button-arrow {
  transform: translateX(3px);
}

.tiny-button {
  padding: 7px 13px;
  color: var(--ink);
  background: var(--card-bright);
  border: 1.3px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(74, 53, 45, .12);
}

.tiny-button:hover {
  background: var(--butter-soft);
}

/* ---------- 欢迎页 ---------- */

.welcome-view {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(370px, .78fr);
  align-items: center;
  gap: clamp(36px, 7vw, 92px);
  padding: 18px 2px 30px;
}

.welcome-copy h1 {
  max-width: 620px;
  font-size: clamp(52px, 6.8vw, 82px);
  line-height: 1.06;
  letter-spacing: -.055em;
}

.welcome-copy h1 em {
  position: relative;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}

.welcome-copy h1 em::after {
  content: "";
  position: absolute;
  left: 1%;
  right: 0;
  bottom: 2px;
  height: 9px;
  z-index: -1;
  background: var(--butter);
  border-radius: 50% 35% 50% 40%;
  transform: rotate(-1.4deg);
  opacity: .7;
}

.welcome-lede {
  margin: 25px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.85;
}

.welcome-pet-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.welcome-pet-line p {
  margin: 0;
}

.welcome-pet-line strong {
  color: var(--ink);
  font-weight: 700;
}

.mini-pet-slot {
  width: 58px;
  height: 58px;
  flex: none;
  overflow: hidden;
}

.mini-pet-slot .pet-art {
  width: 74px;
  height: 74px;
  margin: -7px 0 0 -8px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.feature-pills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: rgba(255, 250, 242, .62);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.feature-pills li span {
  color: var(--coral);
  font-size: 13px;
}

.pair-card {
  position: relative;
  padding: 10px 28px 26px;
  background:
    linear-gradient(rgba(255, 252, 246, .95), rgba(255, 250, 242, .98)),
    radial-gradient(circle at 20% 0%, var(--peach), transparent 50%);
  border: 1.8px solid var(--line-strong);
  border-radius: 28px;
  box-shadow: 7px 7px 0 rgba(74, 53, 45, .09), var(--shadow);
  transform: rotate(.5deg);
}

.pair-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px dashed rgba(231, 214, 196, .8);
  border-radius: 21px;
  pointer-events: none;
}

.pair-card-pin {
  position: absolute;
  top: -12px;
  left: 50%;
  z-index: 2;
  width: 52px;
  height: 22px;
  margin-left: -26px;
  background: rgba(244, 197, 107, .58);
  border: 1px solid rgba(180, 140, 80, .22);
  transform: rotate(-2deg);
  clip-path: polygon(3% 6%, 98% 0, 94% 94%, 0 100%);
}

.pair-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 12px 0 22px;
  padding: 4px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.pair-tab {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.pair-tab.is-active {
  color: var(--ink);
  background: var(--card-bright);
  box-shadow: 0 2px 6px rgba(74, 53, 45, .1);
}

.pair-form {
  position: relative;
  z-index: 1;
  animation: panel-in .32s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pair-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 112px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #f8ddcb;
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
}

.pair-illustration::before,
.pair-illustration::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: .55;
}

.pair-illustration::before {
  width: 150px;
  height: 150px;
  top: -76px;
  left: -22px;
  border: 1px dashed rgba(74, 53, 45, .2);
}

.pair-illustration::after {
  width: 100px;
  height: 100px;
  right: -42px;
  bottom: -58px;
  background: rgba(244, 197, 107, .55);
}

.pair-spark {
  position: absolute;
  z-index: 2;
  color: var(--coral-deep);
  font-size: 12px;
}

.pair-spark-a {
  top: 21px;
  left: 31px;
  transform: rotate(-12deg);
}

.pair-spark-b {
  top: 30px;
  right: 33px;
  color: var(--teal);
  font-size: 10px;
}

.pair-letter {
  position: relative;
  width: 114px;
  height: 76px;
  margin-top: 12px;
  background: var(--card-bright);
  border: 1.6px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(74, 53, 45, .09);
  transform: rotate(-3deg);
}

.pair-letter::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 6px;
  background:
    linear-gradient(33deg, transparent 48.7%, rgba(74, 53, 45, .14) 49%, rgba(74, 53, 45, .14) 49.5%, transparent 49.8%),
    linear-gradient(-33deg, transparent 48.7%, rgba(74, 53, 45, .14) 49%, rgba(74, 53, 45, .14) 49.5%, transparent 49.8%);
}

.letter-flap {
  position: absolute;
  top: -1px;
  left: -1px;
  z-index: 2;
  width: 114px;
  height: 46px;
  background: #fff8ed;
  border-bottom: 1.4px solid var(--line-strong);
  border-radius: 7px 7px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.letter-stamp {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 21px;
  height: 23px;
  color: var(--coral-deep);
  background: #fbe2d9;
  border: 1px dashed #d99b8e;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
}

.letter-to {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .04em;
}

.letter-seal {
  position: absolute;
  right: 13px;
  bottom: 9px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #fff8ed;
  background: var(--coral);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  transform: rotate(8deg);
}

.pair-key {
  position: relative;
  width: 100px;
  height: 72px;
  margin-top: 12px;
}

.pair-key-ring {
  position: absolute;
  top: 8px;
  left: 9px;
  width: 39px;
  height: 39px;
  background: var(--card-bright);
  border: 1.8px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: inset 0 0 0 7px var(--butter-soft);
}

.pair-key-ring::after {
  content: "♥";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--coral);
  font-size: 12px;
  line-height: 1;
}

.pair-key-body {
  position: absolute;
  top: 31px;
  left: 42px;
  width: 48px;
  height: 11px;
  background: var(--butter);
  border: 1.6px solid var(--line-strong);
  border-radius: 2px 4px 4px 2px;
  transform: rotate(-17deg);
}

.pair-key-body::before,
.pair-key-body::after {
  content: "";
  position: absolute;
  right: 4px;
  width: 4px;
  height: 10px;
  background: var(--butter);
  border: 1.6px solid var(--line-strong);
  border-top: 0;
}

.pair-key-body::before {
  top: 9px;
  right: 27px;
}

.pair-key-body::after {
  top: 9px;
  right: 15px;
  height: 7px;
}

.field {
  display: block;
  margin-top: 14px;
}

.field > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 7px 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.field > span small {
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--card-bright);
  border: 1.4px solid var(--line);
  border-radius: 12px;
  font-size: 14.5px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input::placeholder {
  color: var(--muted-light);
}

.field input:focus {
  background: #fffefb;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(76, 139, 126, .11);
}

.field input.is-error {
  border-color: var(--coral-deep);
  box-shadow: 0 0 0 3px rgba(232, 120, 103, .12);
}

.code-field {
  font-family: var(--font-mono) !important;
  font-size: 17px !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.field-hint {
  margin: 9px 2px 17px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.pair-form .primary-button {
  margin-top: 20px;
}

.form-tiny {
  margin: 12px 0 0;
  color: var(--muted-light);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: .03em;
}

.pair-error {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding: 10px 13px;
  color: #8e3d32;
  background: #fbe5df;
  border: 1px solid #eec3b9;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.pair-error::before {
  content: "· ";
  font-weight: 900;
}

/* ---------- 等待页 ---------- */

.waiting-view {
  display: grid;
  place-items: center;
  padding: 18px 0 30px;
}

.waiting-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 38px;
  align-items: center;
  width: min(880px, 100%);
  padding: 34px;
  background: rgba(255, 250, 242, .86);
  border: 1.7px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: 7px 7px 0 rgba(74, 53, 45, .08), var(--shadow);
}

.waiting-scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 330px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 253, 248, .9) 0 22%, transparent 22.5%),
    linear-gradient(180deg, #f8ddc9 0%, #f5d5be 60%, #edc5ab 100%);
  border: 1.5px solid var(--line-strong);
  border-radius: 22px;
}

.waiting-scene::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  background:
    radial-gradient(ellipse at 20% 100%, #e4b99c 0 52%, transparent 53%),
    radial-gradient(ellipse at 62% 100%, #e8c0a4 0 58%, transparent 59%),
    #e0b396;
  border-top: 1px solid rgba(74, 53, 45, .12);
}

.waiting-hoop {
  position: absolute;
  top: 28px;
  width: 160px;
  height: 225px;
  border: 1.5px dashed rgba(74, 53, 45, .25);
  border-bottom: 0;
  border-radius: 100px 100px 0 0;
}

.waiting-pet {
  position: relative;
  z-index: 1;
  width: 200px;
  margin-bottom: 22px;
}

.waiting-pet .pet-art {
  width: 100%;
}

.waiting-heart {
  position: absolute;
  z-index: 2;
  color: var(--coral);
  font-size: 14px;
  animation: float-heart 3.8s ease-in-out infinite;
}

.waiting-heart-one {
  top: 60px;
  right: 42px;
}

.waiting-heart-two {
  top: 110px;
  left: 38px;
  color: var(--teal);
  font-size: 10px;
  animation-delay: -1.7s;
}

.waiting-copy h1 {
  margin-bottom: 15px;
  font-size: clamp(36px, 4.4vw, 51px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.waiting-lede {
  max-width: 430px;
  margin-bottom: 21px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
}

.invite-code-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 17px;
  background: #fffdf8;
  border: 1.5px dashed #cbb39e;
  border-radius: 15px;
}

.invite-code {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(22px, 3.1vw, 31px);
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-mini {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: background .18s ease, color .18s ease;
}

.copy-mini:hover {
  color: var(--ink);
  background: var(--butter-soft);
}

.copy-mini svg {
  width: 17px;
  height: 17px;
}

.waiting-actions {
  margin-top: 12px;
}

.waiting-actions .primary-button {
  min-height: 49px;
  font-size: 13.5px;
}

.waiting-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 17px 2px 0;
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 600;
}

.waiting-status i {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  animation: wait-pulse 1.7s ease-out infinite;
}

@keyframes wait-pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 139, 126, .36); }
  70% { box-shadow: 0 0 0 8px rgba(76, 139, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 139, 126, 0); }
}

.waiting-steps {
  display: grid;
  gap: 8px;
  margin: 21px 0 0;
  padding: 16px 0 0;
  border-top: 1px dashed var(--line);
  list-style: none;
}

.waiting-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
}

.waiting-steps b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--ink-soft);
  background: var(--butter-soft);
  border: 1px solid rgba(180, 140, 80, .3);
  border-radius: 50%;
  font-size: 10px;
}

.help-details {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.help-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  list-style: none;
}

.help-details summary::-webkit-details-marker {
  display: none;
}

.help-details summary::before {
  content: "＋";
  margin-right: 5px;
  color: var(--coral);
}

.help-details[open] summary::before {
  content: "－";
}

.help-details p {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 9px;
  line-height: 1.75;
}

/* ---------- 主聊天布局 ---------- */

.chat-view {
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 20px;
  height: min(760px, calc(100dvh - 132px));
  min-height: 550px;
  padding-bottom: 4px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.pet-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 275px;
  overflow: hidden;
  background:
    radial-gradient(circle at 62% 22%, rgba(255, 253, 246, .65) 0 15%, transparent 15.5%),
    linear-gradient(170deg, #fae3d2 0%, #f7d8c4 52%, #efc7ad 100%);
  border: 1.7px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.pet-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 230px;
  height: 240px;
  margin-left: -115px;
  border: 1.5px dashed rgba(74, 53, 45, .22);
  border-bottom: 0;
  border-radius: 130px 130px 0 0;
}

.pet-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 39px;
  width: 250px;
  height: 23px;
  margin-left: -125px;
  background: rgba(137, 90, 65, .12);
  border-radius: 50%;
  filter: blur(7px);
}

.pet-stage-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45px;
  background:
    radial-gradient(ellipse at 10% 100%, #e3b698 0 58%, transparent 59%),
    radial-gradient(ellipse at 70% 105%, #dfb191 0 62%, transparent 63%),
    #d9a787;
  border-top: 1px solid rgba(74, 53, 45, .13);
}

.pet-stage-spark {
  position: absolute;
  z-index: 1;
  color: rgba(74, 53, 45, .4);
  font-size: 12px;
}

.sparkle-one {
  top: 73px;
  left: 42px;
}

.sparkle-two {
  top: 47px;
  right: 48px;
  font-size: 16px;
  color: rgba(232, 120, 103, .6);
}

.pet-stage-cloud {
  position: absolute;
  z-index: 0;
  height: 13px;
  background: rgba(255, 250, 242, .5);
  border-radius: 999px;
}

.cloud-one {
  top: 112px;
  left: -8px;
  width: 54px;
}

.cloud-two {
  top: 145px;
  right: -10px;
  width: 70px;
  height: 10px;
}

.main-pet {
  position: relative;
  z-index: 2;
  width: 238px;
  margin-bottom: 18px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 10px 12px rgba(109, 73, 56, .12));
  transition: transform .2s ease;
}

.main-pet:hover {
  transform: translateY(-2px);
}

.main-pet .pet-art {
  width: 100%;
  height: auto;
  overflow: visible;
}

.pet-prop {
  position: absolute;
  right: 42px;
  bottom: 163px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  background: var(--card-bright);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(74, 53, 45, .14);
  font-size: 19px;
  transform: rotate(8deg);
  animation: prop-bob 3.2s ease-in-out infinite;
}

@keyframes prop-bob {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-4px); }
}

.pet-speech {
  position: absolute;
  top: 17px;
  left: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pet-speech > span {
  position: relative;
  max-width: 100%;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, .93);
  border: 1.3px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 2px 2px 0 rgba(74, 53, 45, .08);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.pet-speech > span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 9px;
  height: 9px;
  margin-left: -5px;
  background: #fffdf7;
  border-right: 1.3px solid var(--line-strong);
  border-bottom: 1.3px solid var(--line-strong);
  transform: rotate(45deg);
}

.pet-nameplate {
  position: absolute;
  left: 50%;
  bottom: 17px;
  z-index: 4;
  transform: translateX(-50%);
  padding: 4px 10px;
  color: rgba(74, 53, 45, .65);
  background: rgba(255, 250, 242, .46);
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.pet-love-badge {
  position: absolute;
  right: 12px;
  bottom: 42px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  color: var(--coral-deep);
  background: rgba(255, 250, 242, .82);
  border: 1px solid rgba(207, 93, 77, .27);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 1px 1px 0 rgba(74, 53, 45, .06);
}

.pet-love-badge b {
  color: var(--ink-soft);
  font-size: 9.5px;
}

.feed-rain {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.feed-particle {
  position: absolute;
  bottom: 80px;
  font-size: 16px;
  animation: feed-rise 1.5s ease-out forwards;
}

@keyframes feed-rise {
  0% { opacity: 0; transform: translateY(8px) scale(.55) rotate(-12deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-80px) scale(1.08) rotate(16deg); }
}

.heart-rain {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  bottom: 95px;
  color: var(--coral);
  font-size: 14px;
  animation: heart-rise 1.4s ease-out forwards;
}

@keyframes heart-rise {
  0% { opacity: 0; transform: translateY(8px) scale(.6) rotate(0deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-95px) scale(1.05) rotate(18deg); }
}

.pet-figure {
  transform-origin: 120px 200px;
  animation: pet-breathe 4.8s ease-in-out infinite;
}

@keyframes pet-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.008, .993); }
}

.pet-tail {
  transform-origin: 170px 168px;
  animation: tail-sway 3.7s ease-in-out infinite;
}

@keyframes tail-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(6deg); }
}

.pet-ear {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: ear-twitch 7.5s ease-in-out infinite;
}

.pet-ear-right {
  animation-delay: -3.2s;
}

@keyframes ear-twitch {
  0%, 84%, 100% { transform: rotate(0deg); }
  88% { transform: rotate(-5deg); }
  92% { transform: rotate(2deg); }
  96% { transform: rotate(-2deg); }
}

.pet-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: pet-blink 6.2s infinite;
}

.pet-eye-right {
  animation-delay: .06s;
}

@keyframes pet-blink {
  0%, 91%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(.1); }
  95% { transform: scaleY(1); }
}

.pet-eyes-happy {
  opacity: 0;
}

.pet.is-happy .pet-eyes-open {
  opacity: 0;
}

.pet.is-happy .pet-eyes-happy {
  opacity: 1;
}

.pet.is-happy .pet-figure {
  animation: pet-bounce .55s cubic-bezier(.2, .8, .3, 1);
}

@keyframes pet-bounce {
  0% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(-13px) scale(.98, 1.03); }
  58% { transform: translateY(1px) scale(1.04, .96); }
  78% { transform: translateY(-3px) scale(.995, 1.005); }
  100% { transform: translateY(0) scale(1, 1); }
}

.pet.is-happy .pet-tail {
  animation: tail-happy .55s ease-in-out 2;
}

@keyframes tail-happy {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(18deg); }
}

.pet.is-happy .pet-flower {
  animation: flower-wiggle .6s ease-in-out;
}

@keyframes flower-wiggle {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(16deg); }
  70% { transform: rotate(-7deg); }
}

.partner-now {
  padding: 13px 15px 14px;
  background: rgba(255, 251, 244, .9);
  border: 1.4px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  flex: none;
}

.partner-now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.status-time {
  color: var(--muted-light);
  font-size: 9.5px;
  white-space: nowrap;
}

.partner-now-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.status-emoji {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  background: var(--butter-soft);
  border: 1px solid rgba(180, 140, 80, .25);
  border-radius: 11px;
  font-size: 19px;
}

.status-main {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.status-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.members-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 1px;
  flex: none;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 9px 4px 5px;
  color: var(--muted);
  background: rgba(255, 251, 244, .62);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
}

.member-chip.is-online {
  color: var(--ink-soft);
  background: rgba(255, 251, 244, .92);
}

.member-face {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--ink);
  background: var(--peach);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.member-chip:nth-child(2) .member-face {
  background: var(--teal-soft);
}

.member-online {
  width: 5px;
  height: 5px;
  background: var(--muted-light);
  border-radius: 50%;
}

.member-chip.is-online .member-online {
  background: var(--teal);
}

.side-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 251, 244, .8);
  border: 1.2px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease;
}

.soft-button:hover {
  background: var(--card-bright);
  border-color: #c8b29d;
}

.soft-button svg {
  width: 16px;
  height: 16px;
  color: var(--teal);
}

.side-hint {
  margin: 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.4;
}

/* ---------- 聊天面板 ---------- */

.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 251, 244, .96), rgba(255, 250, 242, .98)),
    radial-gradient(circle at 90% 0%, var(--butter-soft), transparent 45%);
  border: 1.7px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 5px 5px 0 rgba(74, 53, 45, .07), var(--shadow);
}

.chat-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 4px;
  z-index: 2;
  background: repeating-linear-gradient(
    90deg,
    var(--coral) 0 11px,
    transparent 11px 19px,
    var(--teal) 19px 30px,
    transparent 30px 38px
  );
  opacity: .3;
  border-radius: 0 0 4px 4px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  min-height: 70px;
  padding: 15px 22px 13px;
  border-bottom: 1px dashed var(--line);
}

.chat-person {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--ink);
  background: var(--peach);
  border: 1.4px solid var(--line-strong);
  border-radius: 13px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  transform: rotate(-2deg);
}

.avatar-partner {
  background: var(--teal-soft);
}

.avatar.is-offline {
  filter: grayscale(.35);
  opacity: .75;
}

.chat-person-copy {
  min-width: 0;
}

.chat-person-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: .015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.presence-line i {
  width: 6px;
  height: 6px;
  box-shadow: none;
  background: var(--muted-light);
}

.presence-line.is-online i {
  background: var(--teal);
  box-shadow: 0 0 0 2.5px rgba(76, 139, 126, .12);
}

.presence-line.is-typing {
  color: var(--teal);
}

.presence-line.is-typing i {
  background: var(--teal);
  box-shadow: 0 0 0 2.5px rgba(76, 139, 126, .12);
  animation: wait-pulse 1.5s ease-out infinite;
}

.anniversary-line {
  margin: 2px 0 0;
  color: var(--coral-deep);
  font-size: 9px;
  line-height: 1.4;
  letter-spacing: .015em;
}

.fun-icon svg {
  color: var(--coral-deep);
}

.chat-head-actions .fun-icon {
  background: #fff7e6;
  border-color: #edd4a5;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.connection-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 7px 22px;
  color: #825a2c;
  background: var(--butter-soft);
  border-bottom: 1px solid #eddaac;
  font-size: 10.5px;
}

.connection-banner i {
  width: 6px;
  height: 6px;
  background: var(--butter);
  border-radius: 50%;
  animation: wait-pulse 1.6s ease-out infinite;
}

.notify-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin: 12px 18px 0;
  padding: 9px 10px 9px 11px;
  background: #fff7e6;
  border: 1px solid #efdaaf;
  border-radius: 12px;
}

.notify-banner-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: #fcebc8;
  border-radius: 8px;
  font-size: 14px;
}

.notify-banner p {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  line-height: 1.45;
}

.notify-banner strong {
  font-size: 10.5px;
}

.notify-banner p span {
  color: #927752;
  font-size: 9.5px;
}

.banner-dismiss {
  width: 23px;
  height: 23px;
  flex: none;
  color: #9d8665;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
}

.banner-dismiss:hover {
  background: rgba(0, 0, 0, .05);
}

.message-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 19px 22px 8px;
  scrollbar-width: thin;
  scrollbar-color: #d9c3ae transparent;
  overscroll-behavior: contain;
}

.message-scroll::-webkit-scrollbar {
  width: 6px;
}

.message-scroll::-webkit-scrollbar-thumb {
  background: #d9c3ae;
  border-radius: 99px;
}

.message-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 3px;
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  color: var(--muted-light);
  font-size: 9.5px;
  letter-spacing: .03em;
}

.date-divider::before,
.date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}

.date-divider::after {
  background: linear-gradient(90deg, var(--line), transparent);
}

.date-divider:first-child {
  margin-top: 2px;
}

.msg-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 11px;
  animation: msg-in .26s ease both;
}

.msg-row.is-mine {
  justify-content: flex-end;
}

.msg-row.is-continuation {
  margin-top: -6px;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(76%, 510px);
}

.msg-row.is-mine .msg-stack {
  align-items: flex-end;
}

.msg-author {
  margin: 0 0 3px 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.msg-bubble {
  position: relative;
  padding: 9px 13px;
  color: var(--ink);
  background: var(--card-bright);
  border: 1.35px solid var(--line-strong);
  border-radius: 5px 15px 15px 15px;
  box-shadow: 2.5px 2.5px 0 rgba(74, 53, 45, .09);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.msg-row.is-mine .msg-bubble {
  color: #fffaf4;
  background: var(--coral);
  border-radius: 15px 5px 15px 15px;
  box-shadow: 2.5px 2.5px 0 rgba(74, 53, 45, .14);
}

.msg-row.is-mine .msg-bubble a {
  color: #fff;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 4px 2px 0;
  color: var(--muted-light);
  font-size: 8.5px;
  line-height: 1.4;
}

.msg-meta .failed {
  color: var(--coral-deep);
  font-weight: 700;
  cursor: pointer;
}

.msg-meta .sending {
  color: var(--muted);
}

.msg-meta .delivered {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.retry-send {
  padding: 0;
  color: var(--coral-deep);
  font-size: 8.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.retry-send:hover {
  color: #a74337;
}

.msg-row.is-pending .msg-bubble {
  opacity: .66;
}

.msg-system {
  display: flex;
  justify-content: center;
  margin: 13px 0;
}

.msg-system span {
  max-width: 88%;
  padding: 4px 11px;
  color: var(--muted);
  background: rgba(244, 232, 218, .72);
  border: 1px solid rgba(231, 214, 196, .8);
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.55;
  text-align: center;
}

.msg-status {
  display: flex;
  justify-content: center;
  margin: 15px 0 17px;
}

.msg-action {
  display: flex;
  justify-content: center;
  margin: 12px 0 14px;
}

.action-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 90%;
  padding: 6px 11px;
  color: var(--ink-soft);
  background: #fff5e3;
  border: 1px solid #eed8b2;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
  box-shadow: 1.5px 1.5px 0 rgba(74, 53, 45, .04);
}

.action-card .action-emoji {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  background: var(--card-bright);
  border: 1px solid #eddbb9;
  border-radius: 50%;
  font-size: 12px;
}

.action-card b {
  color: var(--ink);
}

.action-card.is-poke {
  background: #fff3ef;
  border-color: #efcfc6;
}

.action-card time {
  margin-left: 2px;
  color: var(--muted-light);
  font-size: 8px;
}

.pet.is-poked {
  animation: pet-poked .45s ease-in-out 2;
}

@keyframes pet-poked {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-2deg); }
  55% { transform: translateX(5px) rotate(2deg); }
  80% { transform: translateX(-2px); }
}

.status-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(92%, 440px);
  padding: 8px 11px;
  background: #fff7e6;
  border: 1px dashed #e4c998;
  border-radius: 12px;
  box-shadow: 2px 2px 0 rgba(74, 53, 45, .04);
}

.status-card-emoji {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  background: var(--card-bright);
  border: 1px solid #ecd9b4;
  border-radius: 8px;
  font-size: 15px;
}

.status-card-copy {
  flex: 1;
  min-width: 0;
}

.status-card-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
}

.status-card-head b {
  color: var(--coral-deep);
  font-weight: 700;
}

.status-card-head time {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 8px;
  font-weight: 400;
}

.status-card-note {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.typing-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  padding: 1px 2px 7px;
  color: var(--muted);
  font-size: 9.5px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.typing-dots i {
  width: 3px;
  height: 3px;
  background: var(--teal);
  border-radius: 50%;
  animation: typing-dot 1.1s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-2px); opacity: 1; }
}

.chat-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.empty-pet {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: var(--coral);
  background: var(--paper-deep);
  border: 1px dashed #d6bfa8;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 27px;
  transform: rotate(-5deg);
}

.chat-empty p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
}

.jump-new {
  position: absolute;
  right: 20px;
  bottom: 118px;
  z-index: 6;
  padding: 6px 11px;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1.2px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 2px 2px 0 rgba(74, 53, 45, .12);
  font-size: 10px;
  font-weight: 600;
}

.jump-new span {
  color: var(--coral);
}

.quick-report {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 18px 6px;
  overflow: hidden;
}

.quick-label {
  flex: none;
  margin-right: 1px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
}

.quick-chips {
  display: flex;
  flex: 1;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: none;
  padding: 4px 8px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, .8);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.35;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.quick-chip:hover {
  background: var(--butter-soft);
  border-color: #d8bb88;
  transform: translateY(-1px);
}

.quick-more {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}

.quick-more:hover {
  background: var(--butter-soft);
}

.composer {
  flex: none;
  padding: 0 16px calc(10px + var(--safe-bottom));
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 13px;
  background: var(--card-bright);
  border: 1.35px solid #d9c4af;
  border-radius: 15px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.composer-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(76, 139, 126, .09);
}

.composer textarea {
  flex: 1;
  max-height: 105px;
  min-height: 25px;
  padding: 5px 0 3px;
  resize: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 13px;
  line-height: 1.55;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: var(--muted-light);
}

.send-button {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: none;
  color: #fffaf4;
  background: var(--coral);
  border: 1.3px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 2px 0 rgba(74, 53, 45, .22);
  transition: background .16s ease, transform .16s ease;
}

.send-button:hover {
  background: var(--coral-deep);
  transform: translateY(-1px);
}

.send-button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.send-button svg {
  width: 19px;
  height: 19px;
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 17px;
  padding: 3px 3px 0;
  color: var(--muted-light);
  font-size: 8.5px;
}

.composer-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.my-photo-chip {
  display: block;
  width: 23px;
  height: 23px;
  flex: none;
  padding: 0;
  overflow: hidden;
  background: var(--card-bright);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.my-photo-chip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-count {
  color: var(--muted);
  font-size: 8.5px;
}

.char-count.is-near {
  color: var(--coral-deep);
  font-weight: 700;
}

/* ---------- 弹窗 ---------- */

.sheet {
  width: min(460px, calc(100% - 28px));
  max-height: min(88dvh, 760px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  overflow: visible;
}

.sheet::backdrop {
  background: rgba(67, 48, 42, .35);
  backdrop-filter: blur(3px);
}

.sheet[open] {
  animation: sheet-in .24s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sheet-inner {
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 251, 244, .98), rgba(255, 249, 239, .99)),
    radial-gradient(circle at 90% 0%, var(--peach), transparent 45%);
  border: 1.7px solid var(--line-strong);
  border-radius: 25px;
  box-shadow: 7px 7px 0 rgba(74, 53, 45, .11), var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: #d9c3ae transparent;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 19px;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.sheet-eyebrow {
  margin: 0 0 4px;
  color: var(--coral-deep);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .13em;
}

.close-button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: none;
  color: var(--muted);
  background: rgba(244, 229, 212, .64);
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
  transition: background .16s ease, color .16s ease;
}

.close-button:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

.status-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 58px;
  padding: 7px 3px;
  color: var(--muted);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 9px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.status-option span {
  font-size: 18px;
  line-height: 1.25;
}

.status-option:hover {
  background: #fffaf0;
  border-color: #cfb69f;
  transform: translateY(-1px);
}

.status-option.is-selected {
  color: var(--ink);
  background: var(--butter-soft);
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px rgba(232, 120, 103, .35);
}

.field.compact {
  margin-top: 11px;
}

.field.compact > span {
  font-size: 11px;
}

.field.compact input {
  height: 42px;
  font-size: 12.5px;
  border-radius: 10px;
}

.sheet .primary-button {
  margin-top: 18px;
  min-height: 48px;
  font-size: 13.5px;
}

.settings-group {
  padding: 4px 0;
  border-top: 1px dashed var(--line);
}

.settings-group + .settings-group {
  margin-top: 3px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(231, 214, 196, .65);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.setting-copy strong {
  font-size: 11.5px;
  font-weight: 700;
}

.setting-copy span {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.switch-button {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
  background: #e5d7c8;
  border: 1px solid #d2c0ae;
  border-radius: 999px;
  transition: background .18s ease, border-color .18s ease;
}

.switch-button i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  background: var(--card-bright);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(74, 53, 45, .18);
  transition: transform .18s ease;
}

.switch-button.is-on {
  background: var(--teal);
  border-color: var(--teal);
}

.switch-button.is-on i {
  transform: translateX(17px);
}

.switch-button.is-denied {
  background: #f0c6bd;
  border-color: #dfaea4;
}

.code-copy {
  flex: none;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px dashed #cdb7a2;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.connection-pin {
  flex: none;
  width: 7px;
  height: 7px;
}

.settings-note {
  display: flex;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  color: var(--muted);
  background: var(--paper);
  border-radius: 11px;
}

.settings-note > span {
  font-size: 13px;
  line-height: 1.4;
}

.settings-note p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.75;
}

.settings-version {
  margin: 16px 0 0;
  color: var(--muted-light);
  font-size: 9px;
  text-align: center;
}

/* ---------- 互动弹窗 ---------- */

.fun-sheet {
  width: min(480px, calc(100% - 28px));
}

.fun-affection {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
  padding: 13px;
  overflow: hidden;
  background: linear-gradient(135deg, #fbe4d8, #fff4dd);
  border: 1px solid #ecd0b9;
  border-radius: 15px;
}

.fun-affection-heart {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: none;
  color: var(--coral);
  background: rgba(255, 250, 242, .72);
  border: 1px solid rgba(207, 93, 77, .2);
  border-radius: 50%;
  font-size: 20px;
}

.fun-affection-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.fun-affection-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.fun-affection-copy strong {
  color: var(--coral-deep);
  font-size: 21px;
  line-height: 1.15;
}

.fun-affection-copy strong small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.fun-affection-copy > span {
  color: var(--muted);
  font-size: 9px;
}

.love-meter {
  width: 54px;
  height: 6px;
  flex: none;
  overflow: hidden;
  background: rgba(255, 250, 242, .7);
  border-radius: 999px;
}

.love-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--butter));
  border-radius: inherit;
  transition: width .35s ease;
}

.fun-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fun-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
  text-align: left;
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.fun-card:hover {
  background: #fff9ed;
  border-color: #d6b99d;
  transform: translateY(-1px);
}

.fun-card-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--butter-soft);
  border-radius: 8px;
  font-size: 15px;
}

.fun-card > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fun-card strong {
  color: var(--ink);
  font-size: 10.5px;
}

.fun-card small {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.snack-box,
.anniversary-box {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
}

.fun-label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.fun-label span {
  color: var(--muted-light);
  font-size: 8.5px;
  font-weight: 400;
}

.snack-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.snack-row button {
  padding: 8px 3px;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 9.5px;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease;
}

.snack-row button:hover {
  background: var(--butter-soft);
  border-color: #d8bb88;
}

.anniversary-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.anniversary-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.anniversary-controls input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.anniversary-controls input:focus {
  border-color: var(--teal);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 100;
  max-width: min(360px, calc(100% - 32px));
  padding: 9px 15px;
  color: #fffaf3;
  background: rgba(67, 48, 42, .94);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in .22s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 桌面悬浮窗（Document Picture-in-Picture） ---------- */

body.pip-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f8e6d7;
  font-size: 12px;
}

.pip-body::before {
  opacity: .18;
}

.pip-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  padding: 9px;
  gap: 7px;
}

.pip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 1px 2px;
}

.pip-brand-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink);
  background: var(--card-bright);
  border: 1.2px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  transform: rotate(-4deg);
}

.pip-head-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.3;
}

.pip-head-copy strong {
  font-size: 11px;
  letter-spacing: .03em;
}

.pip-presence {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 8px;
}

.pip-presence i {
  width: 5px;
  height: 5px;
  background: var(--muted-light);
  border-radius: 50%;
}

.pip-presence.is-online i {
  background: var(--teal);
}

.pip-head-actions {
  display: flex;
  gap: 3px;
}

.pip-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink-soft);
  background: rgba(255, 251, 244, .7);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1;
}

.pip-icon:hover {
  background: var(--card-bright);
}

.pip-scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
  min-height: 126px;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 20%, rgba(255, 253, 246, .7) 0 13%, transparent 13.5%),
    linear-gradient(160deg, #fae4d4, #f1c8af);
  border: 1.4px solid var(--line-strong);
  border-radius: 17px;
  box-shadow: 3px 3px 0 rgba(74, 53, 45, .08);
}

.pip-scene::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  background: #d9a787;
  border-top: 1px solid rgba(74, 53, 45, .12);
}

.pip-pet {
  position: relative;
  z-index: 2;
  width: min(68%, 190px);
  margin-bottom: 2px;
  cursor: pointer;
  filter: drop-shadow(0 6px 7px rgba(109, 73, 56, .12));
}

.pip-pet .pet-art {
  display: block;
  width: 100%;
}

.pip-speech {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pip-speech span {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 9px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, .94);
  border: 1.1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 1.5px 1.5px 0 rgba(74, 53, 45, .07);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pip-name {
  position: absolute;
  left: 50%;
  bottom: 5px;
  z-index: 3;
  transform: translateX(-50%);
  color: rgba(74, 53, 45, .64);
  font-size: 8px;
  white-space: nowrap;
}

.pip-message {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: 30px;
  padding: 5px 8px;
  background: rgba(255, 251, 244, .84);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.pip-message strong {
  flex: none;
  color: var(--coral-deep);
  font-size: 8.5px;
}

.pip-message span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pip-composer {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.pip-composer input {
  flex: 1;
  min-width: 0;
  height: 29px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--card-bright);
  border: 1.2px solid #d9c4af;
  border-radius: 8px;
  font-size: 10px;
}

.pip-composer input:focus {
  border-color: var(--teal);
}

.pip-send {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  color: #fffaf4;
  background: var(--coral);
  border: 1.2px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
}

.pip-quick {
  display: flex;
  gap: 3px;
  flex: none;
}

.pip-quick button {
  flex: 1;
  padding: 4px 2px;
  color: var(--ink-soft);
  background: rgba(255, 251, 244, .7);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 8.5px;
  white-space: nowrap;
}

.pip-quick button:hover {
  background: var(--butter-soft);
}

.pip-toast {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 4;
  max-width: calc(100% - 20px);
  padding: 4px 9px;
  color: #fffaf4;
  background: rgba(67, 48, 42, .9);
  border-radius: 6px;
  font-size: 8px;
  transform: translateX(-50%);
}

/* ---------- 响应式 ---------- */

@media (max-width: 1040px) {
  .app-shell {
    width: min(100% - 40px, 980px);
  }

  .welcome-view {
    gap: 34px;
    grid-template-columns: minmax(0, 1fr) minmax(345px, .82fr);
  }

  .welcome-copy h1 {
    font-size: clamp(46px, 6.2vw, 67px);
  }

  .chat-view {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .main-pet {
    width: 218px;
  }

  .pet-prop {
    right: 34px;
    bottom: 149px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: calc(100% - 32px);
  }

  .site-head {
    min-height: 70px;
    padding-top: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand-copy strong {
    font-size: 21px;
  }

  .brand-copy small {
    display: none;
  }

  .welcome-view {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 8px 0 28px;
  }

  .welcome-copy {
    max-width: 620px;
  }

  .welcome-copy h1 {
    font-size: clamp(43px, 10vw, 62px);
  }

  .welcome-lede {
    margin-top: 18px;
    font-size: 14px;
  }

  .quiet-line {
    display: none;
  }

  .pair-card {
    width: min(100%, 500px);
    margin: 0 auto;
    padding: 10px 23px 24px;
  }

  .waiting-card {
    grid-template-columns: 1fr;
    width: min(580px, 100%);
    gap: 24px;
    padding: 24px;
  }

  .waiting-scene {
    min-height: 210px;
  }

  .waiting-pet {
    width: 155px;
    margin-bottom: 15px;
  }

  .waiting-hoop {
    top: 18px;
    height: 155px;
  }

  .waiting-copy h1 {
    font-size: clamp(34px, 7vw, 44px);
  }

  .site-foot {
    padding-top: 12px;
    font-size: 10px;
  }

  .chat-view {
    grid-template-columns: 1fr;
    grid-template-rows: 154px minmax(0, 1fr);
    gap: 10px;
    height: calc(100dvh - 92px);
    min-height: 0;
  }

  .side-panel {
    display: block;
    min-height: 0;
  }

  .pet-stage {
    height: 100%;
    min-height: 0;
    border-radius: var(--radius-lg);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .pet-stage::before {
    bottom: 40px;
    width: 180px;
    height: 150px;
    margin-left: -90px;
  }

  .pet-stage::after {
    bottom: 27px;
    width: 200px;
    margin-left: -100px;
  }

  .pet-stage-ground {
    height: 30px;
  }

  .main-pet {
    width: 146px;
    margin-bottom: 7px;
  }

  .pet-prop {
    right: calc(50% - 100px);
    bottom: 85px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .pet-speech {
    top: 8px;
    left: 12px;
    right: 12px;
    justify-content: flex-start;
  }

  .pet-speech > span {
    max-width: 86%;
    padding: 5px 10px;
    font-size: 9px;
    text-align: left;
  }

  .pet-speech > span::after {
    left: 30px;
  }

  .pet-nameplate {
    display: none;
  }

  .pet-love-badge {
    right: 10px;
    bottom: 36px;
    padding: 2px 7px;
    font-size: 8px;
  }

  .pet-love-badge b {
    font-size: 8.5px;
  }

  .pet-stage-spark {
    opacity: .7;
  }

  .sparkle-one {
    top: 37px;
    left: 24px;
  }

  .sparkle-two {
    top: 29px;
    right: 27px;
  }

  .cloud-one {
    top: 77px;
    width: 45px;
  }

  .cloud-two {
    top: 98px;
    width: 56px;
  }

  .partner-now,
  .members-strip,
  .side-actions {
    display: none;
  }

  .chat-panel {
    border-radius: var(--radius-lg);
    min-height: 0;
  }

  .chat-head {
    min-height: 60px;
    padding: 11px 16px 10px;
  }

  .chat-panel::before {
    left: 16px;
    right: 16px;
  }

  .avatar {
    width: 35px;
    height: 35px;
    border-radius: 11px;
    font-size: 14px;
  }

  .chat-person-copy h2 {
    font-size: 16px;
  }

  .message-scroll {
    padding: 15px 16px 7px;
  }

  .quick-report {
    padding-left: 12px;
    padding-right: 12px;
  }

  .composer {
    padding-left: 11px;
    padding-right: 11px;
  }

  .jump-new {
    right: 14px;
    bottom: 115px;
  }

  .notify-banner {
    margin: 9px 12px 0;
  }

  .msg-stack {
    max-width: 84%;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: calc(100% - 24px);
  }

  .site-head {
    padding-bottom: 4px;
  }

  .welcome-view {
    gap: 22px;
    padding-top: 2px;
  }

  .welcome-copy h1 {
    font-size: clamp(40px, 12.2vw, 53px);
  }

  .welcome-lede {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.8;
  }

  .welcome-pet-line,
  .feature-pills {
    display: none;
  }

  .pair-card {
    padding: 9px 18px 21px;
    border-radius: 23px;
  }

  .pair-tabs {
    margin: 9px 0 14px;
  }

  .pair-illustration {
    height: 74px;
    margin-bottom: 8px;
  }

  .pair-letter {
    transform: scale(.74) rotate(-3deg);
    margin-top: 9px;
  }

  .pair-key {
    transform: scale(.74);
    margin-top: 2px;
  }

  .field input {
    height: 45px;
    font-size: 14px;
  }

  .primary-button {
    min-height: 50px;
  }

  .waiting-card {
    padding: 17px;
    border-radius: 24px;
  }

  .waiting-scene {
    min-height: 172px;
  }

  .waiting-pet {
    width: 130px;
  }

  .waiting-hoop {
    top: 14px;
    height: 130px;
    width: 125px;
  }

  .waiting-lede {
    font-size: 12.5px;
  }

  .invite-code-wrap {
    padding-left: 13px;
  }

  .invite-code {
    font-size: 23px;
  }

  .waiting-steps {
    margin-top: 16px;
  }

  .chat-view {
    grid-template-rows: 132px minmax(0, 1fr);
    height: calc(100dvh - 84px);
  }

  .main-pet {
    width: 128px;
    margin-bottom: 4px;
  }

  .pet-prop {
    right: calc(50% - 86px);
    bottom: 68px;
    width: 27px;
    height: 27px;
    font-size: 13px;
  }

  .pet-speech > span {
    max-width: 82%;
  }

  .pet-stage::before {
    bottom: 32px;
    width: 150px;
    height: 120px;
    margin-left: -75px;
  }

  .pet-stage::after {
    bottom: 22px;
    width: 170px;
    margin-left: -85px;
  }

  .pet-stage-ground {
    height: 25px;
  }

  .chat-head {
    padding-left: 13px;
    padding-right: 13px;
  }

  .icon-button.small {
    width: 33px;
    height: 33px;
  }

  .message-scroll {
    padding: 13px 13px 6px;
  }

  .msg-stack {
    max-width: 86%;
  }

  .msg-bubble {
    padding: 8px 11px;
    font-size: 13px;
  }

  .quick-report {
    padding: 6px 10px 4px;
  }

  .quick-label {
    display: none;
  }

  .quick-chip {
    padding: 4px 7px;
    font-size: 9px;
  }

  .composer {
    padding: 0 9px calc(8px + var(--safe-bottom));
  }

  .composer-meta {
    font-size: 8px;
  }

  .composer-meta > span:first-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .notify-banner {
    margin: 8px 9px 0;
    gap: 7px;
  }

  .notify-banner p span {
    display: none;
  }

  .notify-banner-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .status-grid {
    gap: 5px;
  }

  .status-option {
    min-height: 55px;
    font-size: 8.5px;
  }

  .sheet {
    width: calc(100% - 18px);
  }

  .sheet-inner {
    padding: 20px 17px;
    border-radius: 21px;
  }

  .fun-grid {
    grid-template-columns: 1fr;
  }

  .snack-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .anniversary-line {
    font-size: 8.5px;
  }
}

@media (max-width: 860px) {
  body.in-chat {
    overflow: hidden;
  }

  body.in-chat .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
  }

  body.in-chat .site-head,
  body.in-chat .site-foot {
    display: none;
  }

  body.in-chat .main-stage {
    height: 100%;
    padding: 0;
  }

  body.in-chat .chat-view {
    height: 100dvh;
    grid-template-rows: min(27dvh, 190px) minmax(0, 1fr);
    gap: 0;
    padding: 0;
  }

  body.in-chat .pet-stage {
    border-width: 0 0 1.4px;
    border-radius: 0;
    box-shadow: none;
    padding-top: max(env(safe-area-inset-top, 0px), 6px);
  }

  body.in-chat .chat-panel {
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.in-chat .chat-panel::before {
    display: none;
  }

  body.in-chat .chat-head {
    padding-top: max(8px, calc(env(safe-area-inset-top, 0px) * .2));
  }
}

@media (max-height: 650px) and (max-width: 860px) {
  body.in-chat .chat-view {
    grid-template-rows: 100px minmax(0, 1fr);
  }

  .pet-love-badge {
    display: none;
  }

  .main-pet {
    width: 82px;
    margin-bottom: 16px;
  }

  .pet-prop {
    right: calc(50% - 66px);
    bottom: 57px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .pet-speech {
    display: none;
  }

  .pet-stage::before,
  .pet-stage::after {
    display: none;
  }

  .pet-stage-ground {
    height: 22px;
  }

  .composer-meta {
    display: none;
  }

  .quick-report {
    padding-top: 4px;
  }
}

/* 横屏手机：把桌宠收进左侧，聊天区留出高度 */
@media (orientation: landscape) and (max-height: 520px) and (min-width: 600px) and (max-width: 860px) {
  body.in-chat .chat-view {
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100dvh;
    gap: 0;
  }

  body.in-chat .side-panel {
    display: block;
    height: 100%;
    min-height: 0;
  }

  body.in-chat .pet-stage {
    height: 100%;
    min-height: 0;
    border-width: 0 1.4px 0 0;
    border-radius: 0;
    padding-top: 0;
  }

  body.in-chat .pet-speech {
    display: none;
  }

  body.in-chat .main-pet {
    width: 112px;
    margin-bottom: 9px;
  }

  body.in-chat .pet-prop {
    right: 10px;
    bottom: 108px;
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  body.in-chat .pet-nameplate {
    display: none;
  }

  body.in-chat .pet-stage::before {
    display: block;
    bottom: 34px;
    width: 105px;
    height: 130px;
    margin-left: -52px;
  }

  body.in-chat .pet-stage::after {
    display: block;
    bottom: 22px;
    width: 116px;
    margin-left: -58px;
  }

  body.in-chat .pet-stage-ground {
    height: 22px;
  }

  body.in-chat .pet-stage-spark {
    display: none;
  }

  body.in-chat .notify-banner {
    margin: 6px 10px 0;
    padding: 6px 8px;
  }

  body.in-chat .notify-banner-icon {
    display: none;
  }

  body.in-chat .notify-banner p span {
    display: none;
  }

  body.in-chat .notify-banner strong {
    font-size: 10px;
  }

  body.in-chat .chat-head {
    min-height: 54px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 860px) and (max-height: 460px) {
  body.in-chat .notify-banner {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (hover: none) {
  .quick-chip:hover {
    background: rgba(255, 253, 247, .8);
    border-color: var(--line);
    transform: none;
  }

  .main-pet:hover {
    transform: none;
  }

  .soft-button:hover,
  .icon-button:hover,
  .tiny-button:hover,
  .copy-mini:hover,
  .quick-more:hover {
    transform: none;
  }
}

/* ---------- 轻微的背景浮动 ---------- */

@keyframes float-heart {
  0%, 100% { transform: translateY(0) rotate(-8deg); opacity: .6; }
  50% { transform: translateY(-8px) rotate(5deg); opacity: 1; }
}

/* ---------- 云端版补充 ---------- */

.chat-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.chat-name-row h2 {
  margin: 0;
}

.e2e-pill {
  flex: none;
  padding: 2px 6px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(76, 139, 126, .22);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.5;
}

.lock-pin {
  flex: none;
  font-size: 14px;
  line-height: 1.2;
}

#joinCode {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.waiting-lede code {
  padding: 1px 4px;
  color: var(--coral-deep);
  background: rgba(232, 120, 103, .08);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
}

@media (max-width: 520px) {
  .e2e-pill {
    font-size: 7px;
    padding: 1px 5px;
  }
}

/* ---------- 表情面板 ---------- */

.composer {
  position: relative;
}

.composer-box {
  min-width: 0;
}

.emoji-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 37px;
  flex: none;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}

.emoji-button:hover {
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.emoji-button:active {
  transform: scale(.92);
}

.emoji-button svg {
  width: 21px;
  height: 21px;
}

.emoji-panel {
  position: absolute;
  left: 16px;
  right: auto;
  bottom: calc(100% + 4px);
  width: min(390px, calc(100% - 32px));
  z-index: 30;
  max-height: min(380px, 48vh);
  padding: 10px 11px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fffaf1;
  border: 1.4px solid var(--line-strong);
  border-radius: 17px;
  box-shadow: 4px 5px 0 rgba(74, 53, 45, .12), 0 16px 40px rgba(74, 53, 45, .13);
  scrollbar-width: thin;
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-panel-head {
  position: sticky;
  top: -10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 8px;
  background: #fffaf1;
  border-bottom: 1px dashed var(--line);
}

.emoji-panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.emoji-panel-head strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.emoji-panel-head span {
  color: var(--muted-light);
  font-size: 8px;
}

.emoji-clear {
  flex: none;
  padding: 3px 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 8px;
}

.emoji-clear:hover {
  color: var(--coral-deep);
  background: var(--coral-soft);
}

.emoji-section {
  margin-top: 9px;
}

.emoji-section h3 {
  margin: 0 0 4px 2px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}

.emoji-option {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 36px;
  padding: 2px;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 22px;
  line-height: 1.15;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.emoji-option:hover {
  background: var(--coral-soft);
  border-color: rgba(217, 196, 175, .55);
  transform: translateY(-1px) scale(1.08);
}

.emoji-option:active {
  transform: scale(.88);
}

.emoji-option.is-recent {
  background: rgba(232, 120, 103, .045);
}

.msg-bubble.is-emoji-only,
.msg-row.is-mine .msg-bubble.is-emoji-only {
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(40px, 9vw, 52px);
  line-height: 1.16;
  white-space: normal;
  overflow-wrap: anywhere;
  animation: emoji-bubble-pop .34s cubic-bezier(.2, .8, .3, 1.25) both;
}

.msg-bubble.is-emoji-only.is-emoji-many {
  font-size: clamp(29px, 7vw, 39px);
  line-height: 1.2;
}

.msg-row.is-emoji-row {
  margin-top: 2px;
}

.msg-row.is-emoji-row .msg-meta {
  margin-top: 1px;
}

@keyframes emoji-bubble-pop {
  0% { opacity: 0; transform: scale(.55) rotate(-5deg); }
  65% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.emoji-rain {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.emoji-particle {
  position: absolute;
  bottom: 86px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 22px;
  animation: emoji-rise 1.55s ease-out forwards;
}

@keyframes emoji-rise {
  0% { opacity: 0; transform: translateY(8px) scale(.6) rotate(-8deg); }
  18% { opacity: 1; }
  70% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-105px) scale(1.08) rotate(9deg); }
}

@media (max-width: 520px) {
  .emoji-panel {
    left: 0;
    right: 0;
    width: auto;
    max-height: 43vh;
    padding: 9px 9px 10px;
  }

  .emoji-panel-head {
    top: -9px;
    padding-bottom: 7px;
  }

  .emoji-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
  }

  .emoji-option {
    min-height: 35px;
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg-bubble.is-emoji-only,
  .emoji-particle {
    animation: none;
  }
}

/* ---------- 心情天气 / 我在 / 退出 ---------- */

.partner-weather-line {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 4px 0 0;
  padding: 2px 7px;
  overflow: hidden;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(76, 139, 126, .18);
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-weather-line[hidden] {
  display: none;
}

.quick-here,
.quick-weather {
  flex: none;
  padding: 4px 8px;
  color: var(--teal);
  background: rgba(255, 253, 247, .84);
  border: 1px solid rgba(76, 139, 126, .28);
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.35;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.quick-weather {
  color: var(--coral-deep);
  border-color: rgba(232, 120, 103, .28);
}

.quick-here:hover,
.quick-weather:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.quick-weather:hover {
  background: var(--coral-soft);
  border-color: var(--coral);
}

.quick-here:disabled,
.quick-here.is-cooling {
  opacity: .48;
  cursor: default;
  transform: none;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0 4px;
}

.weather-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 62px;
  padding: 8px 4px;
  color: var(--muted);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 9px;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.weather-option span {
  font-size: 22px;
  line-height: 1.2;
}

.weather-option:hover {
  background: #fffaf0;
  border-color: #cfb69f;
  transform: translateY(-1px);
}

.weather-option.is-selected {
  color: var(--ink);
  background: var(--butter-soft);
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px rgba(232, 120, 103, .3);
}

.action-card.is-here {
  color: var(--teal);
  background: #f1f8f4;
  border-color: rgba(76, 139, 126, .25);
}

.action-card.is-here .action-emoji {
  background: #e3f2eb;
  border-color: rgba(76, 139, 126, .2);
}

.danger-button {
  flex: none;
  padding: 5px 9px;
  color: #a64d43;
  background: #fff0eb;
  border: 1px solid rgba(166, 77, 67, .28);
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
}

.danger-button:hover {
  color: #fff;
  background: #b55447;
  border-color: #b55447;
}

.destroy-warning {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 12px 0;
  padding: 9px 11px;
  color: #8c443b;
  background: #fff1ec;
  border: 1px solid rgba(166, 77, 67, .2);
  border-radius: 10px;
  font-size: 9px;
  line-height: 1.55;
}

.destroy-warning strong {
  font-size: 10px;
}

.destroy-warning span {
  color: #a2685e;
}

.danger-primary {
  color: #fffaf4 !important;
  background: #b55447 !important;
  border-color: #8f3d33 !important;
}

.danger-primary:hover {
  background: #9f4439 !important;
}

@media (max-width: 520px) {
  .quick-here,
  .quick-weather {
    padding: 4px 6px;
    font-size: 9px;
  }

  .quick-label {
    display: none;
  }

  .weather-grid {
    gap: 6px;
  }
}

/* ---------- 缩略照片 / 语音 ---------- */

.partner-photo-chip {
  display: block;
  width: 25px;
  height: 25px;
  flex: none;
  padding: 0;
  overflow: hidden;
  background: var(--card-bright);
  border: 1.5px solid var(--card-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform .15s ease;
}

.partner-photo-chip:hover {
  transform: scale(1.08);
}

.partner-photo-chip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.partner-photo-chip[hidden] {
  display: none;
}

.partner-snapshot {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 9px;
  padding: 5px 6px;
  color: var(--muted);
  background: rgba(255, 253, 247, .7);
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: left;
}

.partner-snapshot:hover {
  background: #fffaf0;
  border-color: #d8bb88;
}

.partner-snapshot img {
  width: 45px;
  height: 45px;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.partner-snapshot span {
  font-size: 8.5px;
}

.partner-snapshot[hidden] {
  display: none;
}

.camera-stage {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 6px 0 4px;
}

.camera-lens {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 253, 247, .86), rgba(232, 210, 190, .8));
  border: 5px solid #f8e3d2;
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px var(--line-strong),
    0 0 0 8px rgba(255, 251, 242, .7),
    0 12px 28px rgba(74, 53, 45, .14);
}

.camera-lens::after {
  content: "";
  position: absolute;
  inset: 9%;
  border: 1px dashed rgba(255, 251, 244, .65);
  border-radius: 50%;
  pointer-events: none;
}

.camera-lens video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform .16s ease;
}

.camera-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-preview-img[hidden],
.camera-actions [hidden],
.my-photo-chip[hidden] {
  display: none !important;
}

.camera-zoom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 9px;
}

.camera-zoom-row input {
  flex: 1;
  accent-color: var(--coral);
}

.camera-zoom-row strong {
  min-width: 34px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-align: right;
}

.camera-zoom-row[hidden] {
  display: none;
}

.camera-sheet {
  width: min(500px, calc(100vw - 24px));
}

.camera-aperture {
  position: absolute;
  top: 2px;
  right: calc(50% - 190px);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--coral-deep);
  background: var(--card-bright);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.camera-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.camera-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.camera-capture {
  flex: 0 1 180px;
  margin: 0;
}

.voice-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 0 6px;
}

.voice-orb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  background: var(--teal-soft);
  border: 1px solid rgba(76, 139, 126, .25);
  border-radius: 50%;
  font-size: 27px;
  transition: background .2s ease, transform .2s ease;
}

.voice-orb.is-recording {
  background: #ffe5df;
  border-color: rgba(232, 120, 103, .45);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232, 120, 103, .25); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(232, 120, 103, 0); }
}

.voice-recorder strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .04em;
}

.voice-record-button {
  padding: 7px 15px;
  color: #fffaf4;
  background: var(--coral);
  border: 1.3px solid var(--line-strong);
  border-radius: 999px;
  font-size: 10px;
}

.voice-record-button.is-recording {
  background: #b55447;
}

.voice-hint {
  color: var(--muted-light);
  font-size: 8px;
}

.voice-sheet audio {
  width: 100%;
  height: 36px;
  margin: 8px 0 0;
}

.voice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.voice-actions .primary-button {
  flex: 0 1 180px;
  margin: 0;
}

.photo-viewer-sheet {
  width: min(560px, calc(100vw - 24px));
}

.photo-viewer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.photo-viewer-frame {
  display: grid;
  place-items: center;
  max-height: 62vh;
  overflow: hidden;
  background: #f5e3d4;
  border: 1.5px solid var(--line-strong);
  border-radius: 20px;
}

.photo-viewer-frame img {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.photo-viewer-note {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.msg-bubble.is-voice {
  padding: 5px 7px;
  background: var(--card-bright);
  border-color: var(--line-strong);
}

.msg-row.is-mine .msg-bubble.is-voice {
  background: var(--coral-soft);
}

.msg-bubble.is-voice audio {
  display: block;
  width: min(230px, 54vw);
  height: 34px;
}

.voice-duration {
  display: block;
  margin: 2px 3px 0;
  color: var(--muted);
  font-size: 8px;
}

.msg-row.is-mine .voice-duration {
  color: rgba(255, 250, 244, .8);
}

@media (max-width: 520px) {
  .camera-aperture {
    right: calc(50% - 150px);
  }

  .camera-actions {
    gap: 6px;
  }

  .camera-capture {
    flex-basis: 145px;
  }

  .photo-viewer-inner {
    padding: 13px;
  }

  /* 16px 可避免 iOS Safari 聚焦输入框时自动放大、键盘闪动 */
  .composer textarea {
    font-size: 16px;
  }
}

/* ---------- 团团邮差 / 睡前语音盲盒 ---------- */

.fun-extras {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.fun-extras .soft-button {
  justify-content: center;
}

.mail-paper {
  margin: 13px 0 5px;
  padding: 17px 16px;
  color: var(--ink-soft);
  background:
    linear-gradient(180deg, rgba(255, 253, 245, .98), rgba(255, 247, 231, .98)),
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(217, 196, 175, .23) 25px 26px);
  border: 1px solid #e6cfb5;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 4px 5px 0 rgba(74, 53, 45, .07);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-time {
  margin: 0 0 8px;
  color: var(--muted-light);
  font-size: 8px;
  text-align: right;
}

.sealed-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.sealed-status p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  background: rgba(255, 253, 247, .72);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 9.5px;
}

.sealed-status b {
  color: var(--ink);
  font-weight: 600;
}

.sealed-status span {
  color: var(--muted);
}

.sealed-players {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}

.sealed-player {
  padding: 8px 10px;
  background: #fffaf0;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.sealed-player strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 9px;
}

.sealed-player audio {
  display: block;
  width: 100%;
  height: 34px;
}

.sealed-reset {
  margin-top: 10px;
}

.sealed-players[hidden],
.sealed-reset[hidden] {
  display: none;
}

/* ---------- 抱抱 / 安静 / 团团世界 ---------- */

.quick-hug {
  flex: none;
  padding: 4px 8px;
  color: #b46a55;
  background: #fff4ed;
  border: 1px solid rgba(232, 120, 103, .28);
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.35;
  white-space: nowrap;
}

.quick-hug:hover {
  background: var(--coral-soft);
  border-color: var(--coral);
}

.quick-hug:disabled {
  opacity: .55;
}

.quiet-reply-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 7px 18px 0;
  padding: 7px 9px;
  background: #f2f8f5;
  border: 1px dashed rgba(76, 139, 126, .3);
  border-radius: 11px;
  font-size: 8.5px;
}

.quiet-reply-bar[hidden] {
  display: none;
}

.quiet-reply-bar > span {
  margin-right: 2px;
  color: var(--teal);
  font-weight: 600;
}

.quiet-reply-bar button {
  padding: 3px 7px;
  color: var(--ink-soft);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8.5px;
}

.quiet-reply-bar button:hover {
  background: var(--butter-soft);
}

.hug-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 246, 232, .82);
  backdrop-filter: blur(8px);
  animation: hug-fade-in .25s ease both;
}

.hug-overlay[hidden] {
  display: none;
}

.hug-orb {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  background: #fff8ea;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: 6px 7px 0 rgba(74, 53, 45, .1);
  font-size: 57px;
  animation: hug-bounce .9s ease-in-out infinite;
}

.hug-overlay p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
}

@keyframes hug-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hug-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7px) scale(1.06); }
}

.pet-outfit {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 7;
  font-size: 31px;
  line-height: 1;
  filter: drop-shadow(1px 3px 1px rgba(74, 53, 45, .13));
  pointer-events: none;
}

.pet-outfit[hidden] {
  display: none;
}

.pet-stage.room-spring {
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, .6) 0 8%, transparent 8.5%),
    linear-gradient(165deg, #fbe8dc, #f3d7c3 55%, #eacbb3);
}

.pet-stage.room-starry {
  background:
    radial-gradient(circle at 18% 22%, #fff4d2 0 2px, transparent 3px),
    radial-gradient(circle at 72% 15%, #fff4d2 0 2px, transparent 3px),
    radial-gradient(circle at 84% 42%, #fff4d2 0 1.5px, transparent 2.5px),
    linear-gradient(170deg, #4d5578, #2f3d5a 58%, #26334d);
}

.pet-stage.room-seaside {
  background:
    radial-gradient(circle at 17% 24%, #fff6d8 0 6%, transparent 6.5%),
    linear-gradient(180deg, #dff2f0 0%, #b9e2e3 52%, #ecd5b9 52.5%, #f6e5cf 100%);
}

.pet-stage.room-starry .pet-speech,
.pet-stage.room-starry .pet-nameplate {
  color: #fff8ea;
}

.pet-stage.room-starry .pet-speech {
  background: rgba(255, 248, 234, .92);
  color: var(--ink);
}

.fun-fish-count {
  display: block;
  margin-top: 3px;
  color: var(--coral-deep);
  font-size: 8.5px;
}

.pet-world-sheet {
  width: min(520px, calc(100vw - 24px));
}

.pet-world-fish {
  margin: 8px 0 10px;
  color: var(--coral-deep);
  font-family: var(--font-mono);
  font-size: 12px;
}

.pet-world-tabs {
  display: flex;
  gap: 5px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line);
}

.pet-world-tabs button {
  padding: 5px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
}

.pet-world-tabs button.is-active {
  color: var(--ink);
  background: var(--butter-soft);
  border-color: var(--line);
}

.pet-world-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 49vh;
  padding: 11px 0;
  overflow-y: auto;
}

.pet-world-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  background: rgba(255, 253, 247, .8);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pet-world-item.is-active {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px rgba(232, 120, 103, .2);
}

.pet-world-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-world-item-head span {
  font-size: 22px;
}

.pet-world-item-head strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.pet-world-item p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.pet-world-item button {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 8.5px;
}

.pet-world-item button:hover {
  background: var(--butter-soft);
}

.pet-world-item button.is-equipped {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: rgba(76, 139, 126, .25);
}

.pet-world-note {
  margin: 0;
  color: var(--muted-light);
  font-size: 8px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .quiet-reply-bar {
    margin: 6px 9px 0;
  }

  .quick-hug {
    padding: 4px 6px;
    font-size: 9px;
  }

  .pet-world-grid {
    gap: 6px;
  }
}



/* =========================================================
   贴贴 1.7 · 安静的暖
   在保留旧功能选择器的前提下，统一为更克制、清楚的视觉系统。
   ========================================================= */

:root {
  --paper: #f7f3eb;
  --paper-deep: #efe8dd;
  --card: #fffdf9;
  --card-bright: #fffefa;
  --ink: #2f2b28;
  --ink-soft: #514b45;
  --muted: #746d66;
  --muted-light: #9b938a;
  --line: #e8e0d5;
  --line-strong: #d9cfc2;
  --coral: #e77462;
  --coral-deep: #c95646;
  --coral-soft: #fae4df;
  --peach: #f1d5c7;
  --butter: #e8bd69;
  --butter-soft: #f8edcf;
  --teal: #5e7568;
  --teal-soft: #e6eee9;
  --shadow-sm: 0 1px 2px rgba(47, 43, 40, .04);
  --shadow: 0 24px 70px -38px rgba(47, 43, 40, .28);
  --shadow-card: 0 12px 34px -26px rgba(47, 43, 40, .24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-body: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { background: var(--paper); }

body {
  color: var(--ink);
  background:
    radial-gradient(760px 560px at 7% 0%, rgba(238, 213, 194, .54), transparent 64%),
    radial-gradient(620px 500px at 100% 8%, rgba(237, 220, 174, .34), transparent 64%),
    var(--paper);
  font-size: 15px;
  line-height: 1.6;
}

body::before,
.paper-texture,
.bg-shape { display: none !important; }
body.in-chat { overflow: hidden; }

button, input, textarea, select { font-family: var(--font-body); }
button { min-height: 0; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 48px), 1200px);
  min-width: 0;
  margin: 0 auto;
}

.main-stage { min-width: 0; }

.site-head {
  min-height: 82px;
  padding: 20px 0 12px;
  border: 0;
}

.brand { gap: 11px; }

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(88, 76, 66, .13);
  border-radius: 14px;
  background: rgba(255, 253, 248, .86);
  box-shadow: 0 6px 20px -16px rgba(47, 43, 40, .35);
}

.brand-mark svg { width: 32px; height: 32px; }
.brand-copy { gap: 1px; }

.brand-copy strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .04em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
}

.head-status {
  min-height: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: rgba(255, 253, 248, .84);
  font-size: 12px;
}

.site-foot {
  padding: 24px 0 30px;
  color: var(--muted-light);
  font-size: 11px;
  letter-spacing: .04em;
}

/* ---------- 欢迎 / 配对 ---------- */

.welcome-view {
  min-height: calc(100dvh - 166px);
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, .82fr);
  gap: clamp(50px, 7vw, 100px);
  align-items: center;
  padding: 28px 0 62px;
}

.welcome-copy { min-width: 0; max-width: 610px; }

.eyebrow {
  gap: 9px;
  margin: 0 0 20px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(231, 116, 98, .11);
}

.welcome-copy h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(58px, 6.2vw, 82px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.045em;
}

.welcome-copy h1 em {
  position: relative;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}

.welcome-copy h1 em::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 1%;
  bottom: 2px;
  height: 8px;
  z-index: -1;
  border-radius: 999px;
  background: rgba(232, 189, 105, .42);
  transform: rotate(-.6deg);
}

.welcome-lede {
  margin: 24px 0 0;
  max-width: 510px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
}

.welcome-pet-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin: 24px 0 0;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgba(217, 207, 194, .72);
  border-radius: 999px;
  background: rgba(255, 253, 249, .66);
}

.mini-pet-slot {
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--coral-soft);
  border-radius: 50%;
}

.welcome-pet-line p { margin: 0; color: var(--muted); font-size: 12px; }
.welcome-pet-line strong { color: var(--ink); font-weight: 700; }

.feature-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.feature-pills li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 92px;
  padding: 15px 13px;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, .58);
  border: 1px solid rgba(217, 207, 194, .68);
  border-radius: 16px;
  box-shadow: none;
  font-size: 12px;
}

.feature-number {
  flex: none;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
}

.feature-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.feature-copy strong { color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.5; }
.feature-copy small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.quiet-line { margin: 19px 0 0; color: var(--muted-light); font-size: 12px; }

.pair-card {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 26px;
  overflow: visible;
  background: rgba(255, 253, 249, .94);
  border: 1px solid rgba(214, 203, 190, .84);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.pair-card::before, .pair-card-pin { display: none; }

.pair-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  background: #f1ebe2;
  border: 1px solid #e9e1d7;
  border-radius: 14px;
}

.pair-tab {
  min-height: 42px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}

.pair-tab.is-active {
  color: var(--ink);
  background: var(--card-bright);
  box-shadow: 0 3px 12px -8px rgba(47, 43, 40, .38);
}

.pair-form { min-width: 0; }

.pair-illustration {
  position: relative;
  display: grid;
  place-items: center;
  height: 132px;
  margin: 0 0 23px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 26%, rgba(232, 189, 105, .28), transparent 22%),
    linear-gradient(145deg, #f5e8df, #f1ece2);
  border: 1px solid rgba(218, 206, 192, .62);
  border-radius: 20px;
}

.pair-illustration::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(94, 117, 104, .17);
  border-radius: 50%;
}

.pair-letter {
  width: 136px;
  height: 84px;
  margin: 0;
  border: 1px solid #ddcabb;
  border-radius: 9px;
  background: #fffaf3;
  box-shadow: 0 12px 30px -18px rgba(47, 43, 40, .35);
  transform: rotate(-2deg);
}

.letter-flap { border-color: transparent transparent #ead9ca transparent; }
.letter-stamp { color: var(--coral); }
.letter-to { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.letter-seal { color: var(--coral); background: var(--coral-soft); }

.pair-card-note {
  position: absolute;
  left: 22px;
  bottom: 14px;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.pair-spark { display: none; }
.pair-key { transform: scale(.82) rotate(-8deg); }

.field { gap: 8px; margin: 0 0 16px; }
.field > span { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.field > span small { margin-left: 5px; color: var(--muted-light); font-size: 11px; font-weight: 400; }

.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #ded4c8;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.field textarea { min-height: 108px; padding: 12px 15px; line-height: 1.6; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .composer textarea::placeholder { color: #aaa198; }
.field input:focus, .field textarea:focus { border-color: rgba(94, 117, 104, .72); box-shadow: 0 0 0 4px rgba(94, 117, 104, .09); outline: 0; }
.field-hint { margin: -5px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.65; }

.primary-button {
  min-height: 52px;
  padding: 0 18px;
  gap: 12px;
  color: #fffdf9;
  background: var(--coral);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 22px -16px rgba(201, 86, 70, .8);
  font-size: 14px;
  font-weight: 700;
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.primary-button:hover { background: var(--coral-deep); box-shadow: 0 12px 26px -16px rgba(201, 86, 70, .9); }
.primary-button:active { transform: translateY(1px); }

.button-arrow {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  font-size: 13px;
}

.form-tiny { margin: 11px 0 0; color: var(--muted-light); font-size: 10px; text-align: center; }
.pair-error { margin-top: 12px; border-radius: 11px; font-size: 12px; }

/* ---------- 等待对方 ---------- */

.waiting-view { min-height: calc(100dvh - 166px); padding: 32px 0 70px; }

.waiting-card {
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  width: min(100%, 880px);
  margin: 0 auto;
  padding: 34px;
  background: rgba(255, 253, 249, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.waiting-scene {
  height: 310px;
  margin: 0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .92), transparent 33%),
    linear-gradient(155deg, #f0ded3, #e9e5dc);
}

.waiting-hoop { border-color: rgba(94, 117, 104, .25); }
.waiting-pet { width: 190px; bottom: 38px; }

.waiting-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 54px);
  line-height: 1.18;
}

.waiting-lede { margin: 16px 0 22px; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }

.invite-code-wrap {
  min-height: 60px;
  padding: 8px 8px 8px 16px;
  background: #f6f1e9;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.invite-code { color: var(--ink); font-size: 18px; letter-spacing: .12em; }
.copy-mini { width: 44px; height: 44px; border-radius: 11px; background: var(--card-bright); border: 1px solid var(--line); }
.waiting-actions { width: 100%; margin-top: 12px; }
.waiting-actions .primary-button { width: 100%; }
.waiting-status { margin: 14px 0 18px; color: var(--muted); font-size: 12px; }
.waiting-steps { gap: 8px; margin: 0 0 18px; padding: 0; }
.waiting-steps li { min-height: 40px; color: var(--ink-soft); background: transparent; border: 0; font-size: 12px; }
.waiting-steps b { width: 25px; height: 25px; color: var(--teal); background: var(--teal-soft); font-size: 10px; }

.help-details {
  margin: 0;
  padding: 13px 15px;
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.help-details summary { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.help-details p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }


/* ---------- 聊天 ---------- */

body.in-chat .site-head { min-height: 62px; padding: 12px 0 8px; }
body.in-chat .site-foot { display: none; }

.chat-view {
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 16px;
  width: min(100%, 1240px);
  height: calc(100dvh - 86px);
  min-height: 610px;
  margin: 0 auto;
  padding: 0 0 14px;
  align-items: stretch;
}

.side-panel {
  min-width: 0;
  min-height: 0;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
  background: rgba(242, 236, 226, .78);
  border: 1px solid rgba(217, 207, 194, .9);
  border-radius: 24px;
}

.pet-stage {
  height: 284px;
  min-height: 240px;
  border: 1px solid rgba(218, 205, 190, .8);
  border-radius: 19px;
  background:
    radial-gradient(circle at 55% 30%, rgba(255, 255, 255, .9), transparent 34%),
    linear-gradient(160deg, #f0e0d4 0%, #ebe8e0 100%);
}

.pet-stage-spark, .pet-stage-cloud { display: none; }

.pet-stage-ground {
  right: 16px;
  left: 16px;
  height: 58px;
  background: linear-gradient(180deg, rgba(206, 179, 155, .3), rgba(206, 179, 155, .13));
  border-radius: 50% 50% 0 0;
}

.main-pet {
  bottom: 28px;
  width: 178px;
  filter: drop-shadow(0 14px 18px rgba(91, 60, 49, .12));
}

.pet-speech {
  top: 16px;
  max-width: 190px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 254, 250, .92);
  border: 1px solid rgba(217, 207, 194, .8);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.pet-speech::after { background: rgba(255, 254, 250, .92); border-color: rgba(217, 207, 194, .8); }

.pet-nameplate {
  bottom: 9px;
  padding: 3px 10px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, .76);
  border: 1px solid rgba(217, 207, 194, .55);
  border-radius: 999px;
  font-size: 10px;
}

.pet-love-badge {
  right: 12px;
  bottom: 12px;
  min-height: 30px;
  color: var(--coral-deep);
  background: rgba(255, 253, 248, .92);
  border: 1px solid rgba(231, 116, 98, .2);
  box-shadow: none;
}

.partner-now {
  padding: 15px;
  background: rgba(255, 253, 249, .9);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: none;
}

.partner-now-head { margin-bottom: 10px; }
.section-label { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.status-time { color: var(--muted-light); font-size: 10px; }
.partner-now-body { gap: 11px; }

.status-emoji {
  width: 40px;
  height: 40px;
  background: var(--butter-soft);
  border: 0;
  border-radius: 12px;
  font-size: 20px;
}

.status-main { color: var(--ink); font-size: 14px; font-weight: 650; }
.status-note, .partner-weather-line { color: var(--muted); font-size: 11px; }
.partner-snapshot { width: 100%; min-height: 44px; margin-top: 11px; border-radius: 12px; border-color: var(--line); }
.members-strip { min-height: 36px; gap: 5px; }

.member-pill {
  min-height: 30px;
  padding: 4px 9px;
  background: rgba(255, 253, 249, .72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
}

.side-actions { margin-top: auto; gap: 6px; }
.side-actions .soft-button { width: 100%; min-height: 42px; justify-content: center; font-size: 12px; }
.side-hint { color: var(--muted-light); font-size: 9px; text-align: center; }

.chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background: rgba(255, 253, 249, .96);
  border: 1px solid rgba(217, 207, 194, .92);
  border-radius: 24px;
  box-shadow: 0 24px 58px -46px rgba(47, 43, 40, .38);
}

.chat-head {
  position: relative;
  z-index: 12;
  min-height: 80px;
  padding: 15px 18px;
  gap: 16px;
  background: rgba(255, 253, 249, .94);
  border-bottom: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
}

.chat-person { gap: 12px; min-width: 0; }

.avatar {
  width: 46px;
  height: 46px;
  border: 1px solid #d9cfc2;
  border-radius: 14px;
  background: var(--teal-soft);
  font-size: 18px;
}

.chat-person-copy { min-width: 0; }
.chat-name-row { gap: 8px; min-width: 0; }

.chat-name-row h2 {
  max-width: 220px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.e2e-pill {
  padding: 2px 7px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
}

.presence-line { margin-top: 2px; color: var(--muted); font-size: 11px; }
.presence-line i { width: 6px; height: 6px; background: var(--teal); }
.anniversary-line { margin-top: 1px; color: var(--coral-deep); font-size: 10px; }
.partner-photo-chip { width: 31px; height: 31px; border: 2px solid var(--card-bright); box-shadow: 0 0 0 1px var(--line); }

.chat-head-actions { position: relative; display: flex; align-items: center; margin-left: auto; }

.chat-more-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink-soft);
  background: #f5f0e8;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.chat-more-button[aria-expanded="true"] {
  color: var(--coral-deep);
  background: var(--coral-soft);
  border-color: rgba(231, 116, 98, .2);
}

.chat-more-menu {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 40;
  width: 255px;
  padding: 8px;
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 22px 50px -26px rgba(47, 43, 40, .46);
}

.chat-more-title { margin: 5px 8px 7px; color: var(--muted-light); font-size: 10px; font-weight: 700; letter-spacing: .09em; }

.chat-more-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  padding: 8px 9px;
  color: var(--ink-soft);
  border-radius: 11px;
  text-align: left;
}

.chat-more-item:hover { background: #f7f1e8; }
.chat-more-item svg { width: 20px; height: 20px; flex: none; color: var(--teal); }
.chat-more-item span { display: flex; flex-direction: column; gap: 1px; }
.chat-more-item strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.chat-more-item small { color: var(--muted); font-size: 10px; }
.connection-banner { margin: 8px 14px 0; border-radius: 10px; font-size: 11px; }
.quiet-reply-bar { margin: 8px 14px 0; padding: 8px 10px; border-radius: 12px; font-size: 11px; }
.quiet-reply-bar button { min-height: 34px; border-radius: 999px; font-size: 11px; }

.message-scroll { padding: 24px 28px 12px; scrollbar-color: #d9d0c5 transparent; }
.message-list { gap: 0; }
.date-divider { margin: 13px 0 20px; color: var(--muted-light); font-size: 10px; }
.date-divider::before, .date-divider::after { background: linear-gradient(90deg, transparent, var(--line)); }
.date-divider::after { background: linear-gradient(90deg, var(--line), transparent); }
.msg-row { margin-bottom: 12px; }
.msg-row.is-continuation { margin-top: -6px; }
.msg-stack { max-width: min(76%, 530px); }
.msg-author { margin: 0 0 4px 3px; color: var(--muted); font-size: 10px; font-weight: 650; }

.msg-bubble {
  padding: 10px 14px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid #e4dbd0;
  border-radius: 6px 17px 17px 17px;
  box-shadow: 0 5px 16px -15px rgba(47, 43, 40, .35);
  font-size: 14px;
  line-height: 1.62;
}

.msg-row.is-mine .msg-bubble {
  color: #fffdf9;
  background: var(--coral);
  border-color: var(--coral);
  border-radius: 17px 6px 17px 17px;
  box-shadow: 0 8px 20px -18px rgba(201, 86, 70, .7);
}

.msg-meta { margin-top: 4px; color: var(--muted-light); font-size: 10px; }
.msg-system span { max-width: 90%; padding: 5px 12px; color: var(--muted); background: #f4efe7; border: 0; border-radius: 999px; font-size: 10px; }
.msg-status { margin: 15px 0; }

.status-card {
  width: min(88%, 450px);
  padding: 10px 12px;
  background: #fbf5e9;
  border: 1px solid #ebddc6;
  border-radius: 14px;
  box-shadow: none;
}

.status-card-emoji { width: 34px; height: 34px; background: #fffdf9; border: 0; border-radius: 10px; font-size: 17px; }
.status-card-head { font-size: 12px; }
.status-card-head time, .action-card time { color: var(--muted-light); font-size: 9px; }
.status-card-note { color: var(--muted); font-size: 10px; }
.action-card { padding: 7px 11px; background: #fff7eb; border: 1px solid #eddfc8; border-radius: 999px; box-shadow: none; font-size: 11px; }
.action-card .action-emoji { width: 24px; height: 24px; background: #fffdf9; border: 0; }
.typing-row { font-size: 10px; }
.empty-pet { width: 66px; height: 66px; color: var(--coral); background: var(--coral-soft); border: 0; font-size: 24px; }
.chat-empty p { color: var(--muted); font-size: 12px; }

.jump-new {
  right: 24px;
  bottom: 154px;
  min-height: 36px;
  padding: 7px 13px;
  color: var(--ink-soft);
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font-size: 11px;
}

/* ---------- 快捷动作与输入 ---------- */

.quick-report {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 10px 18px 7px;
  background: rgba(255, 253, 249, .96);
  border-top: 1px solid rgba(232, 224, 213, .72);
}

.quick-label { flex: none; margin-right: 2px; color: var(--muted-light); font-size: 10px; font-weight: 650; letter-spacing: .03em; }

.quick-here, .quick-hug, .quick-weather, .quick-more {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: #f7f2ea;
  border: 1px solid #e8dfd4;
  border-radius: 999px;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.quick-here:hover, .quick-hug:hover, .quick-weather:hover, .quick-more:hover {
  color: var(--coral-deep);
  background: var(--coral-soft);
  border-color: rgba(231, 116, 98, .2);
}

.quick-more { width: 36px; min-width: 36px; padding: 0; font-size: 16px; }
.quick-chips { gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }

.quick-chip {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  white-space: nowrap;
}

.composer { margin: 0; padding: 7px 18px calc(11px + var(--safe-bottom)); background: rgba(255, 253, 249, .98); border-radius: 0 0 24px 24px; }

.composer-box {
  min-height: 54px;
  padding: 5px 6px 5px 8px;
  background: #fffefa;
  border: 1px solid #ded5ca;
  border-radius: 17px;
  box-shadow: 0 7px 20px -24px rgba(47, 43, 40, .5);
}

.composer-box:focus-within { border-color: rgba(94, 117, 104, .55); box-shadow: 0 0 0 4px rgba(94, 117, 104, .075); }
.emoji-button { width: 40px; height: 40px; border-radius: 12px; color: var(--muted); }
.emoji-button:hover { color: var(--ink); background: #f5f0e8; }
.emoji-button svg { width: 20px; height: 20px; }
.composer textarea { min-height: 40px; max-height: 128px; padding: 9px 8px; color: var(--ink); font-size: 15px; line-height: 1.45; }
.send-button { width: 42px; height: 42px; flex: none; background: var(--coral); border: 0; border-radius: 13px; box-shadow: none; }
.send-button svg { width: 20px; height: 20px; }
.composer-meta { min-height: 18px; padding: 4px 5px 0; color: var(--muted-light); font-size: 10px; }
.composer-meta .char-count { color: var(--muted); font-size: 10px; }

.emoji-panel {
  left: 18px;
  right: 18px;
  bottom: 88px;
  max-height: 330px;
  background: var(--card-bright);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 56px -28px rgba(47, 43, 40, .38);
}

.emoji-panel-head { padding: 13px 14px 10px; border-color: var(--line); }
.emoji-panel-head strong { font-size: 13px; }
.emoji-panel-head span, .emoji-clear { color: var(--muted); font-size: 10px; }
.emoji-panel-body { max-height: 265px; }
.emoji-tab, .emoji-cell { min-height: 38px; font-size: 11px; }
.emoji-cell { font-size: 22px; }


/* ---------- 统一弹层 ---------- */

.sheet {
  width: min(calc(100% - 32px), 540px);
  max-width: 540px;
  max-height: min(90dvh, 780px);
  padding: 0;
  overflow: visible;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.sheet::backdrop { background: rgba(47, 43, 40, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheet-in .2s ease both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

.sheet-inner {
  width: 100%;
  max-height: min(90dvh, 780px);
  padding: 26px;
  overflow-y: auto;
  color: var(--ink);
  background: var(--card-bright);
  border: 1px solid rgba(221, 212, 201, .9);
  border-radius: 24px;
  box-shadow: 0 30px 80px -36px rgba(47, 43, 40, .48);
}

.sheet-head { gap: 18px; margin-bottom: 21px; }
.sheet-eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .06em; }

.sheet-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.25;
}

.close-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--muted);
  background: #f4efe7;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 22px;
}

.close-button:hover { color: var(--ink); background: #eee7dd; }
.sheet .waiting-lede { margin: 0 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sheet .primary-button { width: 100%; }
.sheet .soft-button, .sheet .tiny-button { min-height: 40px; border-color: var(--line); border-radius: 11px; font-size: 11px; }
.sheet .field { margin-bottom: 15px; }
.status-grid, .weather-grid { gap: 8px; margin-bottom: 20px; }

.status-option, .weather-option {
  min-height: 58px;
  padding: 9px 7px;
  color: var(--ink-soft);
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 11px;
}

.status-option span, .weather-option span { font-size: 21px; }

.status-option.is-selected, .weather-option.is-selected {
  color: var(--coral-deep);
  background: var(--coral-soft);
  border-color: rgba(231, 116, 98, .35);
  box-shadow: inset 0 0 0 1px rgba(231, 116, 98, .12);
}

.danger-primary, .danger-button { color: #a74337; background: #fff0ec; border-color: #edc8c0; }

/* 设置 */

.settings-sheet .sheet-inner { padding-bottom: 22px; }
.settings-group-title { margin: 20px 2px 8px; color: var(--muted-light); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.settings-group-title:first-of-type { margin-top: 2px; }
.settings-group { overflow: hidden; background: #fbf8f3; border: 1px solid var(--line); border-radius: 15px; }
.setting-row { min-height: 66px; padding: 12px 14px; border-color: var(--line); }
.setting-copy { gap: 2px; }
.setting-copy strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.setting-copy span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.switch-button { width: 45px; height: 27px; }
.lock-pin { color: var(--teal); background: var(--teal-soft); }

.settings-note {
  display: block;
  margin: 18px 0 0;
  padding: 13px 14px;
  color: var(--muted);
  background: #f8f4ed;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 10px;
  line-height: 1.65;
}

.settings-note summary { color: var(--ink-soft); font-weight: 650; cursor: pointer; }
.settings-note p { margin: 9px 0 0; }
.settings-version { margin: 15px 0 2px; color: var(--muted-light); font-size: 9px; text-align: center; }

/* 团团 */

.fun-sheet .sheet-inner { display: flex; flex-direction: column; }
.fun-sheet .sheet-head { order: 0; }
.fun-sheet .fun-affection { order: 1; }
.fun-sheet .fun-extras { order: 2; }
.fun-sheet .fun-grid { order: 3; }
.fun-sheet .snack-box { order: 4; }
.fun-sheet .anniversary-box { order: 5; }

.fun-affection {
  min-height: 118px;
  padding: 18px;
  background: linear-gradient(135deg, #fbebe3, #f7edda);
  border: 1px solid #eddbcf;
  border-radius: 18px;
}

.fun-affection-heart { width: 48px; height: 48px; color: #fff; background: var(--coral); border: 0; border-radius: 15px; box-shadow: none; }
.fun-affection-copy { gap: 2px; }
.fun-affection-copy p { color: var(--ink-soft); font-size: 11px; }
.fun-affection-copy strong { color: var(--coral-deep); font-family: var(--font-display); font-size: 30px; }
.fun-affection-copy > span { color: var(--muted); font-size: 10px; }

.fun-fish-count {
  display: inline-block;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 8px;
  color: var(--teal);
  background: rgba(255, 253, 248, .72);
  border-radius: 999px;
}

.love-meter { height: 5px; margin-top: 13px; background: rgba(224, 194, 177, .45); }
.fun-extras { order: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }

.fun-extras .soft-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-height: 104px;
  padding: 13px 12px;
  color: var(--ink);
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: left;
}

.fun-extras .soft-button:hover { background: var(--butter-soft); border-color: #e8d6ae; }
.fun-extras svg { width: 22px; height: 22px; color: var(--teal); }
.fun-extras .soft-button span { display: flex; flex-direction: column; gap: 2px; }
.fun-extras strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.fun-extras small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.fun-grid { gap: 8px; margin: 0 0 12px; }

.fun-card {
  min-height: 62px;
  padding: 10px 12px;
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.fun-card-icon { width: 34px; height: 34px; background: var(--card-bright); border: 0; font-size: 18px; }
.fun-card strong { font-size: 11px; }
.fun-card small { color: var(--muted); font-size: 9px; }
.snack-box, .anniversary-box { margin: 0 0 12px; padding: 13px; background: #fbf8f3; border: 1px solid var(--line); border-radius: 14px; }
.fun-label { margin-bottom: 8px; color: var(--ink-soft); font-size: 11px; }
.snack-row button { min-height: 34px; color: var(--ink-soft); background: var(--card-bright); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }
.anniversary-summary { color: var(--muted); font-size: 10px; }
.anniversary-controls input { min-height: 40px; border-color: var(--line); border-radius: 10px; font-size: 11px; }

/* 邮差 / 盲盒 / 相机 / 语音 / 相册 */

.mail-paper {
  min-height: 150px;
  padding: 24px;
  color: var(--ink-soft);
  background:
    linear-gradient(#fffdf8, #fffdf8) padding-box,
    repeating-linear-gradient(0deg, transparent 0 27px, #eee2d4 27px 28px);
  border: 1px solid #ead9c7;
  border-radius: 4px 16px 16px 16px;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.8;
  box-shadow: 0 12px 30px -25px rgba(47, 43, 40, .4);
}

.mail-time { color: var(--muted-light); font-size: 10px; }
.sealed-status { gap: 8px; margin: 0 0 18px; }
.sealed-status p { min-height: 44px; padding: 10px 12px; background: #f8f4ed; border: 1px solid var(--line); border-radius: 11px; font-size: 11px; }
.sealed-status b { color: var(--teal); }
.camera-stage { margin: 4px auto 16px; }

.camera-lens {
  width: min(64vw, 300px);
  height: min(64vw, 300px);
  border: 8px solid #f2ebe1;
  box-shadow: 0 0 0 1px var(--line), 0 20px 46px -34px rgba(47, 43, 40, .45);
}

.camera-aperture { display: none; }
.camera-status { color: var(--muted); font-size: 10px; text-align: center; }
.camera-zoom-row { max-width: 330px; margin: 0 auto 14px; font-size: 10px; }
.camera-actions { display: flex; align-items: center; justify-content: center; gap: 10px; }

.camera-capture {
  width: 68px;
  min-width: 68px;
  height: 68px;
  min-height: 68px;
  padding: 0;
  border: 6px solid #f7e6e1;
  border-radius: 50%;
  font-size: 0;
}

.camera-capture::after { content: ""; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; }
.voice-recorder { min-height: 180px; }
.voice-orb { background: radial-gradient(circle at 36% 28%, #f4a091, var(--coral)); box-shadow: 0 20px 50px -28px rgba(201, 86, 70, .7); }
.voice-hint { color: var(--muted); font-size: 11px; }
.photo-viewer-inner { padding: 0; overflow: hidden; }
.photo-viewer-frame { border-radius: 18px; }
.pet-world-tabs { gap: 5px; padding: 4px; background: #f3eee6; border: 1px solid var(--line); border-radius: 12px; }
.pet-world-tabs button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; font-size: 11px; }
.pet-world-grid { gap: 8px; }
.pet-world-item { padding: 12px; background: #fbf8f3; border-color: var(--line); border-radius: 14px; }
.pet-world-item-head strong { font-size: 11px; }
.pet-world-item p, .pet-world-note { color: var(--muted); font-size: 9px; }
.pet-world-item button { min-height: 32px; border-color: var(--line); border-radius: 9px; font-size: 10px; }


/* ---------- 中等屏幕 ---------- */

@media (max-width: 1040px) {
  .app-shell { width: min(calc(100% - 36px), 1000px); }
  .welcome-view { grid-template-columns: minmax(0, 1fr) minmax(350px, .8fr); gap: 42px; }
  .welcome-copy h1 { font-size: clamp(52px, 6.5vw, 70px); }
  .feature-pills { grid-template-columns: 1fr; gap: 6px; }
  .feature-pills li { min-height: 0; padding: 10px 12px; }
  .chat-view { grid-template-columns: 250px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  body.in-chat { background: #f7f3eb; }
  body.in-chat .site-head { display: none; }
  body.in-chat .app-shell { width: 100%; max-width: none; }
  body.in-chat .main-stage { width: 100%; }
  .welcome-view { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 18px 0 44px; }
  .welcome-copy { max-width: none; }
  .welcome-copy h1 { font-size: clamp(48px, 9vw, 66px); }
  .welcome-lede { max-width: 620px; font-size: 16px; }
  .feature-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pair-card { max-width: 620px; margin: 0 auto; padding: 24px; }
  .waiting-card { grid-template-columns: minmax(180px, .55fr) minmax(0, 1fr); gap: 24px; padding: 24px; }
  .waiting-scene { height: 250px; }
  .waiting-pet { width: 155px; }
  .chat-view { display: block; width: 100%; height: calc(100dvh - 10px); min-height: 0; padding: 5px; }
  .side-panel { display: none; }
  .chat-panel { height: 100%; border-radius: 22px; }
  .chat-head { border-radius: 22px 22px 0 0; }
  .message-scroll { padding: 22px 24px 10px; }
  .composer { border-radius: 0 0 22px 22px; }
}

/* ---------- 手机 ---------- */

@media (max-width: 640px) {
  .app-shell { width: min(calc(100% - 28px), 620px); }
  .site-head { min-height: 68px; padding: 13px 0 8px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 13px; }
  .brand-copy strong { font-size: 20px; }
  .brand-copy small { display: none; }
  .head-status { min-height: 32px; padding: 0 10px; font-size: 10px; }
  .welcome-view { gap: 25px; padding: 9px 0 34px; }
  .eyebrow { margin-bottom: 14px; font-size: 11px; }
  .welcome-copy h1 { font-size: clamp(43px, 13vw, 56px); line-height: 1.1; }
  .welcome-copy h1 em { white-space: normal; }
  .welcome-lede { margin-top: 17px; font-size: 15px; line-height: 1.75; }
  .welcome-lede br { display: none; }
  .welcome-pet-line { margin-top: 17px; padding: 6px 12px 6px 6px; }
  .mini-pet-slot { width: 34px; height: 34px; }
  .feature-pills { grid-template-columns: 1fr; gap: 6px; margin-top: 20px; }
  .feature-pills li { min-height: 54px; padding: 10px 12px; background: rgba(255, 253, 249, .5); }
  .feature-copy { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 8px; }
  .feature-copy small { font-size: 10px; }
  .quiet-line { margin-top: 13px; font-size: 11px; }
  .pair-card { padding: 18px; border-radius: 23px; }
  .pair-tabs { margin-bottom: 17px; }
  .pair-tab { min-height: 44px; }
  .pair-illustration { height: 102px; margin-bottom: 18px; }
  .pair-letter { transform: scale(.82) rotate(-2deg); }
  .pair-card-note { left: 15px; bottom: 10px; font-size: 8px; }
  .field { margin-bottom: 14px; }
  .field input, .field textarea { font-size: 16px; }
  .field-hint { margin-bottom: 14px; font-size: 11px; }
  .primary-button { min-height: 52px; font-size: 14px; }
  .site-foot { padding: 15px 0 22px; font-size: 9px; text-align: center; }
  .waiting-view { padding: 8px 0 32px; }
  .waiting-card { display: block; padding: 18px; border-radius: 23px; }
  .waiting-scene { height: 170px; margin-bottom: 22px; }
  .waiting-pet { width: 132px; bottom: 20px; }
  .waiting-copy h1 { font-size: 39px; }
  .waiting-lede { margin: 12px 0 18px; font-size: 13px; }
  .invite-code-wrap { min-height: 56px; }
  .invite-code { font-size: 16px; }
  .waiting-steps li { font-size: 11px; }
  body.in-chat .app-shell { width: 100%; }
  body.in-chat .chat-view { height: 100dvh; padding: 0; }
  body.in-chat .chat-panel { border: 0; border-radius: 0; box-shadow: none; }
  .chat-head { min-height: 68px; padding: 10px 14px; border-radius: 0; }
  .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; }
  .chat-person { gap: 10px; }
  .chat-name-row h2 { max-width: 42vw; font-size: 18px; }
  .e2e-pill { font-size: 8px; }
  .presence-line { font-size: 10px; }
  .anniversary-line { max-width: 48vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .partner-photo-chip { width: 28px; height: 28px; }
  .chat-more-button { width: 44px; height: 44px; }
  .chat-more-menu { width: min(82vw, 285px); top: 50px; }
  .message-scroll { padding: 18px 14px 8px; }
  .msg-stack { max-width: 86%; }
  .msg-bubble { padding: 9px 12px; font-size: 14px; }
  .msg-meta { font-size: 9px; }
  .status-card { width: 94%; }
  .quick-report { gap: 5px; padding: 8px 10px 6px; overflow-x: auto; scrollbar-width: none; }
  .quick-label { display: none; }
  .quick-chips { display: none; }
  .quick-here, .quick-hug, .quick-weather { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 8px; font-size: 11px; }
  .quick-more { width: 40px; min-width: 40px; min-height: 40px; }
  .composer { padding: 5px 10px calc(8px + var(--safe-bottom)); border-radius: 0; }
  .composer-box { min-height: 52px; border-radius: 16px; }
  .composer textarea { min-height: 40px; font-size: 16px; }
  .emoji-button { width: 38px; height: 38px; }
  .send-button { width: 42px; height: 42px; }
  .composer-shortcut { display: none; }
  .composer-meta { justify-content: flex-end; min-height: 14px; padding-top: 2px; }
  .emoji-panel { left: 8px; right: 8px; bottom: 82px; max-height: 45dvh; }
  .jump-new { right: 14px; bottom: 142px; }
  .sheet { width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet[open] { animation: sheet-up .22s ease both; }
  @keyframes sheet-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
  .sheet::before { content: ""; position: absolute; top: 9px; left: 50%; z-index: 3; width: 38px; height: 4px; background: #ddd3c7; border-radius: 999px; transform: translateX(-50%); }
  .sheet-inner { max-height: 92dvh; padding: 28px 20px calc(22px + var(--safe-bottom)); border: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -24px 70px -40px rgba(47, 43, 40, .4); }
  .sheet-head { margin-bottom: 18px; }
  .sheet-head h2 { font-size: 25px; }
  .sheet-eyebrow { font-size: 9px; }
  .status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .weather-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .status-option, .weather-option { min-height: 60px; }
  .fun-extras { grid-template-columns: 1fr; }
  .fun-extras .soft-button { flex-direction: row; align-items: center; min-height: 60px; gap: 12px; }
  .fun-extras svg { width: 24px; height: 24px; }
  .fun-grid { grid-template-columns: 1fr; }
  .settings-group-title { margin-top: 18px; }
  .camera-lens { width: min(68vw, 270px); height: min(68vw, 270px); }
  .pet-world-grid { grid-template-columns: 1fr; max-height: 45dvh; }
}

@media (max-width: 380px) {
  .app-shell { width: calc(100% - 22px); }
  .welcome-copy h1 { font-size: 42px; }
  .welcome-lede { font-size: 14px; }
  .pair-card { padding: 15px; }
  .feature-copy { display: flex; }
  .chat-name-row h2 { max-width: 38vw; }
  .quick-here, .quick-hug, .quick-weather { font-size: 10px; }
  .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ---------- 交互尺寸与细节修正 ---------- */

.pet-stage { flex: 0 0 284px; }
.composer textarea:focus-visible { outline: 0; }
.composer-box:has(textarea:focus-visible) { border-color: rgba(94, 117, 104, .62); box-shadow: 0 0 0 4px rgba(94, 117, 104, .08); }
.sheet .soft-button, .sheet .tiny-button, .emoji-clear { min-height: 44px; }
.emoji-tab, .emoji-cell { min-height: 44px; }
.snack-row button, .pet-world-tabs button, .pet-world-item button { min-height: 44px; }
.partner-photo-chip, .my-photo-chip { min-width: 36px; min-height: 36px; }

.switch-button {
  width: 47px;
  height: 44px;
  background: transparent;
  border: 0;
}

.switch-button::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 0;
  left: 0;
  height: 28px;
  background: #e5d7c8;
  border: 1px solid #d2c0ae;
  border-radius: 999px;
  transition: background .18s ease, border-color .18s ease;
}

.switch-button.is-on::before { background: var(--teal); border-color: var(--teal); }
.switch-button.is-denied::before { background: #f0c6bd; border-color: #dfaea4; }

.switch-button i {
  top: 13px;
  left: 3px;
  width: 18px;
  height: 18px;
}

.switch-button.is-on i { transform: translateX(20px); }

@media (max-width: 640px) {
  .quick-here, .quick-hug, .quick-weather, .quick-more { min-height: 44px; }
  .emoji-button { width: 44px; height: 44px; }
  .send-button { width: 44px; height: 44px; }
  .partner-photo-chip, .my-photo-chip { min-width: 38px; min-height: 38px; }
}


.composer textarea,
.composer textarea:focus,
.composer textarea:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .quick-more { width: 44px; min-width: 44px; }
  .partner-photo-chip, .my-photo-chip { min-width: 44px; min-height: 44px; }
}


:root {
  --ink-soft: #4c4640;
  --muted: #675f58;
  --muted-light: #746d66;
  --coral: #bf4e40;
  --coral-deep: #a53f34;
  --teal: #526b5e;
}

@media (max-width: 860px) {
  .quick-label,
  .quick-chips { display: none; }

  .quick-here,
  .quick-hug,
  .quick-weather {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 10px;
    font-size: 11px;
  }

  .quick-more { width: 44px; min-width: 44px; min-height: 44px; }
}


/* =========================================================
   贴贴 1.7 · 第二轮：两台手机，一个共同的小窝
   更强的品牌画面、更明确的深浅层次、更像 App 的聊天空间
   ========================================================= */

:root {
  --night: #20362c;
  --night-2: #2b4a3c;
  --night-3: #365749;
  --night-line: rgba(242, 231, 214, .18);
  --cream: #f8f1e6;
  --cream-2: #f2e8da;
  --sun: #eab866;
  --coral: #bf4e40;
  --coral-deep: #a53f34;
}

/* ---------- 欢迎页：用两台手机组成主视觉 ---------- */

.welcome-view {
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, .94fr);
  gap: clamp(54px, 7vw, 104px);
  min-height: calc(100dvh - 120px);
  padding: 20px 0 46px;
}

.welcome-copy {
  position: relative;
  max-width: 650px;
  padding-left: clamp(0px, 3vw, 34px);
}

.welcome-copy::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 8px;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, #d8cfc2 18%, #d8cfc2 82%, transparent);
}

.welcome-copy h1 {
  font-size: clamp(66px, 7.7vw, 100px);
  line-height: 1.04;
  letter-spacing: -.065em;
}

.welcome-copy h1 em {
  display: inline-block;
  color: var(--coral);
}

.welcome-copy h1 em::after {
  bottom: 5px;
  height: 10px;
  background: rgba(234, 184, 102, .46);
}

.welcome-lede {
  max-width: 560px;
  margin-top: 25px;
  color: #4c4640;
  font-size: 17px;
}

.feature-pills {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 34px;
  border-top: 1px solid #d8d0c4;
  border-bottom: 1px solid #d8d0c4;
}

.feature-pills li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 11px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e1d9cd;
  border-radius: 0;
}

.feature-pills li:last-child { border-bottom: 0; }

.feature-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--night);
  background: var(--sun);
  border-radius: 50%;
  font-size: 9px;
  letter-spacing: 0;
}

.feature-copy {
  display: grid;
  grid-template-columns: minmax(160px, .72fr) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.feature-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.feature-copy small {
  color: var(--muted);
  font-size: 11px;
}

.welcome-pet-line {
  margin-top: 22px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.welcome-pet-line .mini-pet-slot {
  border-radius: 12px;
  background: #ead8c4;
}

.quiet-line {
  color: #81786f;
}

/* 深色配对卡：像两扇亮着灯的小窗 */

.pair-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgba(234, 184, 102, .2), transparent 24%),
    radial-gradient(circle at 12% 84%, rgba(191, 78, 64, .2), transparent 28%),
    var(--night);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 34px;
  box-shadow: 0 32px 80px -44px rgba(24, 45, 36, .8);
}

.pair-card::after {
  content: "";
  position: absolute;
  top: -54px;
  right: -42px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(248, 241, 230, .12);
  border-radius: 50%;
  pointer-events: none;
}

.pair-tabs {
  position: relative;
  z-index: 2;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 0 14px;
  padding: 5px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 15px;
}

.pair-tab {
  min-height: 46px;
  color: rgba(248, 241, 230, .68);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 650;
}

.pair-tab.is-active {
  color: var(--night);
  background: var(--cream);
  box-shadow: 0 10px 24px -18px #000;
}

.pair-form { position: relative; z-index: 2; }

.pair-illustration {
  height: 176px;
  margin-bottom: 22px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, .11), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .045), rgba(0, 0, 0, .08));
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 24px;
}

.pair-illustration::after { display: none; }

.pair-scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 30px;
  width: 100%;
  height: 100%;
  padding: 28px 20px 27px;
}

.pair-moon {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 62px;
  height: 62px;
  background: var(--sun);
  border-radius: 50%;
  opacity: .9;
  transform: translateX(-50%);
  filter: blur(.2px);
}

.pair-moon::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 15px;
  width: 50px;
  height: 50px;
  background: var(--night);
  border-radius: 50%;
}

.pair-phone {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 120px;
  padding: 13px 9px;
  background: #fff9ef;
  border: 2px solid #15261f;
  border-radius: 20px;
  box-shadow: 0 16px 30px -20px rgba(0, 0, 0, .75);
}

.pair-phone-a {
  transform: rotate(-7deg) translateY(3px);
}

.pair-phone-b {
  transform: rotate(7deg) translateY(-2px);
  background: #f4dfd1;
}

.pair-phone-notch {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 24px;
  height: 3px;
  background: rgba(32, 54, 44, .5);
  border-radius: 999px;
  transform: translateX(-50%);
}

.pair-chatline {
  display: block;
  height: 7px;
  margin-top: 10px;
  background: var(--night);
  border-radius: 999px;
  opacity: .86;
}

.pair-chatline-a { width: 48px; margin-left: auto; background: var(--coral); }
.pair-chatline-b { width: 58px; }
.pair-phone-heart { display: block; margin-top: 20px; color: var(--coral); font-size: 18px; text-align: center; }

.pair-thread {
  position: absolute;
  top: 57px;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 96px;
  height: 52px;
  border-top: 1px dashed rgba(248, 241, 230, .65);
  transform: translateX(-50%) rotate(2deg);
}

.pair-thread i {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-top: -13px;
  color: var(--night);
  background: var(--sun);
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
}

.pair-scene-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  color: rgba(248, 241, 230, .54);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .16em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.pair-scene-join .pair-phone-a.is-waiting { opacity: .48; }
.pair-scene-join .pair-phone-b.is-lit { background: var(--cream); box-shadow: 0 0 32px rgba(234, 184, 102, .22), 0 16px 30px -20px rgba(0, 0, 0, .75); }
.pair-scene-join .pair-thread { border-top-color: rgba(234, 184, 102, .9); }

.pair-scene-key {
  position: absolute;
  right: 22%;
  top: 40px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--night);
  background: var(--cream);
  border-radius: 50%;
  font-size: 13px;
  transform: rotate(-22deg);
}

.pair-form .field > span { color: rgba(248, 241, 230, .82); }
.pair-form .field > span small { color: rgba(248, 241, 230, .5); }
.pair-form .field input { color: var(--ink); background: #fffaf2; border-color: rgba(255, 255, 255, .18); }
.pair-form .field input:focus { border-color: var(--sun); box-shadow: 0 0 0 4px rgba(234, 184, 102, .12); }
.pair-form .field-hint { color: rgba(248, 241, 230, .56); }
.pair-form .primary-button { min-height: 54px; }
.pair-form .form-tiny { color: rgba(248, 241, 230, .4); }
.pair-form .pair-error { color: #ffd9d2; background: rgba(191, 78, 64, .25); border-color: rgba(255, 255, 255, .15); }

/* ---------- 等待：延续深色小屋 ---------- */

.waiting-card {
  grid-template-columns: minmax(220px, .58fr) minmax(0, 1fr);
  gap: 34px;
  padding: 20px;
  background:
    radial-gradient(circle at 18% 20%, rgba(234, 184, 102, .16), transparent 28%),
    var(--night);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 34px;
  box-shadow: 0 32px 80px -44px rgba(24, 45, 36, .8);
}

.waiting-scene {
  height: 410px;
  background:
    radial-gradient(circle at 50% 28%, rgba(234, 184, 102, .24), transparent 22%),
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .06));
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 25px;
}

.waiting-hoop { border-color: rgba(248, 241, 230, .22); }
.waiting-copy { padding: 24px 24px 24px 0; }
.waiting-copy .eyebrow { color: var(--sun); }
.waiting-copy .eyebrow-dot { background: var(--coral); box-shadow: 0 0 0 5px rgba(191, 78, 64, .2); }
.waiting-copy h1 { color: var(--cream); font-size: clamp(44px, 4.8vw, 58px); }
.waiting-lede { color: rgba(248, 241, 230, .7); }
.invite-code-wrap { background: var(--cream); border-color: transparent; }
.invite-code { color: var(--night); }
.copy-mini { color: var(--night); background: #fffaf2; border-color: #ded4c8; }
.waiting-status { color: rgba(248, 241, 230, .56); }
.waiting-steps li { color: rgba(248, 241, 230, .7); }
.waiting-steps b { color: var(--night); background: var(--sun); }
.help-details { background: rgba(255, 255, 255, .055); border-color: rgba(255, 255, 255, .1); }
.help-details summary { color: rgba(248, 241, 230, .8); }
.help-details p { color: rgba(248, 241, 230, .55); }

@media (max-width: 1040px) {
  .welcome-view { grid-template-columns: minmax(0, .92fr) minmax(380px, 1.08fr); gap: 42px; }
  .welcome-copy h1 { font-size: clamp(58px, 7.4vw, 82px); }
  .feature-copy { grid-template-columns: 1fr; gap: 1px; }
}

@media (max-width: 860px) {
  .welcome-view { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .welcome-copy { max-width: 700px; padding-left: 0; }
  .welcome-copy::before { display: none; }
  .welcome-copy h1 { font-size: clamp(54px, 10vw, 78px); }
  .feature-copy { grid-template-columns: minmax(160px, .7fr) minmax(0, 1fr); gap: 18px; }
  .pair-card { width: min(100%, 620px); }
  .waiting-card { grid-template-columns: minmax(190px, .55fr) minmax(0, 1fr); }
  .waiting-scene { height: 340px; }
  .waiting-copy { padding: 16px 14px 16px 0; }
}

@media (max-width: 640px) {
  .welcome-copy h1 { font-size: clamp(47px, 13vw, 60px); }
  .feature-pills { margin-top: 25px; }
  .feature-pills li { min-height: 58px; padding: 10px 2px; grid-template-columns: 30px minmax(0, 1fr); }
  .feature-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .pair-card { width: 100%; padding: 12px; border-radius: 28px; }
  .pair-tabs { margin-bottom: 11px; }
  .pair-illustration { height: 154px; margin-bottom: 18px; }
  .pair-scene { gap: 24px; padding-top: 28px; }
  .pair-phone { width: 72px; height: 102px; border-radius: 17px; }
  .pair-moon { top: 19px; width: 54px; height: 54px; }
  .pair-moon::after { width: 44px; height: 44px; }
  .pair-phone-heart { margin-top: 13px; }
  .pair-scene-label { bottom: 9px; font-size: 6px; }
  .pair-form .field-hint { color: rgba(248, 241, 230, .62); }
  .waiting-card { display: block; padding: 12px; border-radius: 28px; }
  .waiting-scene { height: 220px; margin-bottom: 8px; }
  .waiting-copy { padding: 18px 10px 12px; }
  .waiting-copy h1 { font-size: 42px; }
}


/* ---------- 桌面聊天：一盏亮着的小屋 ---------- */

body.in-chat {
  background: #eee8dd;
}

body.in-chat .site-head .brand-copy small { color: #756d65; }

.chat-view {
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 14px;
  height: calc(100dvh - 80px);
  padding-bottom: 10px;
}

.side-panel {
  position: relative;
  gap: 10px;
  padding: 14px;
  overflow: hidden auto;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 5%, rgba(234, 184, 102, .16), transparent 30%),
    radial-gradient(circle at 100% 60%, rgba(191, 78, 64, .11), transparent 32%),
    var(--night);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 30px;
  box-shadow: 0 28px 65px -45px rgba(18, 35, 28, .72);
}

.side-room-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  padding: 0 4px;
  color: rgba(248, 241, 230, .45);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .15em;
}

.side-room-label i {
  width: 6px;
  height: 6px;
  background: var(--sun);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(234, 184, 102, .1);
}

.pet-stage {
  flex: 0 0 352px;
  height: 352px;
  min-height: 352px;
  background:
    radial-gradient(circle at 52% 32%, rgba(248, 241, 230, .14), transparent 30%),
    radial-gradient(circle at 50% 65%, rgba(234, 184, 102, .08), transparent 35%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 24px;
}

.pet-stage::after {
  content: "";
  position: absolute;
  top: 21px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(234, 184, 102, .65);
  border-radius: 50%;
  box-shadow: inset -13px -4px 0 rgba(32, 54, 44, .95);
}

.pet-stage-ground {
  right: 30px;
  left: 30px;
  height: 44px;
  background: linear-gradient(180deg, rgba(234, 184, 102, .18), rgba(0, 0, 0, .08));
  border-radius: 50%;
  filter: blur(2px);
}

.main-pet {
  bottom: 24px;
  width: 205px;
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, .28));
}

.pet-speech {
  top: 20px;
  left: 17px;
  max-width: 170px;
  color: var(--night);
  background: rgba(248, 241, 230, .94);
  border: 0;
  border-radius: 15px 15px 15px 4px;
  box-shadow: 0 12px 28px -20px #000;
}

.pet-speech::after { display: none; }
.pet-nameplate { bottom: 10px; color: rgba(248, 241, 230, .74); background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .1); }
.pet-love-badge { top: 18px; right: 16px; bottom: auto; color: var(--sun); background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .1); }

.partner-now {
  padding: 15px 15px 14px;
  background: var(--cream);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 16px 30px -25px #000;
}

.partner-now-head { margin-bottom: 11px; }
.partner-now .section-label { color: #736b62; }
.partner-now .status-time { color: #938980; }
.partner-now .status-main { color: var(--night); }
.partner-now .status-note,
.partner-now .partner-weather-line { color: #746b63; }
.partner-now .status-emoji { background: #f0e3d0; }

.members-strip { padding: 3px 2px 0; }
.member-pill { color: rgba(248, 241, 230, .78); background: rgba(255, 255, 255, .065); border-color: rgba(255, 255, 255, .1); }
.member-pill strong, .member-pill b { color: var(--cream); }

.side-actions { margin-top: 2px; }
.side-actions .soft-button { min-height: 46px; color: rgba(248, 241, 230, .82); background: rgba(255, 255, 255, .065); border-color: rgba(255, 255, 255, .1); }
.side-actions .soft-button:hover { color: var(--night); background: var(--sun); }
.side-hint { color: rgba(248, 241, 230, .35); }

.chat-panel {
  background: #fbf7f0;
  border: 1px solid #ddd4c8;
  border-radius: 30px;
  box-shadow: 0 28px 65px -48px rgba(43, 37, 32, .45);
}

.chat-head {
  min-height: 86px;
  padding: 16px 20px;
  background: rgba(251, 247, 240, .96);
  border-bottom: 1px solid #e0d7cb;
  border-radius: 30px 30px 0 0;
}

.chat-head::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  background: var(--coral);
  border-radius: 0 4px 4px 0;
}

.avatar {
  width: 50px;
  height: 50px;
  color: var(--cream);
  background: var(--night);
  border: 3px solid #efe4d4;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d9cfc2;
}

.chat-name-row h2 { font-size: 24px; }
.e2e-pill { color: var(--night); background: var(--sun); }
.presence-line i { box-shadow: 0 0 0 4px rgba(82, 107, 94, .1); }
.anniversary-line { color: var(--coral-deep); }

.chat-more-button {
  width: 46px;
  height: 46px;
  color: var(--cream);
  background: var(--night);
  border: 0;
  border-radius: 50%;
}

.chat-more-button:hover,
.chat-more-button[aria-expanded="true"] { color: var(--night); background: var(--sun); }

.chat-more-menu {
  top: 55px;
  border-radius: 20px;
  border-color: #dcd2c5;
  box-shadow: 0 26px 60px -30px rgba(32, 54, 44, .55);
}

.message-scroll {
  padding: 27px 32px 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(234, 184, 102, .08), transparent 24%),
    #fbf7f0;
}

.date-divider { color: #978d83; }
.msg-author { color: #776e65; }
.msg-bubble { background: #fffdfa; border-color: #e1d7ca; box-shadow: 0 7px 20px -20px rgba(32, 54, 44, .55); }
.msg-row.is-mine .msg-bubble { background: var(--coral); border-color: var(--coral); }

.msg-system span { background: #efe7da; color: #6e655d; }
.status-card { background: #f4ecde; border-color: #e3d5c1; }
.action-card { background: #f9f0df; border-color: #e8d7bd; }

.quick-report {
  gap: 6px;
  margin: 0 16px 2px;
  padding: 7px;
  background: #eee7dc;
  border: 1px solid #ded4c6;
  border-radius: 18px;
}

.quick-label { padding-left: 7px; color: #81776e; }

.quick-here,
.quick-hug,
.quick-weather,
.quick-more {
  min-height: 38px;
  color: #514a43;
  background: #fbf7f0;
  border-color: #ded4c7;
}

.quick-here:hover,
.quick-hug:hover,
.quick-weather:hover,
.quick-more:hover { color: #fff; background: var(--night); border-color: var(--night); }

.quick-chip { border-color: #d9cfc1; }
.composer { padding: 9px 16px 13px; background: #fbf7f0; border-radius: 0 0 30px 30px; }
.composer-box { min-height: 56px; background: #fffdfa; border-color: #dcd1c3; border-radius: 19px; box-shadow: 0 10px 28px -26px rgba(32, 54, 44, .7); }
.composer-box:focus-within { border-color: var(--night-3); box-shadow: 0 0 0 4px rgba(43, 74, 60, .075); }
.emoji-button { color: #6d655e; }
.send-button { width: 44px; height: 44px; background: var(--coral); border-radius: 14px; }

.jump-new { background: var(--night); color: var(--cream); border: 0; }

@media (max-width: 1040px) {
  .chat-view { grid-template-columns: 272px minmax(0, 1fr); }
  .pet-stage { flex-basis: 320px; height: 320px; min-height: 320px; }
  .main-pet { width: 185px; }
}

@media (max-width: 860px) {
  body.in-chat { background: #f2ece2; }
  .chat-view { height: calc(100dvh - 8px); padding: 4px; }
  .chat-panel { border-radius: 26px; }
  .chat-head { min-height: 78px; border-radius: 26px 26px 0 0; }
  .message-scroll { padding: 22px 24px 10px; }
  .composer { border-radius: 0 0 26px 26px; }
}

@media (max-width: 640px) {
  body.in-chat { background: #f2ece2; }
  body.in-chat .chat-view { height: 100dvh; padding: 0; }
  body.in-chat .chat-panel { border: 0; border-radius: 0; background: #fbf7f0; }
  .chat-head { min-height: 72px; padding: 11px 14px; border-radius: 0; background: #fbf7f0; }
  .chat-head::before { top: 14px; bottom: 14px; }
  .avatar { width: 42px; height: 42px; border-width: 2px; }
  .chat-name-row h2 { font-size: 19px; }
  .chat-more-button { width: 44px; height: 44px; }
  .message-scroll { padding: 17px 14px 7px; }
  .quick-report { margin: 0 9px 3px; padding: 5px; border-radius: 17px; }
  .quick-here, .quick-hug, .quick-weather { min-height: 44px; border-radius: 13px; }
  .quick-more { border-radius: 50%; }
  .composer { padding: 6px 9px calc(8px + var(--safe-bottom)); }
  .composer-box { min-height: 54px; border-radius: 18px; }
  .send-button { border-radius: 15px; }
  .emoji-panel { bottom: 84px; border-radius: 20px; }
}

/* ---------- 弹层：更有层次，但仍保持安静 ---------- */

.sheet-inner {
  background: #fbf7f0;
  border-color: #dcd2c4;
  box-shadow: 0 34px 90px -40px rgba(23, 43, 34, .55);
}

.sheet-head h2 { font-size: 29px; }
.sheet-eyebrow { color: var(--coral-deep); }

.fun-affection {
  color: var(--cream);
  background:
    radial-gradient(circle at 80% 15%, rgba(234, 184, 102, .18), transparent 28%),
    var(--night);
  border: 0;
}

.fun-affection-copy p { color: rgba(248, 241, 230, .68); }
.fun-affection-copy strong { color: var(--sun); }
.fun-affection-copy > span { color: rgba(248, 241, 230, .55); }
.fun-fish-count { color: var(--night); background: var(--sun); }
.fun-affection-heart { color: var(--cream); background: var(--coral); }
.love-meter { background: rgba(248, 241, 230, .13); }

.fun-extras .soft-button { background: #fffdfa; }
.fun-extras .soft-button:hover { background: var(--sun); border-color: var(--sun); }

.settings-group { background: #fffdfa; }
.settings-note { background: #f2ebdf; }

.status-option,
.weather-option {
  background: #fffdfa;
}

.status-option:hover,
.weather-option:hover { border-color: #b8ac9c; }

.status-option.is-selected,
.weather-option.is-selected { color: var(--night); background: #f6e7b9; border-color: var(--sun); }

.settings-group-title { color: #8b8177; }
.setting-copy strong { font-size: 12.5px; }

@media (max-width: 640px) {
  .sheet-inner { background: #fbf7f0; }
  .sheet::before { background: #c8bcad; }
}


/* ---------- 本地体验优化：手机配对与聊天 ---------- */

@media (max-width: 640px) {
  .pair-illustration {
    height: 126px;
    margin-bottom: 12px;
  }
  .pair-scene {
    gap: 20px;
    padding: 18px 16px 18px;
  }

  .pair-moon {
    top: 10px;
    width: 46px;
    height: 46px;
  }

  .pair-moon::after {
    top: -6px;
    left: 12px;
    width: 38px;
    height: 38px;
  }

  .pair-phone {
    width: 64px;
    height: 82px;
    padding: 10px 8px;
    border-radius: 15px;
  }

  .pair-chatline {
    height: 5px;
    margin-top: 7px;
  }

  .pair-chatline-a { width: 42px; }
  .pair-chatline-b { width: 44px; }
  .pair-phone-heart { margin-top: 8px; font-size: 15px; }
  .pair-thread { top: 43px; width: 78px; height: 36px; }
  .pair-scene-label { bottom: 7px; font-size: 5.5px; }
  .pair-scene-key { top: 30px; }

  .pair-form .field-hint {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.55;
  }

  .feature-copy small { font-size: 11px; line-height: 1.45; }

  body.invite-mode .welcome-copy { display: none; }
  body.invite-mode .welcome-view { padding-top: 10px; gap: 0; }
  body.invite-mode .pair-card { margin-top: 0; }
  body.invite-mode .site-foot { margin-top: 14px; }
}


/* ---------- 第二轮细节校正 ---------- */

.side-actions { margin-top: auto; padding-top: 2px; }
.side-hint { color: rgba(248, 241, 230, .58); font-size: 10px; }
.side-room-label { color: rgba(248, 241, 230, .62); font-size: 8.5px; }
.side-room-label i { box-shadow: 0 0 0 4px rgba(234, 184, 102, .14); }
.pair-form .form-tiny { color: rgba(248, 241, 230, .58); }
.waiting-status { color: rgba(248, 241, 230, .68); }
.help-details p { color: rgba(248, 241, 230, .68); }
.date-divider, .msg-meta { color: #746d66; }
.partner-now .status-time { color: #746d66; }

@media (max-width: 640px) {
  .quick-more { min-height: 44px; }
  .chat-more-menu { border-radius: 19px; }
}

/* 首次进入 / 显式恢复 */
.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 13px;
  padding: 10px 12px;
  background: #f0f7f2;
  border: 1px solid rgba(76, 139, 126, .22);
  border-radius: 12px;
}

.resume-card[hidden] {
  display: none;
}

.resume-card div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.resume-card strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.resume-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.resume-card button {
  flex: none;
  min-height: 36px;
  padding: 7px 10px;
  color: #fffdf7;
  background: var(--teal);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.resume-card button:hover {
  background: #3e766b;
}

.waiting-code-hint {
  margin: 6px 0 0;
  color: rgba(248, 241, 230, .58);
  font-size: 10px;
  line-height: 1.45;
}

/* ---------- 会跑的小猫 / 时间与天气壁纸 ---------- */

.chat-ambience {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, #dceef1 0%, #f6e7cf 58%, #f3e0c8 100%);
  transition: background 1.2s ease;
}

.ambience-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ambience-sun {
  fill: #ffe8a9;
  opacity: .95;
  filter: drop-shadow(0 0 26px rgba(255, 224, 147, .8));
}

.ambience-sun-halo {
  fill: #fff1bd;
  opacity: .2;
}

.ambience-stars {
  fill: #fff6d8;
  opacity: 0;
}

.ambience-cloud {
  fill: rgba(255, 253, 247, .68);
  opacity: .7;
}

.cloud-b { opacity: .45; }

.ambience-hill {
  opacity: .9;
}

.hill-back { fill: #b8c4af; opacity: .5; }
.hill-front { fill: #7f967e; opacity: .55; }

.ambience-birds {
  fill: none;
  stroke: rgba(66, 80, 73, .48);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: .55;
}

.ambience-flowers {
  fill: none;
  stroke: rgba(72, 103, 75, .45);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: .6;
}

.ambience-rain {
  fill: none;
  stroke: rgba(215, 237, 242, .72);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
}

.ambience-snow {
  fill: rgba(255, 252, 242, .9);
  opacity: 0;
}

.chat-ambience.time-dawn {
  background: linear-gradient(180deg, #7e8fb0 0%, #e9b99e 48%, #f8ddbb 100%);
}

.chat-ambience.time-morning {
  background: linear-gradient(180deg, #b9e1ea 0%, #e8f1dc 55%, #f7e9cd 100%);
}

.chat-ambience.time-noon {
  background: linear-gradient(180deg, #a8d9e7 0%, #e8f3e2 57%, #f7edcf 100%);
}

.chat-ambience.time-afternoon {
  background: linear-gradient(180deg, #8ec7df 0%, #ead4b2 58%, #e1b995 100%);
}

.chat-ambience.time-dusk {
  background: linear-gradient(180deg, #59688e 0%, #ce8f7d 50%, #e9b98d 100%);
}

.chat-ambience.time-night {
  background: linear-gradient(180deg, #0f1b33 0%, #1d3150 56%, #35465b 100%);
}

.chat-ambience.time-night .ambience-sun {
  fill: #f4e8c3;
  filter: drop-shadow(0 0 22px rgba(244, 232, 195, .38));
}

.chat-ambience.time-night .ambience-sun-halo {
  fill: #cbd7e8;
  opacity: .12;
}

.chat-ambience.time-night .ambience-stars { opacity: 1; animation: ambience-twinkle 4.8s ease-in-out infinite alternate; }
.chat-ambience.time-night .ambience-cloud { fill: rgba(152, 174, 201, .24); }
.chat-ambience.time-night .hill-back { fill: #26384a; opacity: .9; }
.chat-ambience.time-night .hill-front { fill: #1d2e3d; opacity: .95; }
.chat-ambience.time-night .ambience-birds,
.chat-ambience.time-night .ambience-flowers { opacity: 0; }
.chat-ambience.time-night .ambience-sun { opacity: .9; }
.chat-ambience.time-dawn .ambience-sun { fill: #ffd2a1; }
.chat-ambience.time-dawn .ambience-birds { opacity: .7; }
.chat-ambience.time-morning .ambience-birds { opacity: .8; }
.chat-ambience.time-morning .ambience-flowers { opacity: .8; }
.chat-ambience.time-noon .ambience-sun { opacity: 1; }
.chat-ambience.time-afternoon .ambience-sun { fill: #ffd58e; }
.chat-ambience.time-dusk .ambience-sun { fill: #ffbd8d; }
.chat-ambience.weather-cloudy .ambience-cloud { opacity: .92; }
.chat-ambience.weather-cloudy .ambience-sun { opacity: .45; }
.chat-ambience.weather-rain { background: linear-gradient(180deg, #7f97a5 0%, #9faeaf 55%, #c8c6b7 100%); }
.chat-ambience.weather-rain .ambience-sun,
.chat-ambience.weather-rain .ambience-birds,
.chat-ambience.weather-rain .ambience-flowers { opacity: 0; }
.chat-ambience.weather-rain .ambience-cloud { fill: rgba(236, 241, 238, .55); opacity: .95; }
.chat-ambience.weather-rain .ambience-rain { opacity: .8; animation: ambience-rain-fall 1.1s linear infinite; }
.chat-ambience.weather-storm { background: linear-gradient(180deg, #414b60 0%, #59666d 52%, #77776b 100%); }
.chat-ambience.weather-storm .ambience-sun,
.chat-ambience.weather-storm .ambience-birds,
.chat-ambience.weather-storm .ambience-flowers { opacity: 0; }
.chat-ambience.weather-storm .ambience-cloud { fill: rgba(99, 112, 119, .65); opacity: .95; }
.chat-ambience.weather-storm .ambience-rain { opacity: .95; animation: ambience-rain-fall .8s linear infinite; }
.chat-ambience.weather-snow .ambience-rain { display: none; }
.chat-ambience.weather-snow .ambience-snow { opacity: .85; animation: ambience-twinkle 3.2s ease-in-out infinite alternate; }
.chat-ambience.weather-snow .ambience-birds,
.chat-ambience.weather-snow .ambience-flowers { opacity: 0; }
.chat-ambience.weather-quiet .ambience-sun { opacity: .38; }
.chat-ambience.weather-quiet .ambience-birds { opacity: 0; }

@keyframes ambience-twinkle {
  0% { opacity: .55; }
  100% { opacity: 1; }
}

@keyframes ambience-rain-fall {
  from { transform: translateY(-18px); }
  to { transform: translateY(22px); }
}

.chat-panel > .chat-ambience { pointer-events: none; }
.chat-panel > .chat-head,
.chat-panel > .connection-banner,
.chat-panel > .quiet-reply-bar,
.chat-panel > .message-scroll,
.chat-panel > .quick-report,
.chat-panel > .composer,
.chat-panel > .jump-new {
  position: relative;
  z-index: 2;
}

.chat-panel > .chat-head,
.chat-panel > .composer {
  z-index: 3;
}

.chat-panel > .message-scroll {
  background: transparent;
}

.chat-panel > .message-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 253, 249, .28), rgba(255, 252, 246, .42) 38%, rgba(255, 250, 242, .56));
}

.chat-panel:has(.chat-ambience.time-night) > .chat-head,
.chat-panel:has(.chat-ambience.time-night) > .composer {
  color: #f5eee1;
  background: rgba(17, 29, 47, .88);
}

.chat-panel:has(.chat-ambience.time-night) .chat-name-row h2,
.chat-panel:has(.chat-ambience.time-night) .pet-nameplate,
.chat-panel:has(.chat-ambience.time-night) .chat-more-button,
.chat-panel:has(.chat-ambience.time-night) .chat-empty p,
.chat-panel:has(.chat-ambience.time-night) .date-divider,
.chat-panel:has(.chat-ambience.time-night) .msg-meta {
  color: #f3eadb;
}

.chat-panel:has(.chat-ambience.time-night) .chat-empty {
  color: #f3eadb;
}

.chat-panel:has(.chat-ambience.time-night) > .message-scroll::before {
  background: linear-gradient(180deg, rgba(15, 26, 42, .1), rgba(15, 26, 42, .2) 38%, rgba(15, 26, 42, .32));
}

.chat-panel:has(.chat-ambience.time-night) .composer-box {
  background: rgba(250, 246, 237, .95);
}

.chat-panel:has(.chat-ambience.time-night) .composer textarea,
.chat-panel:has(.chat-ambience.time-night) .composer-meta {
  color: #f5eee1;
}

.chat-panel:has(.chat-ambience.time-night) .composer textarea {
  color: var(--ink);
}

.chat-panel:has(.chat-ambience.time-night) .partner-photo-chip,
.chat-panel:has(.chat-ambience.time-night) .avatar {
  border-color: rgba(244, 232, 210, .45);
}

.roam-pet {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  width: 86px;
  height: 96px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 10px 8px rgba(36, 41, 44, .22));
  will-change: transform;
}

.roam-pet:active,
.roam-pet.is-dragging { cursor: grabbing; }

.roam-pet .pet-art {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.roam-pet.is-running .cat-tail {
  transform-origin: 170px 190px;
  animation: cat-tail-run .28s ease-in-out infinite alternate;
}

.roam-pet.is-running .cat-body {
  animation: cat-body-run .35s ease-in-out infinite alternate;
}

.roam-pet.is-dragging .cat-tail {
  transform: rotate(-18deg);
  transform-origin: 170px 190px;
}

.roam-pet.is-happy .cat-head {
  transform-origin: 110px 130px;
  animation: cat-head-nod .42s ease-in-out 2;
}

@keyframes cat-tail-run {
  from { transform: rotate(-9deg); }
  to { transform: rotate(11deg); }
}

@keyframes cat-body-run {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-2px) rotate(1deg); }
}

@keyframes cat-head-nod {
  0%, 100% { transform: rotate(0); }
  50% { transform: translateY(2px) rotate(-4deg); }
}

.main-pet .cat-tail,
.pet-stage .cat-tail {
  transform-origin: 170px 190px;
  animation: cat-tail-idle 3.8s ease-in-out infinite alternate;
}

.main-pet .cat-head,
.pet-stage .cat-head {
  transform-origin: 110px 130px;
  animation: cat-head-idle 5.2s ease-in-out infinite;
}

@keyframes cat-tail-idle {
  from { transform: rotate(-3deg); }
  to { transform: rotate(4deg); }
}

@keyframes cat-head-idle {
  0%, 92%, 100% { transform: rotate(0); }
  94% { transform: rotate(-1.5deg); }
  97% { transform: rotate(1.5deg); }
}

@media (max-width: 640px) {
  .roam-pet {
    width: 74px;
    height: 83px;
  }

  .chat-panel > .message-scroll::before {
    background: linear-gradient(180deg, rgba(255, 253, 249, .26), rgba(255, 250, 242, .5));
  }

  .chat-panel:has(.chat-ambience.time-night) > .message-scroll::before {
    background: linear-gradient(180deg, rgba(15, 26, 42, .1), rgba(15, 26, 42, .28));
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-ambience,
  .roam-pet,
  .cat-tail,
  .cat-head,
  .ambience-stars,
  .ambience-rain,
  .ambience-snow {
    animation: none !important;
    transition: none !important;
  }
}

.pet-profile {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pet-profile-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pet-profile-label span {
  color: var(--muted);
  font-size: 11px;
}

.pet-profile-label input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 16px;
}

.pet-profile-hint {
  margin: 0;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.5;
}

.pet-breed-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pet-breed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 64px;
  padding: 7px 4px;
  color: var(--ink-soft);
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pet-breed-card span { font-size: 19px; }
.pet-breed-card strong { font-size: 10px; font-weight: 600; }
.pet-breed-card.is-active { color: var(--coral-deep); border-color: var(--coral); background: #fff3ed; }
.pet-profile-save { margin-top: 3px; }

@media (max-width: 520px) {
  .pet-breed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pet-world-tabs { flex-wrap: wrap; }
}

/* 夜间面板同步，避免壁纸和顶部/输入区割裂 */
.chat-panel.scene-time-night > .chat-head,
.chat-panel.scene-time-night > .composer {
  color: #f5eee1;
  background: rgba(17, 29, 47, .9);
}

.chat-panel.scene-time-night .chat-name-row h2,
.chat-panel.scene-time-night .chat-more-button,
.chat-panel.scene-time-night .chat-empty,
.chat-panel.scene-time-night .chat-empty p,
.chat-panel.scene-time-night .date-divider,
.chat-panel.scene-time-night .msg-meta {
  color: #f3eadb;
}

.chat-panel.scene-time-night > .quick-report {
  background: rgba(17, 29, 47, .78);
  border-color: rgba(245, 238, 225, .13);
}

.chat-panel.scene-time-night > .quick-report .quick-label {
  color: rgba(245, 238, 225, .62);
}

.chat-panel.scene-time-night > .quick-report .quick-chip,
.chat-panel.scene-time-night > .quick-report .quick-here,
.chat-panel.scene-time-night > .quick-report .quick-hug,
.chat-panel.scene-time-night > .quick-report .quick-weather,
.chat-panel.scene-time-night > .quick-report .quick-more {
  color: #3b3530;
  background: rgba(255, 252, 245, .94);
}

.chat-panel.scene-time-night > .composer {
  border-top: 1px solid rgba(245, 238, 225, .1);
}

.chat-panel.scene-time-night .composer-box {
  background: #fbf7f0;
}

.chat-panel.scene-time-night .composer-meta {
  color: rgba(245, 238, 225, .58);
}

/* ---------- 3D 小猫的休息、洗脸和跳跃 ---------- */

.cat-art {
  transform: perspective(560px) rotateY(-7deg) rotateX(2deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(5px 8px 7px rgba(45, 35, 30, .16));
}

.cat-head {
  filter: drop-shadow(0 4px 2px rgba(45, 35, 30, .14));
}

.cat-eyes-open {
  transform-origin: 110px 103px;
  animation: cat-blink 7.5s ease-in-out infinite;
}

@keyframes cat-blink {
  0%, 91%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(.08); }
  95% { transform: scaleY(1); }
}

.cat-eyes-sleep { opacity: 0; }
.cat-paw { transform-origin: 88px 226px; }

.pet.is-sleeping .cat-eyes-open,
.pet.is-resting .cat-eyes-open,
.pet.is-grooming .cat-eyes-open {
  opacity: 0;
}

.pet.is-sleeping .cat-eyes-sleep,
.pet.is-resting .cat-eyes-sleep,
.pet.is-grooming .cat-eyes-sleep {
  opacity: 1;
}

.pet.is-sleeping .cat-head {
  transform: translateY(5px) rotate(-2deg);
}

.pet.is-sleeping .cat-body {
  transform: translateY(4px) scaleY(.94);
}

.pet.is-sleeping .cat-tail {
  animation: cat-sleep-tail 4.5s ease-in-out infinite alternate;
}

.pet.is-sleeping::after {
  content: "z  z";
  position: absolute;
  top: 2px;
  right: -2px;
  color: rgba(70, 82, 88, .66);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  animation: cat-zzz 3.4s ease-in-out infinite;
  pointer-events: none;
}

.pet.is-resting .cat-body {
  transform: translateY(3px) scaleY(.96);
  transform-origin: 110px 230px;
  animation: cat-breathe 3.8s ease-in-out infinite;
}

.pet.is-sitting .cat-body {
  transform: translateY(4px) scaleY(.93);
  transform-origin: 110px 230px;
}

.pet.is-grooming .cat-paw-left {
  animation: cat-groom-paw 1.2s ease-in-out infinite;
}

.pet.is-grooming .cat-head {
  transform: rotate(4deg);
  transform-origin: 110px 130px;
}

.pet.is-jumping .cat-art {
  animation: cat-jump 0.72s cubic-bezier(.18, .8, .26, 1);
}

.pet.is-jumping .cat-tail {
  animation: cat-tail-run .25s ease-in-out infinite alternate;
}

.pet.is-happy .cat-tail {
  animation: cat-tail-happy .35s ease-in-out 3;
}

@keyframes cat-breathe {
  0%, 100% { transform: translateY(3px) scaleY(.96); }
  50% { transform: translateY(1px) scaleY(.99); }
}

@keyframes cat-sleep-tail {
  from { transform: rotate(-5deg); }
  to { transform: rotate(7deg); }
}

@keyframes cat-zzz {
  0% { opacity: 0; transform: translateY(3px) scale(.8); }
  35% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-12px) scale(1.08); }
}

@keyframes cat-groom-paw {
  0%, 100% { transform: rotate(0) translate(0, 0); }
  40% { transform: rotate(-38deg) translate(-4px, -18px); }
  65% { transform: rotate(-25deg) translate(-2px, -14px); }
}

@keyframes cat-jump {
  0% { transform: perspective(560px) rotateY(-7deg) rotateX(2deg) translateY(0) scale(1); }
  38% { transform: perspective(560px) rotateY(-7deg) rotateX(2deg) translateY(-34px) scale(1.03); }
  72% { transform: perspective(560px) rotateY(-7deg) rotateX(2deg) translateY(-12px) scale(.99); }
  100% { transform: perspective(560px) rotateY(-7deg) rotateX(2deg) translateY(0) scale(1); }
}

@keyframes cat-tail-happy {
  from { transform: rotate(-9deg); }
  to { transform: rotate(12deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cat-art, .pet.is-sleeping::after, .pet.is-resting .cat-body,
  .pet.is-grooming .cat-paw-left, .pet.is-jumping .cat-art,
  .pet.is-happy .cat-tail {
    animation: none !important;
    transition: none !important;
  }
}
