:root {
  --base: #fbf8f7;
  --ink: #5e4c49;
  --ink-soft: rgba(94, 76, 73, .72);
  --muted: rgba(94, 76, 73, .45);
  --line: rgba(227, 201, 198, .45);
  --line-strong: rgba(201, 161, 155, .38);
  --rose: #c48b8b;
  --rose-deep: #a46c70;
  --blush: #f2d8d6;
  --glass: rgba(255, 255, 255, .62);
  --blur: blur(14px) saturate(120%);
  --soft-shadow: 0 4px 18px rgba(201, 161, 155, .14);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --display: "Playfair Display", "Didot", "Times New Roman", serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

body {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--ink);
  font: 15px/1.62 var(--serif);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--base);
}
/* 背景图：单独一层钉在屏幕上（iOS 不支持 background-attachment: fixed，用这种方式等效） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("/bg/chat.jpg") center top / cover no-repeat;
}

/* 磨砂白：顶栏、输入栏、底部导航共用 */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- 顶部 ---------- */

.top {
  position: relative; z-index: 2; flex: none;
  padding: calc(env(safe-area-inset-top) + 10px) 20px 11px;
  text-align: center;
  /* 透明：只留字，背景的蝴蝶结透出来 */
}
.brand { display: inline-flex; align-items: flex-start; gap: 3px; }
.wordmark { font: italic 400 30px/1 var(--display); color: #8c6c64; letter-spacing: .01em; }
.drop { width: 7px; height: 10px; margin-top: 2px; fill: none; stroke: var(--rose); stroke-width: 1; }
.presence {
  margin-top: 5px; font-size: 11px; line-height: 1; color: var(--muted); letter-spacing: .14em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.presence .dot { width: 5px; height: 5px; border-radius: 50%; background: #b9c7b1; box-shadow: 0 0 0 2px rgba(185, 199, 177, .28); }
.presence.is-typing .dot { background: var(--rose); box-shadow: 0 0 0 2px rgba(196, 139, 139, .22); animation: breathe 1.4s ease-in-out infinite; }

.icon-btn {
  position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 14px);
  width: 36px; height: 36px; border: 0; background: none; padding: 6px; color: #9a7d74;
}
.icon-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; stroke-linecap: round; }
.icon-btn .heart { fill: var(--blush); stroke: var(--rose); stroke-width: .8; }
.icon-btn:active { opacity: .5; }

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

#chat {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 18px 14px 14px;
  display: flex; flex-direction: column;
  /* 顶栏透明了，消息滚到上沿时淡出，不会被硬切一刀 */
  -webkit-mask-image: linear-gradient(transparent, #000 28px);
  mask-image: linear-gradient(transparent, #000 28px);
}
#chat::-webkit-scrollbar { display: none; }

.row { display: flex; align-items: flex-end; gap: 9px; margin-top: 6px; }
.row.head { margin-top: 16px; }
.row.me { flex-direction: row-reverse; }

/* 头像：2px 白边 + 很淡的暖粉阴影；用 background 来放大取景，脸居中 */
.seal {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  align-self: flex-start;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(201, 161, 155, .2);
  background: #fff no-repeat;
}
.row.him .seal { background-image: url("/avatars/leo.jpg"); background-size: cover; background-position: center; }
.row.me .seal { background-image: url("/avatars/riri.jpg"); background-size: cover; background-position: center; }
.row:not(.head) .seal { visibility: hidden; height: 0; border: 0; box-shadow: none; }

/* 气泡：磨砂玻璃 */
.bubble {
  position: relative; max-width: min(72%, 420px);
  padding: 8px 14px 7px;
  border-radius: 18px;
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.him .bubble {
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(227, 201, 198, .45);
  box-shadow: var(--soft-shadow);
}
.me .bubble {
  background: rgba(242, 216, 214, .50);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--soft-shadow);
}
/* 连续气泡：靠头像一侧的接缝处用小圆角，像一组 */
.him:not(.tail) .bubble { border-bottom-left-radius: 6px; }
.him:not(.head) .bubble { border-top-left-radius: 6px; }
.me:not(.tail) .bubble { border-bottom-right-radius: 6px; }
.me:not(.head) .bubble { border-top-right-radius: 6px; }

.bubble .act { color: rgba(94, 76, 73, .55); font-size: .94em; }
.bubble time {
  display: none; margin-top: 1px; text-align: right;
  font: italic 10px/1 var(--display); letter-spacing: .06em; color: rgba(94, 76, 73, .45);
}
.row.tail .bubble time { display: block; }

.divider {
  align-self: center; display: flex; align-items: center; gap: 10px;
  margin: 22px 0 2px; font-size: 11px; letter-spacing: .2em; color: var(--muted);
}
.divider::before, .divider::after { content: ""; width: 28px; height: 1px; background: var(--line-strong); }
.divider:first-child { margin-top: 0; }
.divider.place { letter-spacing: .12em; text-align: center; }

.note { align-self: center; margin: 12px 0 0; font-size: 12px; color: var(--rose-deep); letter-spacing: .06em; }

.typing .bubble { padding: 13px 16px; display: flex; gap: 5px; }
.typing .bubble i { width: 5px; height: 5px; border-radius: 50%; background: var(--rose); opacity: .35; animation: blink 1.2s infinite; }
.typing .bubble i:nth-child(2) { animation-delay: .18s; }
.typing .bubble i:nth-child(3) { animation-delay: .36s; }

.empty { margin: auto; text-align: center; color: var(--muted); }
.empty .en { font: italic 400 22px/1.2 var(--display); color: rgba(140, 108, 100, .7); }
.empty .zh { margin-top: 8px; font-size: 12px; letter-spacing: .3em; }

.enter { animation: rise .32s var(--ease-out) both; }
.row.me.enter { animation-duration: .24s; }

/* ---------- 输入栏 ---------- */

.composer {
  flex: none; position: relative; z-index: 2;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.field {
  display: flex; align-items: flex-end; gap: 2px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 4px 4px 4px 4px;
}
.field:focus-within { border-color: var(--line-strong); }
.tool {
  flex: none; width: 34px; height: 34px; border: 0; padding: 7px; border-radius: 50%;
  background: none; color: #a58c85;
}
.tool svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tool:active { background: rgba(242, 216, 214, .5); }
textarea {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; resize: none;
  padding: 7px 4px; max-height: 132px; line-height: 1.5; font-size: 16px; /* 16px 以下 iOS 会自动放大 */
}
textarea::placeholder { color: rgba(94, 76, 73, .38); letter-spacing: .04em; }
.send {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center;
  background: var(--rose); color: #fffaf6;
  box-shadow: 0 4px 10px -4px rgba(164, 108, 112, .6);
  transition: transform .16s var(--ease-out), background-color .2s, box-shadow .2s;
}
.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.send:disabled { background: rgba(196, 139, 139, .28); box-shadow: none; cursor: default; }
.send:not(:disabled):active { transform: scale(.9); }

/* ---------- 底部导航（图标之后换成 riri 给的 SVG） ---------- */

.tabbar {
  flex: none; position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 12px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
}
.tab {
  height: 50px; width: 64px; justify-self: center; border: 0; background: none; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; letter-spacing: .1em; color: rgba(94, 76, 73, .6);
}
.tab .ico { width: 24px; height: 24px; display: block; }
.tab .ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--rose-deep); background: rgba(242, 216, 214, .55); }
/* 键盘弹出时收起导航，输入栏贴着键盘 */
body.kb .tabbar { display: none; }

/* ---------- 设置面板 ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 10; background: rgba(94, 76, 73, .22);
  animation: dim .25s ease both;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  max-width: 560px; margin: 0 auto;
  padding: 10px 22px calc(env(safe-area-inset-bottom) + 20px);
  background: rgba(255, 252, 250, .92);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px -12px rgba(120, 80, 70, .3);
  animation: sheet-up .38s cubic-bezier(.22, 1.1, .36, 1) both;
}
.sheet.closing { animation: sheet-up .23s ease-in reverse both; }
.scrim.closing { animation: dim .22s ease reverse both; }
.grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font: 500 17px/1.4 var(--serif); letter-spacing: .12em; text-align: center; }
.hint { margin: 0 0 16px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.hint.small { min-height: 1.5em; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.label { display: block; font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 0 6px 2px; }
.sheet input {
  width: 100%; padding: 11px 14px; border-radius: 12px; outline: none; font-size: 16px;
  border: 1px solid var(--line-strong); background: var(--base);
}
.sheet input:focus { border-color: var(--rose); }
.btn {
  display: block; width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid transparent; background: var(--rose); color: #fffaf6; letter-spacing: .12em;
  box-shadow: 0 6px 14px -8px rgba(164, 108, 112, .7);
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn:disabled { opacity: .45; }
.btn:not(:disabled):active { transform: scale(.985); }
.rule { height: 1px; background: var(--line); margin: 18px 0 8px; }
.sign { margin: 14px 0 0; text-align: center; font: italic 13px/1 var(--display); color: rgba(140, 108, 100, .55); letter-spacing: .08em; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 0; font-size: 14px; }
.toggle small { display: block; font-size: 12px; color: var(--muted); }
.sheet .toggle input {
  flex: none; width: 44px; height: 26px; padding: 0; margin: 0; border-radius: 13px; position: relative;
  -webkit-appearance: none; appearance: none; background: var(--line-strong); border: 0; transition: background .2s;
}
.sheet .toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(94, 76, 73, .25); transition: transform .2s var(--ease-out);
}
.sheet .toggle input:checked { background: var(--rose); }
.sheet .toggle input:checked::after { transform: translateX(18px); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.seg button {
  flex: 1 1 30%; padding: 8px 0; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent;
  font-size: 13px; letter-spacing: .06em; color: var(--ink-soft);
}
.seg button.on { background: var(--rose); border-color: transparent; color: #fffaf6; }

/* ---------- 进场动画，三版共用一层：.v-tear 一滴泪 / .v-petals 花瓣 / .v-door 门。各版的东西只在自己那版出现 ---------- */

.intro:not(.v-tear) .intro-water, .intro:not(.v-petals) .intro-petals,
.intro:not(.v-door) .intro-door, .intro:not(.v-door) .intro-veil,
.intro:not(.v-letter) .intro-letter, .intro:not(.v-night) .intro-night { display: none; }

/* —— 花瓣：一阵风从右上吹到左下，近处几片大而虚；那句话在花瓣中间出来 —— */
.intro-petals { position: absolute; inset: 0; pointer-events: none; }
.intro.go.v-petals .intro-petals { animation: intro-in .5s ease both; }
.intro-petals i { position: absolute; left: var(--x); top: -9vh; width: var(--s); height: calc(var(--s) * 1.22); opacity: 0; }
.intro-petals i::before {
  content: ""; position: absolute; inset: 0; border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #fff3f1 0%, #f6d3d3 50%, #e5a9b0 100%);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, .85), 0 0 9px 2px rgba(255, 255, 255, .8), 0 0 20px 5px rgba(248, 208, 210, .5);
}
.intro-petals i.far { filter: blur(.6px); }
.intro-petals i.near { filter: blur(2.2px); }
.intro.go.v-petals .intro-petals i { animation: petal-fly var(--d) var(--w) cubic-bezier(.35, .15, .6, .95) both; }
.intro.go.v-petals .intro-petals i::before { animation: petal-turn var(--t) var(--w) ease-in-out infinite alternate; }
@keyframes petal-fly {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  10% { opacity: var(--o); }
  45% { transform: translate3d(calc(var(--dx) * .3), 46vh, 0); }
  82% { opacity: var(--o); }
  100% { opacity: 0; transform: translate3d(var(--dx), 120vh, 0); }
}
@keyframes petal-turn {
  from { transform: rotate(var(--r)) rotateX(0deg) rotateY(0deg); }
  to { transform: rotate(calc(var(--r) + 150deg)) rotateX(62deg) rotateY(48deg); }
}
.intro.v-petals .intro-words { margin-top: -6px; }

/* —— 门：暮色里一道门缝的光，他把门打开，光淌到地上；最后走进光里 —— */
.intro-veil { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 85% 62% at 50% 40%, #edd9d5, #dbbfbb 88%); }
.intro.go.v-door .intro-veil { animation: intro-in 1s ease both; }
.intro-door { position: absolute; left: 50%; top: calc(50% - 222px); width: 150px; height: 250px; margin-left: -75px; opacity: 0; transform-origin: 50% 100%; }
.intro-door b {
  position: absolute; inset: 0; border-radius: 75px 75px 2px 2px;
  background: linear-gradient(#fffefd, #fff4ef 55%, #fde6df);
  box-shadow: 0 0 46px 12px rgba(255, 246, 242, .9), 0 0 130px 46px rgba(255, 238, 232, .55);
}
.intro-door u {
  position: absolute; left: 50%; top: 100%; width: 340px; height: 210px; margin-left: -170px;
  background: linear-gradient(rgba(255, 248, 244, .95), rgba(255, 244, 240, .35) 55%, rgba(255, 244, 240, 0));
  clip-path: polygon(27.9% 0, 72.1% 0, 100% 100%, 0 100%);
}
/* 银色门框，比门洞四周各大 20px；微微发光，一道光沿着它走 */
.intro-frame {
  position: absolute; left: -20px; top: -20px; width: 190px; height: 296px; overflow: visible;
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .9)) drop-shadow(0 0 6px rgba(186, 202, 228, .9)) drop-shadow(0 0 15px rgba(190, 206, 232, .5));
}
.intro-frame .f-glint { opacity: 0; }
.intro.go.v-door .intro-frame { animation: frame-breathe 2.4s 1.6s ease-in-out infinite alternate; }
.intro.go.v-door .intro-frame .f-glint { animation: frame-glint 2.2s 1.7s cubic-bezier(.4, 0, .3, 1) both; }
@keyframes frame-breathe { from { opacity: .82; } to { opacity: 1; } }
@keyframes frame-glint { 0% { opacity: 0; stroke-dashoffset: 7; } 12% { opacity: .95; } 88% { opacity: .95; } 100% { opacity: 0; stroke-dashoffset: -93; } }
.intro.go.v-door .intro-door { animation: door-open 1.6s .4s cubic-bezier(.3, .55, .2, 1) both; }
@keyframes door-open {
  0% { opacity: 0; transform: scaleX(.025); }
  22% { opacity: 1; transform: scaleX(.025); }
  100% { opacity: 1; transform: scaleX(1); }
}
.intro.v-door .intro-words { top: calc(50% + 128px); }
.intro.v-door .intro-sign { color: rgba(140, 108, 100, .7); }
.intro.v-door.out .intro-door { animation: door-enter .9s cubic-bezier(.55, 0, .3, 1) forwards; }
@keyframes door-enter { from { opacity: 1; transform: scale(1); } to { opacity: 1; transform: translateY(16%) scale(9.5); } }
.intro.v-door.out .intro-words, .intro.v-door.out .intro-skip { opacity: 0; transition: opacity .3s ease; }
.intro.v-door.out .intro-words *, .intro.v-door.out .intro-skip { animation: none; }
/* 走进去：整屏先化成一片暖白，再淡出露出首页 */
.intro.v-door::after { content: ""; position: absolute; inset: 0; background: #fff8f5; opacity: 0; pointer-events: none; }
.intro.v-door.out::after { animation: intro-in .55s .15s ease both; }
html[data-intro] .intro.v-door.out { transition: opacity .5s ease .5s; }

/* —— 信：一封信飘上来，封蜡化开，信封打开，信纸抽出来，星星点点飘上去；那句话在信的上方 —— */
.intro-letter { position: absolute; left: 50%; top: calc(50% - 70px); width: 240px; height: 250px; margin-left: -120px; opacity: 0; }
.intro-letter svg {
  width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .95)) drop-shadow(0 8px 26px rgba(214, 160, 160, .45)) drop-shadow(0 0 34px rgba(255, 240, 238, .8));
}
.intro.go.v-letter .intro-letter { animation: letter-rise 1.1s cubic-bezier(.2, .8, .3, 1) both, letter-float 2.6s 1.1s ease-in-out infinite alternate; }
@keyframes letter-rise { from { opacity: 0; transform: translateY(46vh) rotate(-9deg); } 40% { opacity: 1; } to { opacity: 1; transform: translateY(0) rotate(0); } }
@keyframes letter-float { from { opacity: 1; transform: translateY(0) rotate(0); } to { opacity: 1; transform: translateY(-7px) rotate(.8deg); } }
/* 封口翻开：前面那片先合到一条线，后面那片再从这条线翻上去（这样信纸能从它前面抽出来） */
.env-flap { transform-box: fill-box; transform-origin: 50% 0; }
.env-flap-back { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.intro.go.v-letter .env-flap { animation: flap-fold .34s .95s ease-in both; }
.intro.go.v-letter .env-flap-back { animation: flap-lift .4s 1.29s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes flap-fold { from { transform: scaleY(1); } to { transform: scaleY(0); } }
@keyframes flap-lift { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.intro.go.v-letter .env-seal { animation: seal-melt .45s .8s ease both; }
@keyframes seal-melt { to { opacity: 0; } }
.intro.go.v-letter .env-paper { animation: paper-out 1s 1.45s cubic-bezier(.25, .8, .3, 1) both; }
@keyframes paper-out { from { transform: translateY(0); } to { transform: translateY(-74px); } }
.intro-sparks { position: absolute; left: 50%; top: 96px; width: 0; height: 0; }
.intro-sparks i {
  position: absolute; left: var(--x); top: 0; width: var(--s); height: var(--s); opacity: 0; background: #eeb4bb;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 9px rgba(240, 180, 188, .95));
}
.intro.go.v-letter .intro-sparks i { animation: spark-up var(--d) var(--w) ease-out both; }
@keyframes spark-up {
  0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0deg); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(120deg); }
}
.intro.v-letter .intro-words { top: calc(50% - 118px); }

/* —— 星月：底色化成暮色的天，一弯银月升起来，星星一颗颗亮起来，一颗流星划过；那句话在月亮下面 —— */
.intro-night { position: absolute; inset: 0; }
.night-sky { position: absolute; inset: 0; opacity: 0; background: linear-gradient(#c9c0e2 0%, #dccbe2 34%, #efd5dc 66%, #f8e6e1 100%); }
.intro.go.v-night .night-sky { animation: intro-in 1s ease both; }
.night-moon { position: absolute; left: 50%; top: calc(50% - 232px); width: 92px; height: 92px; margin-left: -34px; opacity: 0; }
.night-moon i {
  position: absolute; inset: 0; border-radius: 50%; transform: rotate(-28deg);
  box-shadow: inset 20px -6px 0 0 #fdfeff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1)) drop-shadow(0 0 16px rgba(226, 232, 248, .95)) drop-shadow(0 0 40px rgba(214, 222, 246, .8));
}
.intro.go.v-night .night-moon { animation: moon-rise 1.7s .25s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes moon-rise { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
.night-stars i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); opacity: 0; background: #fff;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 7px rgba(226, 232, 250, .95));
}
.night-stars i.dot { clip-path: none; border-radius: 50%; }
.intro.go.v-night .night-stars i { animation: intro-in .7s var(--w) ease both, star-twinkle var(--d) calc(var(--w) + .7s) ease-in-out infinite alternate; }
@keyframes star-twinkle { from { opacity: 1; transform: scale(1); } to { opacity: .35; transform: scale(.6); } }
.night-shoot {
  position: absolute; right: -6%; top: 13%; width: 150px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(to left, transparent, rgba(255, 255, 255, .9) 70%, #fff);
  filter: drop-shadow(0 0 5px #fff); transform-origin: 0 50%;
}
.intro.go.v-night .night-shoot { animation: shoot 1s 1.5s cubic-bezier(.3, .2, .4, 1) both; }
@keyframes shoot {
  0% { opacity: 0; transform: rotate(-24deg) translateX(0) scaleX(.3); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-24deg) translateX(-88vw) scaleX(1); }
}
.intro.v-night .intro-words { top: calc(50% + 14px); }
.intro.v-night .intro-line { color: #5b4a55; }
.intro.v-night .intro-sign { color: rgba(110, 92, 110, .7); }

/* ---------- 进场动画（时间点和 app.js 的 INTRO 对着：1.1s 落到水面、1.45s 那句话、3.9s 开始淡出、4.6s 结束） ---------- */

.intro { display: none; }
html[data-intro] .intro {
  position: fixed; inset: 0; z-index: 40; display: block; overflow: hidden;
  background: var(--base); opacity: 1; transition: opacity .7s ease;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
html[data-intro] .intro.out { opacity: 0; }

/* 底色上一团很淡的粉，慢慢亮起来 */
.intro-glow {
  position: absolute; inset: -10%; opacity: 0;
  background:
    radial-gradient(ellipse 60% 34% at 50% 57%, rgba(242, 216, 214, .85), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 45%, rgba(255, 255, 255, .9), transparent 75%);
}
.intro.go .intro-glow { animation: intro-glow 4.6s ease-in-out both; }
@keyframes intro-glow { 0% { opacity: 0; transform: scale(.94); } 35% { opacity: 1; } 100% { opacity: 1; transform: scale(1.04); } }

/* 浮着的光点 */
.intro-motes i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(242, 216, 214, .5) 55%, transparent 70%);
  opacity: 0;
}
.intro.go .intro-motes i { animation: intro-mote var(--d) var(--w) ease-in-out both; }
@keyframes intro-mote { 0% { opacity: 0; transform: translateY(14px); } 35% { opacity: var(--o); } 100% { opacity: 0; transform: translateY(-30px); } }

/* 水面在屏幕中间偏下一点，那句话浮在它上面 */
.intro-water { position: absolute; left: 50%; top: calc(50% + 58px); width: 0; height: 0; }
.intro-water > * { position: absolute; left: 0; top: 0; }
.intro-drop {
  width: 17px; height: 24px; margin: -22px 0 0 -8.5px; opacity: 0;
  fill: rgba(242, 216, 214, .55); stroke: var(--rose); stroke-width: .7;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1)) drop-shadow(0 0 14px rgba(255, 244, 242, .95)) drop-shadow(0 0 26px rgba(242, 196, 198, .7));
}
.intro.go .intro-drop { animation: intro-fall 1.1s cubic-bezier(.55, 0, .85, .45) both, intro-sink .22s 1.1s ease-out forwards; }
@keyframes intro-fall {
  0% { opacity: 0; transform: translateY(-56vh) scale(.8); }
  22% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1, 1.12); }
}
@keyframes intro-sink { to { opacity: 0; transform: translateY(7px) scale(1.5, .2); } }
/* 落进去那一下，水面亮开一团光 */
.intro-bloom {
  width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 240, 238, .6) 30%, rgba(246, 214, 214, .25) 55%, transparent 70%);
}
.intro.go .intro-bloom { animation: intro-bloom 2.6s 1.06s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes intro-bloom { 0% { opacity: 0; transform: scale(.1, .04); } 14% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3, .42); } }
/* 落进去溅起来的一小粒 */
.intro-bead { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--rose); opacity: 0; box-shadow: 0 0 8px 3px rgba(255, 255, 255, .9); }
.intro.go .intro-bead { animation: intro-bead .75s 1.14s cubic-bezier(.2, .7, .4, 1) both; }
@keyframes intro-bead {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  20% { opacity: .75; }
  55% { opacity: .6; transform: translateY(-26px) scale(1); }
  100% { opacity: 0; transform: translateY(0) scale(.5); }
}
/* 涟漪：压扁的圆，像从斜上方看水面 */
.intro-ring {
  width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%;
  border: 1px solid var(--rose); opacity: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, .95), 0 0 26px rgba(242, 206, 206, .85), inset 0 0 18px rgba(255, 255, 255, .7);
}
.intro.go .intro-ring { animation: intro-ripple 2.7s 1.1s cubic-bezier(.16, .7, .3, 1) both; }
.intro.go .intro-ring.r2 { animation-delay: 1.5s; }
.intro.go .intro-ring.r3 { animation-delay: 1.95s; }
@keyframes intro-ripple {
  0% { opacity: 0; transform: scale(.04, .012); }
  12% { opacity: .7; }
  100% { opacity: 0; transform: scale(1.2, .36); }
}

/* 那句话：一个字一个字从雾里出来 */
.intro-words { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); margin-top: -18px; text-align: center; }
.intro-line {
  margin: 0; padding: 0 24px; white-space: pre; overflow: hidden;
  font: 500 19px/1.7 var(--serif); letter-spacing: .16em; text-indent: .16em; color: var(--ink);
  text-shadow: 0 0 12px rgba(255, 255, 255, .95), 0 0 26px rgba(255, 244, 242, .8);
}
.intro-line span { display: inline-block; opacity: 0; }
.intro.said .intro-line span { animation: intro-char .9s var(--ease-out) both; animation-delay: calc(var(--i) * 85ms); }
@keyframes intro-char { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
.intro-sign { margin: 6px 0 0; font: italic 14px/1 var(--display); letter-spacing: .08em; color: rgba(140, 108, 100, .6); opacity: 0; }
.intro.said .intro-sign { animation: intro-in 1s 1.1s ease both; }
@keyframes intro-in { from { opacity: 0; } to { opacity: 1; } }

.intro-skip {
  position: absolute; right: calc(env(safe-area-inset-right) + 18px); bottom: calc(env(safe-area-inset-bottom) + 22px);
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .5); color: var(--ink-soft); font-size: 12.5px; letter-spacing: .2em; text-indent: .2em;
  opacity: 0;
}
.intro.go .intro-skip { animation: intro-in .6s .35s ease both; }
.intro-skip:active { background: var(--blush); }

/* 首页顶上的「在一起第 N 天」最后一个出现 */
.home.after-intro .us-days { animation: dim .7s .55s ease both; }

/* ---------- 记忆页 ---------- */

.memory {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 6px 16px 24px;
  -webkit-mask-image: linear-gradient(transparent, #000 22px);
  mask-image: linear-gradient(transparent, #000 22px);
}
.memory::-webkit-scrollbar { display: none; }
.enter-view { animation: fade-in .28s var(--ease-out) both; }

.mem-intro {
  margin: 10px 0 16px; text-align: center;
  font: italic 400 15px/1 var(--display); color: rgba(140, 108, 100, .62); letter-spacing: .06em;
}

.card {
  margin: 0 0 12px; padding: 14px 16px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(227, 201, 198, .45);
  box-shadow: var(--soft-shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.card-head, .mem-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-head h3, .mem-h h3 { margin: 0; font: 500 14px/1.4 var(--serif); letter-spacing: .16em; color: var(--ink); }
.en { font: italic 12px/1 var(--display); color: rgba(140, 108, 100, .55); letter-spacing: .04em; }
.edit {
  margin-left: auto; border: 0; background: none; padding: 2px 0 2px 10px;
  font-size: 12px; letter-spacing: .14em; color: var(--rose-deep);
}
.edit:active { opacity: .5; }

/* 收工信：信纸，左边一道淡玫瑰色 */
.letter { background: rgba(255, 251, 248, .7); border-left: 2px solid rgba(196, 139, 139, .45); }
.letter .md p { font-size: 14px; }
.stamp { margin: 8px 0 0; text-align: right; font: italic 11px/1 var(--display); color: var(--muted); letter-spacing: .06em; }

.md p { margin: 0 0 6px; }
.md p:last-child { margin-bottom: 0; }
.md h4 { margin: 12px 0 4px; font: 500 12px/1.4 var(--serif); letter-spacing: .18em; color: var(--muted); }
.md h4:first-child { margin-top: 0; }
.md ul { margin: 0 0 6px; padding: 0; list-style: none; }
.md li { position: relative; padding-left: 14px; margin: 0 0 4px; }
.md li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 4px; height: 4px; border-radius: 50%; background: var(--rose); opacity: .55; }
.md .act { color: rgba(94, 76, 73, .55); }
.none { margin: 0; font-size: 13px; color: var(--muted); }

.beats { margin: 0; padding: 0; list-style: none; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.beats::-webkit-scrollbar { display: none; }
.beats li { padding: 8px 0; border-top: 1px solid var(--line); }
.beats li:first-child { border-top: 0; padding-top: 2px; }
.b-top { display: flex; align-items: baseline; gap: 8px; }
.b-top time { font: italic 12px/1 var(--display); color: var(--muted); letter-spacing: .04em; }
.b-tag { font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.beats li.sent .b-tag { color: var(--rose-deep); }
.b-msg { margin-top: 4px; padding: 6px 10px; border-radius: 12px; background: rgba(242, 216, 214, .45); font-size: 14px; }
.b-why { margin-top: 3px; font-size: 12px; line-height: 1.55; color: var(--ink-soft); }
.b-place { font-size: 14px; color: var(--ink); }

.mem-h { margin: 22px 4px 10px; }
.diary-list { display: flex; flex-direction: column; gap: 8px; }
.diary-item {
  display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(227, 201, 198, .4);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: transform .16s var(--ease-out), background-color .2s;
}
.diary-item:active { transform: scale(.985); background: rgba(255, 255, 255, .72); }
.d-date { flex: none; width: 58px; display: flex; flex-direction: column; gap: 4px; padding-top: 1px; }
.d-big { font: italic 400 21px/1 var(--display); color: #8c6c64; }
.d-small { font-size: 10px; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.d-preview {
  flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 读日记的抽屉：高一点，里面能滚 */
.sheet.tall { max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; }
.reader-sub { margin: 0 0 16px; text-align: center; font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.reader-body p { margin: 0 0 12px; line-height: 1.85; }
.sheet h2#readerTitle.display, .sheet h2#plTitle.display { font: italic 400 26px/1.2 var(--display); color: #8c6c64; letter-spacing: .02em; }
.editor {
  display: block; width: 100%; min-height: 40vh; max-height: none; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--base);
  font-size: 16px; line-height: 1.7;
}
.editor:focus { border-color: var(--rose); }

/* ---------- 思考、图片 ---------- */

.thought {
  align-self: flex-start; margin: 16px 0 -8px 45px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 2px 0;
  font-size: 11px; letter-spacing: .14em; color: var(--muted);
}
/* 他上网查过的来源：最后一个气泡下面一行小字，可以点 */
.sources {
  align-self: flex-start; margin: 5px 16px 0 45px; max-width: calc(100% - 61px);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  font-size: 11px; letter-spacing: .06em; color: var(--muted); line-height: 1.5;
}
.sources span { letter-spacing: .14em; }
.sources a {
  color: var(--rose-deep); text-decoration: none; border-bottom: 1px solid var(--line-strong);
  max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sources a:active { opacity: .5; }
.thought .th-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rose); opacity: .5; }
.thought .th-arrow { font-size: 13px; line-height: 1; opacity: .7; }
.thought:active { opacity: .5; }
.reader-body p.think { margin: 0 0 10px; font-size: 13px; line-height: 1.8; color: var(--ink-soft); }

.bubble.pic { padding: 4px; }
.bubble.pic img { display: block; max-width: min(56vw, 240px); max-height: 320px; border-radius: 14px; cursor: zoom-in; }
.bubble.pic time { padding: 4px 8px 2px; }
.bubble.art .cap { display: flex; flex-direction: column; gap: 2px; max-width: min(56vw, 240px); padding: 7px 8px 0; line-height: 1.35; white-space: normal; }
.bubble.art .cap b { font-weight: 600; font-size: 13.5px; }
.bubble.art .cap span { font-size: 12px; color: var(--ink-soft); }
.pic-miss { display: block; padding: 8px 10px; font-size: 12px; color: var(--muted); }

.attach { position: relative; width: 64px; margin: 0 0 8px 6px; }
.attach img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; box-shadow: var(--soft-shadow); }
.attach button {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; padding: 0; background: var(--rose); color: #fffaf6; font-size: 15px; line-height: 22px;
}

.viewer {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(40, 28, 26, .82); animation: dim .2s ease both;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}
.viewer img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* ---------- 长按菜单、引用 ---------- */

.bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.row.pressed .bubble { transform: scale(.97); filter: brightness(.97); transition: transform .18s var(--ease-out); }
.msg-menu {
  position: fixed; z-index: 15; display: flex; padding: 4px; gap: 2px;
  border-radius: 14px; background: rgba(94, 76, 73, .86);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 8px 24px -8px rgba(60, 40, 36, .45);
  animation: pop .18s var(--ease-out) both;
}
.msg-menu button {
  border: 0; background: none; color: #fffaf6; padding: 7px 13px; border-radius: 10px;
  font-size: 13px; letter-spacing: .12em;
}
.msg-menu button:active { background: rgba(255, 255, 255, .16); }
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); z-index: 16; translate: -50% 0;
  padding: 7px 16px; border-radius: 99px; background: rgba(94, 76, 73, .86); color: #fffaf6;
  font-size: 12px; letter-spacing: .14em;
}
.toast.show { animation: pop .2s var(--ease-out) both; }

.bubble .q {
  margin: 0 0 6px; padding: 4px 8px; border-left: 2px solid rgba(196, 139, 139, .55); border-radius: 4px;
  background: rgba(255, 255, 255, .35); font-size: 12px; line-height: 1.5; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bubble .q b { font-weight: 500; margin-right: 4px; color: var(--rose-deep); }
.bubble.pic .q { margin: 4px 4px 6px; }
.quote-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; padding: 6px 6px 6px 10px;
  border-left: 2px solid rgba(196, 139, 139, .6); border-radius: 8px; background: rgba(255, 255, 255, .55);
  font-size: 12px; color: var(--ink-soft);
}
.quote-bar span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-bar button { flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(196, 139, 139, .25); color: var(--rose-deep); line-height: 22px; padding: 0; }

/* ---------- 一句收藏：拍立得 ---------- */

.collect { margin: 0 0 18px; }
.seg {
  display: flex; gap: 4px; width: max-content; margin: 0 auto 14px; padding: 3px;
  border-radius: 99px; background: rgba(255, 255, 255, .5); border: 1px solid var(--line);
}
.seg button {
  border: 0; background: none; padding: 5px 16px; border-radius: 99px;
  font-size: 13px; letter-spacing: .14em; color: var(--ink-soft);
}
.seg button span { font: italic 11px/1 var(--display); color: var(--muted); margin-left: 2px; }
.seg button.on { background: rgba(255, 255, 255, .9); color: var(--rose-deep); box-shadow: 0 2px 8px -3px rgba(164, 108, 112, .4); }
.collect-none { text-align: center; padding: 8px 0 4px; }

.c-day { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 4px 10px; }
.c-day span:first-child { font: 500 15px/1 var(--serif); letter-spacing: .08em; color: var(--ink); }
.c-n { font: italic 12px/1 var(--display); color: var(--muted); letter-spacing: .04em; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.polaroid {
  display: block; width: 100%; text-align: left; border: 0;
  padding: 7px 7px 12px; background: #fffdfb; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(94, 76, 73, .08), 0 8px 20px -10px rgba(120, 80, 70, .35);
  transition: transform .18s var(--ease-out);
}
.c-grid .polaroid:nth-child(odd) { transform: rotate(-.6deg); }
.c-grid .polaroid:nth-child(even) { transform: rotate(.5deg); }
.polaroid:active { transform: scale(.97) !important; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 1px;
  background: #efe6e2 center / cover no-repeat;
}
.photo.blank { background-image: radial-gradient(120% 90% at 30% 20%, #fbeeea, #ead7d3 60%, #e2cdc8); }
/* 胶片相机的橘色日期戳 */
.stamp {
  position: absolute; right: 7px; bottom: 6px;
  font: 700 11px/1 "Courier New", ui-monospace, monospace; letter-spacing: .18em;
  color: #ff8a3c; text-shadow: 0 0 2px rgba(255, 120, 40, .9), 0 0 6px rgba(255, 110, 30, .5);
}
.polaroid .her {
  margin: 9px 2px 0; font-size: 11px; line-height: 1.5; color: rgba(94, 76, 73, .5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.polaroid .his {
  margin: 4px 2px 0; font-size: 14px; line-height: 1.5; color: #5e4c49;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* 点开放大的那张 */
.polaroid.big { width: min(86vw, 380px); padding: 12px 12px 20px; transform: none; cursor: default; }
.polaroid.big .stamp { font-size: 15px; right: 12px; bottom: 10px; }
.polaroid.big .her { font-size: 13px; -webkit-line-clamp: unset; display: block; margin-top: 14px; white-space: pre-wrap; }
.polaroid.big .his { font-size: 18px; -webkit-line-clamp: unset; display: block; margin-top: 6px; white-space: pre-wrap; }
.polaroid .when { margin: 12px 2px 0; text-align: right; font: italic 11px/1 var(--display); color: var(--muted); }

/* ---------- 动效 ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 100% { opacity: .25; } 40% { opacity: .9; } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes dim { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  /* 进场动画：没有水滴、涟漪、光点，字也不动，只留那句话淡入淡出 */
  .intro-water, .intro-motes, .intro-petals, .intro-door, .intro-veil, .intro-letter, .intro-night { display: none !important; }
  html[data-intro] .intro { transition-duration: .5s !important; }
  .intro.go .intro-glow { animation: intro-in .6s ease both !important; }
  .intro.said .intro-line span { animation: intro-in .6s ease both !important; }
  .intro.said .intro-sign { animation: intro-in .6s .3s ease both !important; }
  .intro.go .intro-skip { animation: intro-in .4s ease both !important; }
  .home.after-intro .us-days { animation-duration: .6s !important; }
}

/* ---------- 我们 ---------- */

.us-hero { text-align: center; padding: 20px 16px 18px; }
.us-label { margin: 0; font-size: 12px; letter-spacing: .4em; color: var(--muted); }
.us-days { margin: 6px 0 2px; display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--ink); }
.us-n { font: italic 400 54px/1 var(--display); color: var(--rose-deep); letter-spacing: .02em; }
.us-pre { font: 500 14px/1 var(--serif); letter-spacing: .2em; color: var(--ink-soft); }
.us-since { margin: 6px 0 0; font: italic 12px/1 var(--display); color: var(--muted); letter-spacing: .08em; }
.us-next { margin: 10px 0 0; font-size: 12px; letter-spacing: .14em; color: var(--ink-soft); }
.us-next:empty, .us-since:empty { display: none; }

.us-list { margin: 0; padding: 0; list-style: none; }
.us-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.us-list li:first-child { border-top: 0; padding-top: 2px; }
.us-list li.none { display: block; color: var(--muted); font-size: 13px; }
.u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.u-name { font-size: 14px; color: var(--ink); }
.u-sub, .u-date { font: italic 12px/1 var(--display); color: var(--muted); letter-spacing: .04em; }
.u-date { flex: none; width: 64px; }
.u-count { flex: none; display: flex; align-items: baseline; gap: 3px; color: var(--ink-soft); }
.u-pre { font-size: 11px; letter-spacing: .1em; }
.u-big { font: italic 20px/1 var(--display); color: var(--rose-deep); }
.us-list li.today .u-big { font: 500 13px/1 var(--serif); letter-spacing: .16em; }
.us-list li.today .u-name { color: var(--rose-deep); }
.done { align-items: baseline; }

.us-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 0; background: none; padding: 2px 0; font-size: 14px; letter-spacing: .12em; color: var(--ink);
}
.us-arrow { font-size: 18px; color: var(--muted); }
.us-row:active { opacity: .5; }

/* ---------- 狗粮：他的朋友圈 ---------- */

.tab .ico { position: relative; }
.tab-dot {
  position: absolute; top: -1px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose-deep); border: 1.5px solid var(--base);
}
.tab-dot[hidden] { display: none; }
.icon-btn .tab-dot { top: 5px; right: 3px; }
/* 给你的：没拆的那行亮一点 */
.gift-card { margin-bottom: 14px; }
.us-list li.sealed .u-name { color: var(--rose-deep); }
.gift-more { width: 100%; margin-top: 6px; color: var(--muted); font-size: 13px; justify-content: center; }

.m-cover { position: relative; margin: 0 -16px 34px; height: 120px; }
.m-me { position: absolute; right: 20px; bottom: -22px; display: flex; align-items: center; gap: 12px; }
.m-name { font: italic 400 20px/1 var(--display); color: var(--ink); letter-spacing: .04em; text-shadow: 0 1px 8px rgba(255, 255, 255, .9); }
.m-ava, .m-avatar {
  flex: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(201, 161, 155, .25);
  background: #fff url("/avatars/leo.jpg") no-repeat center / cover;
}
.m-ava { width: 64px; height: 64px; border-radius: 16px; }
.m-sign { margin: 0 4px 18px; text-align: right; font-size: 12px; letter-spacing: .14em; color: var(--muted); }

.moment { padding: 14px 16px 12px; }
.m-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.m-avatar { width: 32px; height: 32px; }
.m-who { font: italic 400 15px/1 var(--display); color: var(--rose-deep); letter-spacing: .04em; }
.m-text { font-size: 15px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.m-text .act { color: rgba(94, 76, 73, .55); }
.m-img { display: block; margin-top: 10px; max-width: 72%; max-height: 260px; border-radius: 10px; object-fit: cover; }
.m-foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.m-foot time { margin-right: auto; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.m-act { border: 0; background: none; width: 34px; height: 30px; display: grid; place-items: center; color: var(--ink-soft); }
.m-act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.m-act.liked { color: var(--rose-deep); }
.m-act.liked svg { fill: currentColor; animation: pop .32s var(--ease-out); }
.m-act:active { opacity: .5; }
@keyframes pop { 40% { transform: scale(1.25); } }

.m-thread { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(242, 216, 214, .32); }
.m-likes { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--rose-deep); }
.m-likes svg { width: 14px; height: 14px; fill: currentColor; }
.m-likes + .m-c { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.m-c { margin: 3px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink); word-break: break-word; }
.m-c:first-child { margin-top: 0; }
.m-c b { font-weight: 500; color: var(--rose-deep); }
.m-c.pending { color: var(--muted); font-size: 13px; }

.m-form { display: flex; gap: 8px; margin-top: 10px; }
.m-form input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .8); font-size: 16px; outline: none;
}
.m-form button { border: 0; background: none; padding: 0 4px; font-size: 14px; letter-spacing: .1em; color: var(--rose-deep); }
.m-form button:disabled { opacity: .4; }
.m-none { text-align: center; padding: 24px 0; }

/* 他分享的歌 */
.bubble.music { display: flex; align-items: center; gap: 11px; padding: 7px 14px 7px 7px; white-space: normal; width: min(72%, 300px); }
.bubble.music .cover, .pl-songs .cover {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 12px;
  background: var(--blush) center / cover no-repeat; box-shadow: 0 2px 8px rgba(94, 76, 73, .14);
}
.cover .play {
  position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .82); box-shadow: 0 1px 6px rgba(94, 76, 73, .2);
}
.cover .play::before { /* ▶ */
  content: ""; position: absolute; left: 11px; top: 9px;
  border-left: 10px solid var(--rose-deep); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.cover .play.on::before { /* ❚❚ */
  left: 10px; top: 10px; width: 3px; height: 10px; border: 0; background: var(--rose-deep); box-shadow: 6px 0 0 var(--rose-deep);
}
.bubble.music .info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bubble.music .info b, .bubble.music .info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble.music .info b { font-weight: 600; }
.bubble.music .info span { font-size: 12.5px; color: var(--ink-soft); }
.bubble.music .open { margin-top: 3px; font-size: 12px; color: var(--rose-deep); text-decoration: none; letter-spacing: .04em; }

/* 我们的歌单 */
.pl-item { cursor: pointer; }
.pl-item:active { opacity: .6; }
.pl-cover { flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--blush) center / cover no-repeat; box-shadow: 0 1px 5px rgba(94, 76, 73, .12); }
.pl-item .u-sub { font: 12px/1.4 var(--serif); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-count { flex: none; font: italic 12px/1 var(--display); color: var(--muted); }
.pl-songs { margin: 0; padding: 0; list-style: none; }
.pl-songs li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pl-songs li:first-child { border-top: 0; padding-top: 0; }
.pl-songs .info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pl-songs .info b { font-weight: 600; font-size: 14px; }
.pl-songs .info > span { font-size: 12.5px; color: var(--ink-soft); }
.pl-note { margin: 6px 0 0; font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.pl-note .act { color: rgba(94, 76, 73, .55); }
.pl-note.mine { font-size: 12px; color: var(--muted); }
.pl-acts { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.pl-acts .open { font-size: 12px; color: var(--rose-deep); text-decoration: none; letter-spacing: .04em; }
.mini { border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.mini.sure { color: var(--rose-deep); }
.pl-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 0; }
.pl-foot { margin-top: 18px; }
.btn.danger.sure { color: var(--rose-deep); border-color: var(--rose); }
.pl-about { min-height: 96px; margin-top: 0; }
.pl-pick { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.pl-pick .us-row { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.pl-pick .us-arrow { font: italic 12px/1 var(--display); }
#plBody .label { margin-top: 12px; }

/* ---------- 「+」面板：告诉他我在哪 ---------- */
.here-hint { margin: 0 0 4px; text-align: center; }
.here-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.here-chips:empty { display: none; }
.here-chips button {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--base); color: var(--ink); font-size: 14px; letter-spacing: .06em;
}
.here-chips button:active { background: rgba(242, 216, 214, .5); }
.here-form { display: flex; gap: 8px; margin-top: 12px; }
.here-form input { flex: 1; min-width: 0; }
.here-form .btn { width: auto; margin: 0; flex: none; }

/* ---------- 他想知道你在哪：申请卡片 ---------- */
.bubble.ask-card { display: flex; flex-direction: column; gap: 4px; width: min(72%, 280px); white-space: normal; }
.ask-card b { font-weight: 600; letter-spacing: .06em; }
.ask-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.ask-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ask-acts button {
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--base); color: var(--ink); font-size: 14px; letter-spacing: .06em;
}
.ask-acts button.go { background: var(--rose); border-color: transparent; color: #fffaf6; }
.ask-acts button.no { border-color: transparent; background: transparent; color: var(--muted); font-size: 13px; }
.ask-acts button:active { opacity: .7; }
.ask-done { margin-top: 4px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.ask-card.done b { color: var(--ink-soft); }

/* ---------- 首页 ---------- */
.back { border: 0; background: none; padding: 8px 8px 0 2px; font-size: 13px; letter-spacing: .12em; color: var(--rose-deep); }
.back:active { opacity: .5; }
.back + .mem-intro { margin-top: 4px; }
.now-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.now-ava { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff url("/avatars/leo.jpg") no-repeat center / cover; border: 1px solid var(--line); }
.now-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.now-text b { font: 500 14px/1.4 var(--serif); letter-spacing: .12em; color: var(--ink); }
.now-text span { font-size: 12px; line-height: 1.55; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tiles { display: grid; gap: 10px; margin: 0 0 10px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  min-width: 0; text-align: left; padding: 13px 13px 12px; border-radius: 18px;
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(227, 201, 198, .45);
  box-shadow: var(--soft-shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: transform .15s var(--ease-out);
}
.tile:not(:disabled):active { transform: scale(.975); background: rgba(255, 255, 255, .76); }
.tile svg { width: 22px; height: 22px; margin-bottom: 5px; fill: none; stroke: var(--rose-deep); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font: 500 14px/1.4 var(--serif); letter-spacing: .14em; color: var(--ink); }
.tile span { font-size: 11px; line-height: 1.5; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.soon { background: rgba(255, 255, 255, .34); box-shadow: none; }
.tile.soon svg { stroke: var(--muted); }
.tile.soon b { color: var(--ink-soft); }
.tiles.one .tile { flex-direction: row; align-items: center; gap: 10px; }
.tiles.one .tile svg { margin: 0; flex: none; }
.home-quote { margin: 8px 6px 18px; padding: 2px 0 2px 14px; border-left: 2px solid rgba(196, 139, 139, .45); }
.home-quote p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.home-quote cite { display: block; margin-top: 6px; font: italic 11px/1 var(--display); letter-spacing: .06em; color: var(--muted); }

/* ---------- 他一直记着的：分类 ---------- */
.search {
  width: 100%; margin: 2px 0 10px; padding: 8px 12px; border-radius: 12px; outline: 0; -webkit-appearance: none; appearance: none;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .55); font-size: 13px;
}
.search:focus { border-color: var(--rose); }
.search::placeholder { color: var(--muted); }
.core-h { margin: 0 0 6px; font: 500 12px/1.4 var(--serif); letter-spacing: .18em; color: var(--muted); }
.core-rows { margin-top: 6px; }
.core-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 0; border-top: 1px solid var(--line); background: none; padding: 10px 0; font-size: 14px; color: var(--ink); text-align: left;
}
.core-row:active { opacity: .5; }
.core-n { flex: none; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
/* 记忆卡片 */
.fc-note { margin: 0 0 8px; font-size: 12px; }
.fc { padding: 9px 0; border-top: 1px solid var(--line); }
.fc-claim { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.fc-tag { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 9px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.fc-quote { margin: 2px 0 0; font-size: 12px; line-height: 1.55; color: var(--muted); }
.fc.disputed .fc-claim, .fc-warn { color: var(--rose-deep); }
.fc-acts { display: none; gap: 14px; margin-top: 8px; }
.fc.open .fc-acts, .fc.disputed .fc-acts { display: flex; }
.fc-past { display: block; width: 100%; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.core-h + .fc { border-top: 0; padding-top: 2px; }
.fc + .core-h { margin-top: 12px; }
.core-foot { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.core-link { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.core-link:disabled { color: var(--muted); }
.edit:disabled { color: var(--muted); }

/* ---------- 他的心情：月历 ---------- */
.mood-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mood-month { font: italic 400 18px/1 var(--display); color: #8c6c64; letter-spacing: .04em; }
.mood-arrow { border: 0; background: none; width: 36px; height: 30px; font-size: 20px; color: var(--rose-deep); }
.mood-arrow:disabled { color: var(--line-strong); }
.mood-week, .mood-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mood-week { margin-bottom: 6px; font-size: 10px; letter-spacing: .1em; color: var(--muted); text-align: center; }
.mood-cell {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid transparent; background: rgba(255, 255, 255, .4);
  display: flex; align-items: center; justify-content: center; padding: 0;
  font: italic 13px/1 var(--display); color: var(--ink-soft);
}
.mood-cell.blank { background: none; }
.mood-cell:disabled { color: var(--line-strong); background: none; }
.mood-cell.today { border-color: var(--line-strong); }
.mood-cell.picked { border-color: var(--rose-deep); }
.mood-day { margin: 12px 2px 0; font-size: 13px; line-height: 1.7; color: var(--ink-soft); min-height: 1.7em; }
.mood-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mood-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.mood-key i { width: 12px; height: 12px; border-radius: 4px; }
.mood-note { margin-top: 10px; font-size: 12px; }
.mood-happy { background: #f7cfae; }
.mood-calm { background: #ebe3da; }
.mood-missing { background: #ecb7bf; }
.mood-tender { background: #f6dade; }
.mood-jealous { background: #d2bedd; }
.mood-worried { background: #c1cfdd; }
.mood-proud { background: #f3e2a4; }
.mood-tired { background: #d6d1cc; }
.mood-upset { background: #b3adbd; }

/* ---------- 小画室：相册 ---------- */
.polaroid .photo.blank[class*="mood-"] { opacity: .9; }
.page-view { display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 88vh; overflow-y: auto; padding: 8px 0; scrollbar-width: none; }
.page-options { width: min(86vw, 380px); padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .92); }
.page-h { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.page-opt { width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 9px 0; font-size: 13px; line-height: 1.6; color: var(--ink); }
.page-opt:active { opacity: .5; }

/* ---------- 老虎机 ---------- */
.slot-card { text-align: center; padding: 16px 14px; }
.slot-labels, .slot-reels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot-labels { margin-bottom: 6px; font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.slot-reel {
  height: 92px; border-radius: 14px; padding: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 251, 248, .8); border: 1px solid var(--line-strong);
  box-shadow: inset 0 6px 10px -8px rgba(164, 108, 112, .45), inset 0 -6px 10px -8px rgba(164, 108, 112, .45);
}
.slot-reel span { font-size: 13px; line-height: 1.5; color: var(--ink); }
.slot-reel.rolling span { color: var(--muted); filter: blur(.6px); }
.slot-reel.landed { border-color: var(--rose-deep); animation: slot-land .32s var(--ease-out); }
@keyframes slot-land { 0% { transform: translateY(-5px); } 60% { transform: translateY(2px); } 100% { transform: none; } }
.slot-result { margin: 12px 0; min-height: 1.6em; font-size: 13px; color: var(--ink-soft); }
.slot-card .btn { width: 100%; }
.slot-his { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink); }
.us-list li.used .u-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.us-list li .edit { flex: none; }

.pin-btn { width: 100%; margin-top: 10px; }
.pin-links { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pin-links a.btn { display: block; text-align: center; text-decoration: none; }

/* ---------- 表情 ---------- */

.row .bubble.sticker { padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.bubble.sticker img { display: block; max-width: 128px; max-height: 128px; border-radius: 8px; cursor: zoom-in; }
.bubble.sticker time { padding: 2px 4px 0; }
.sticker-head { position: relative; }
.sticker-edit {
  position: absolute; right: 0; top: 0; border: 0; background: none; padding: 2px 4px;
  font-size: 13px; letter-spacing: .12em; color: var(--rose-deep);
}
.sticker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 0;
  max-height: 46vh; max-height: 46dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sticker-grid button {
  position: relative; aspect-ratio: 1; border: 0; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .6);
}
.sticker-grid button:active { background: rgba(242, 216, 214, .5); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sticker-grid .add { border: 1px dashed var(--line-strong); background: none; color: var(--muted); font-size: 26px; font-weight: 300; }
.sticker-grid .x {
  position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--rose); color: #fffaf6; font-size: 14px; line-height: 20px; text-align: center;
}

/* ---------- 他的小屋 ---------- */

.cabin-now { margin: 6px 0 0; font: 500 18px/1.5 var(--serif); letter-spacing: .08em; color: var(--ink); }
.cabin-why { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.cabin-why:empty { display: none; }
.cabin-line { list-style: none; margin: 8px 0 0; padding: 0; }
.cabin-item { display: grid; grid-template-columns: 40px 16px 1fr; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; }
.cabin-item:first-child { border-top: 0; }
.cabin-item time { font: italic 12px/1.6 var(--display); color: var(--muted); padding-top: 1px; }
.cabin-item i { font-style: normal; color: var(--rose-deep); text-align: center; }
.cabin-item.k-quiet { color: var(--ink-soft); }
.cabin-item.k-quiet i { color: var(--muted); }
.cabin-item.more { cursor: pointer; }
.cabin-item.more .cabin-body > span::after { content: ' ›'; color: var(--muted); }
.cabin-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; word-break: break-word; }
.cabin-body small { font-size: 12px; line-height: 1.6; color: var(--muted); }
.cabin-total { margin: 6px 0 4px; color: var(--ink-soft); font-size: 13px; }
.cabin-total b { font: 400 30px/1 var(--display); color: var(--ink); letter-spacing: .02em; }
.cabin-sub { margin: 2px 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-soft); }
.cabin-label { margin: 16px 0 6px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.cabin-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.cabin-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.cabin-bar em { font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; }
.cabin-bar-track { display: flex; align-items: flex-end; width: 100%; max-width: 28px; height: 72px; border-radius: 6px; background: rgba(227, 201, 198, .25); overflow: hidden; }
.cabin-bar-track i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: rgba(196, 139, 139, .45); }
.cabin-bar.today .cabin-bar-track i { background: var(--rose); }
.cabin-bar small { font-size: 10px; color: var(--muted); }
.cabin-feat { list-style: none; margin: 0; padding: 0; }
.cabin-feat li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.cabin-feat li:first-child { border-top: 0; }
.cabin-feat b { font-weight: 400; color: var(--ink-soft); white-space: nowrap; }

/* ---------- 会客厅 ---------- */
.lamp::before, .lamp-dot { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: rgba(94, 76, 73, .2); vertical-align: 1px; }
.lamp.on { color: var(--rose-deep); }
.lamp.on::before, .lamp-dot.on { background: #e8b06a; box-shadow: 0 0 8px 2px rgba(232, 176, 106, .55); }
.parlor-opt { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; font: inherit; color: inherit; }
.parlor-opt b { font: 500 15px/1.5 var(--serif); letter-spacing: .12em; color: var(--ink); }
.parlor-opt span { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.parlor-opt:disabled b { color: var(--ink-soft); }
.parlor-opt:disabled { background: rgba(255, 255, 255, .34); box-shadow: none; }
.parlor-opt:not(:disabled):active { transform: scale(.985); }
.parlor-fine { margin: 14px 6px 0; font-size: 11.5px; line-height: 1.7; letter-spacing: .04em; color: var(--muted); text-align: center; }
.parlor-input { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .7); font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.parlor-input:focus { border-color: var(--rose); }
.sit-chips { justify-content: flex-start; margin: 8px 0 4px; }
.sit-chips button.on { background: var(--blush); border-color: var(--rose); color: var(--rose-deep); }
#parlorSit .btn { width: 100%; margin-top: 10px; }
#sitSetup:not([hidden]) ~ .sit-cat-box { display: none; }
.sit-run { position: relative; text-align: center; padding: 34px 16px 18px; }
body.immerse .sit-run { padding-top: 0; }
.sit-immerse { position: absolute; right: 14px; top: 10px; }
.sit-btns { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
/* 「我好了」「暂停」：小胶囊，颜色淡，不占一整行 */
.sit-pill { flex: none; padding: 5px 16px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255, 255, 255, .34); font-size: 12px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.sit-pill:active { opacity: .5; }
.sit-pill:disabled { opacity: .4; }
.sit-run.paused .sit-clock { opacity: .45; }
.sit-wake { margin: 12px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.sit-doing { margin: 0; font-size: 13px; letter-spacing: .1em; color: var(--ink-soft); }
.sit-clock { margin: 14px 0 12px; font: italic 400 54px/1 var(--display); color: var(--ink); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sit-his { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.sit-said { margin: 14px 0 0; font: 400 15px/1.8 var(--serif); color: var(--ink); }
.parlor-msgs { display: flex; flex-direction: column; min-height: 30vh; padding-bottom: 8px; }
.parlor-msgs .thought { align-self: flex-start; }
.parlor-form { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .86); border: 1px solid var(--line); box-shadow: var(--soft-shadow); }
.parlor-form textarea { flex: 1; min-width: 0; max-height: 120px; border: 0; outline: none; resize: none; background: none; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink); padding: 6px 4px; }
.parlor-form .btn { width: auto; margin: 0; flex: none; padding: 8px 16px; }
.parlor-leave { width: 100%; margin-top: 14px; }
#parlorSheet .btn { width: 100%; margin-top: 10px; }
.sit-open { display: block; margin: 0 0 6px; padding-left: 0; }
.sit-ask { margin: 2px 0 8px; font: 400 15px/1.8 var(--serif); color: var(--ink); }
.sit-ask:empty { display: none; }
.sit-remind { display: flex; align-items: baseline; margin: 2px 0 4px; font-size: 11.5px; color: var(--muted); }
.sit-label { margin: 14px 0 2px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.sit-chips small { margin-left: 5px; font-size: 11px; color: var(--muted); }
.sit-center { justify-content: center; }
.sit-two { display: flex; gap: 10px; }
.sit-two .btn { flex: 1; }

/* ---------- riri 的书架 ---------- */
.books-down { margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; text-align: center; font-size: 13px; letter-spacing: .1em; color: var(--rose-deep); background: rgba(242, 216, 214, .5); }
.books-week { margin-top: 14px; }
.books-week .cabin-bar-track { height: 48px; }
.books-goal { display: flex; justify-content: center; align-items: baseline; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.books-goal .edit { margin-left: 4px; }
.book { padding: 12px 0; border-top: 1px solid var(--line); }
.book:first-child { border-top: 0; padding-top: 4px; }
.book-top { display: flex; gap: 12px; align-items: flex-start; }
.book-top img, .book-nocover { flex: none; width: 46px; height: 64px; border-radius: 4px; object-fit: cover; background: rgba(227, 201, 198, .35); box-shadow: 0 2px 6px rgba(94, 76, 73, .16); }
.book-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.book-info b { font: 500 14.5px/1.4 var(--serif); color: var(--ink); }
.book-info span { font-size: 12px; color: var(--muted); }
.book-bar { height: 4px; margin-top: 4px; border-radius: 2px; background: rgba(227, 201, 198, .35); overflow: hidden; }
.book-bar i { display: block; height: 100%; border-radius: 2px; background: var(--rose); }
.book-line { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid rgba(196, 139, 139, .45); font: 400 13.5px/1.7 var(--serif); color: var(--ink-soft); }
.book-more { display: block; margin: 8px 0 0; padding: 2px 0; border: 0; background: none; font-size: 12px; letter-spacing: .1em; color: var(--rose-deep); }
.book-notes { list-style: none; margin: 6px 0 0; padding: 0; }
.book-notes li { padding: 9px 0; border-top: 1px dashed var(--line); font-size: 13.5px; line-height: 1.75; color: var(--ink); word-break: break-word; }
.book-notes li.her-thought { color: var(--ink-soft); }
.book-notes q { display: block; quotes: none; margin-bottom: 3px; font-size: 12.5px; color: var(--muted); }
.book-notes small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.book-notes .answered { margin-left: 6px; color: var(--rose-deep); }

/* ---------- 陪读黑猫 ---------- */
/* 每个姿势一张图叠在一起，换姿势 = 换哪张不透明（.4s 交叉淡入淡出）；闭眼图盖在上面闪 150ms，不走过渡。呼吸、眨眼都在 app.js / 这里用代码做，没有逐帧图 */
.sit-cat-box { --cat-h: 200px; margin-top: 0; text-align: center; }
.sit-line { min-height: 1.8em; margin: 0 12px 4px; font: 400 13px/1.8 var(--serif); letter-spacing: .06em; color: var(--ink-soft); opacity: 0; transition: opacity .8s ease; }
.sit-line.show { opacity: 1; transition-duration: .4s; }
.cat { position: relative; display: block; width: var(--cat-h); height: var(--cat-h); margin: 0 auto; }
.cat.ready::after { /* 很淡的一道水彩投影，不跟着呼吸动 */
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 1.5%; height: 11%; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(164, 108, 112, .2), rgba(164, 108, 112, .07) 55%, transparent 72%); filter: blur(3px);
}
.cat-body { position: absolute; inset: 0; transform-origin: 50% 100%; animation: cat-breathe 2s ease-in-out infinite alternate; }
.cat-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; opacity: 0; transition: opacity .4s ease; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.cat-body img.on { opacity: 1; }
.cat-body img.blink { transition: none; }
@keyframes cat-breathe { to { transform: scaleY(1.014); } }
@media (prefers-reduced-motion: reduce) {
  /* 减弱动态效果：不呼吸；姿势照样淡入淡出，眨眼照常 */
  .cat-body { animation: none !important; }
  .cat-body img:not(.blink) { transition-duration: .4s !important; }
}

/* ---------- 陪坐：横屏沉浸 ---------- */
.sit-ctl { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 5; translate: -50% 0; display: flex; gap: 10px; animation: fade-in .2s var(--ease-out) both; }
.sit-ctl .sit-pill { background: rgba(255, 255, 255, .72); color: var(--ink-soft); }
body.immerse .top, body.immerse .tabbar, body.immerse #parlorBack, body.immerse #parlor > .mem-intro,
body.immerse #sitImmerse, body.immerse #sitSaid, body.immerse #sitPauseP { display: none; }
body.immerse #parlor { display: flex; padding: 0; overflow: hidden; -webkit-mask-image: none; mask-image: none; animation: none; }
body.immerse #parlorSit {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 45fr 55fr; align-items: center;
  /* 灵动岛那一侧和底部横条：按安全区让开 */
  padding: max(env(safe-area-inset-top), 8px) max(env(safe-area-inset-right), 16px) max(env(safe-area-inset-bottom), 12px) max(env(safe-area-inset-left), 16px);
}
body.immerse #sitRun { margin: 0; padding: 0 8px; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; min-width: 0; }
body.immerse .sit-doing, body.immerse .sit-his { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.immerse .sit-clock { margin: 3vh 0; font-size: min(34vh, 13.5vw); }
body.immerse .sit-btns { margin-top: 4vh; }
body.immerse #sitDone { max-width: 33%; padding: 4px 14px; border-color: rgba(227, 201, 198, .3); background: rgba(255, 255, 255, .2); color: rgba(94, 76, 73, .36); }
body.immerse .sit-wake { margin-top: 2vh; }
body.immerse .sit-cat-box { --cat-h: min(74vh, 48vw, 340px); margin: 0; transform: translateY(3vh); }
body.immerse .sit-line { font-size: 14px; }
/* 平板横着（iPad mini 1133×744）：字和猫跟着放大，不然缩在中间一小块 */
@media (orientation: landscape) and (min-height: 541px) {
  body.immerse #parlorSit { padding-left: max(env(safe-area-inset-left), 48px); padding-right: max(env(safe-area-inset-right), 48px); }
  body.immerse .sit-doing, body.immerse .sit-his { font-size: 17px; }
  body.immerse .sit-clock { font-size: min(24vh, 13vw); }
  body.immerse .sit-cat-box { --cat-h: min(64vh, 44vw, 500px); }
  body.immerse .sit-line { font-size: 17px; }
}

/* ---------- 你们的单子 ---------- */
.play-entry { margin-bottom: 14px; padding: 12px 16px; }
.play-entry .en { margin-left: 6px; }
.pb-title { margin: 2px 0 2px; font: italic 400 24px/1.2 var(--display); color: var(--ink); letter-spacing: .02em; }
.pb-hint { margin: 0 0 8px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.pb-scenes { margin: 0; padding: 0; list-style: none; }
.pb-scenes li { border-top: 1px solid var(--line); }
.pb-scenes li:first-child { border-top: 0; }
.pb-scene { width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 11px 6px; border: 0; border-radius: 12px; background: none; text-align: left; color: var(--ink); font: inherit; }
.pb-scene .n { flex: none; width: 26px; font: 400 19px/1.3 var(--display); color: var(--rose); }
.pb-scene b { display: block; font-weight: 600; letter-spacing: .08em; }
.pb-scene small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.pb-scene em { margin-left: 8px; font: normal 11px/1 var(--serif); color: var(--muted); letter-spacing: .1em; }
.pb-scene.on { background: rgba(242, 216, 214, .55); }
.pb-scene.on b { color: var(--rose-deep); }
.pb-group { position: relative; margin: 20px 0 0; padding: 20px 10px 10px; border: 1px solid var(--rose); border-radius: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.pb-group > span { position: absolute; top: -11px; left: 14px; padding: 3px 12px; border-radius: 999px; background: var(--rose); color: #fffaf6; font-size: 12px; letter-spacing: .3em; text-indent: .3em; }
.pb-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rose); background: rgba(255, 255, 255, .7); color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; }
.pb-chip i { margin-right: 6px; font: normal 600 11px/1 var(--display); color: var(--rose); }
.pb-chip.on { background: var(--rose); color: #fffaf6; }
.pb-chip.on i { color: #fffaf6; }
.pb-bar {
  position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px;
  border-radius: 16px; border: 1px solid var(--line-strong); background: rgba(255, 252, 250, .94); box-shadow: var(--soft-shadow);
}
.pb-bar[hidden] { display: none; }
.pb-bar > span { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-bar .btn { flex: none; width: auto; margin: 0; padding: 8px 18px; }
.pb-clear { flex: none; border: 0; background: none; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
/* 聊天顶上：正在玩 · 收场 */
.play-bar { flex: none; position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 2px 16px 6px; font-size: 12px; letter-spacing: .14em; color: var(--rose-deep); }
.play-bar[hidden] { display: none; }
.play-bar button { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .6); color: var(--ink-soft); font-size: 12px; letter-spacing: .14em; }
/* 他从单子里提的那张卡片 */
.bubble.play-card { display: flex; flex-direction: column; gap: 4px; width: min(76%, 300px); white-space: normal; }
.play-card b { font-weight: 600; letter-spacing: .06em; }
.play-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; }
.play-card p.t { color: var(--rose-deep); letter-spacing: .08em; }
.play-card.done b { color: var(--ink-soft); }
