/* 小屋 · 生活层样式（独立命名空间 life-，不碰原站类名） */

/* ---------- 房间里的可点物件 ---------- */
.life-clock, .life-cal { cursor: pointer; }
.life-clock:hover, .life-cal:hover { filter: brightness(1.18) drop-shadow(0 0 8px rgba(255, 207, 107, .4)); }

/* ---------- 窗外天气 ---------- */
.lw-drop {
  animation-name: lwFall;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
@keyframes lwFall {
  0%   { transform: translate(0, -20px); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(-10px, 60px); opacity: 0; }
}
.lw-flake {
  animation-name: lwSnowFall;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}
@keyframes lwSnowFall {
  0%   { transform: translate(0, -16px); opacity: 0; }
  15%  { opacity: .9; }
  50%  { transform: translate(9px, 24px); }
  100% { transform: translate(-6px, 56px); opacity: 0; }
}
.lw-cloud {
  animation: lwDrift 26s linear infinite;
}
@keyframes lwDrift {
  0%   { transform: translateX(-16px); }
  50%  { transform: translateX(14px); }
  100% { transform: translateX(-16px); }
}
.lw-star {
  animation: lwTwinkle 7s ease-in-out infinite;
}
@keyframes lwTwinkle {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}
.lw-meteor {
  animation: lwShoot 1.5s linear forwards;
}
@keyframes lwShoot {
  0%   { transform: translate(-40px, -34px); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(70px, 58px); opacity: 0; }
}

/* ---------- 猫的小动作 ---------- */
.cat-g.life-yawn { animation: catYawn 2.4s steps(6) 1; transform-origin: 640px 660px; }
@keyframes catYawn {
  0%, 100% { transform: scale(1, 1); }
  40% { transform: scale(1.03, .96); }
  70% { transform: scale(.98, 1.03); }
}
.cat-g.life-stretch { animation: catStretch 2.4s steps(6) 1; transform-origin: 640px 680px; }
@keyframes catStretch {
  0%, 100% { transform: none; }
  50% { transform: translateY(-6px) scaleX(1.04); }
}
.cat-g.life-lick { animation: catLick 2.4s steps(8) 1; transform-origin: 640px 580px; }
@keyframes catLick {
  0%, 100% { transform: none; }
  30% { transform: rotate(-2deg); }
  60% { transform: rotate(2deg); }
}
.cat-g.life-poke { animation: catPoke .46s steps(5) 1; transform-origin: 640px 690px; }
@keyframes catPoke {
  0%, 100% { transform: none; }
  35% { transform: translateY(-4px) scale(1.02, .98); }
  65% { transform: translateY(1px) scale(.99, 1.01); }
}
.cat-g.life-groove { animation: catGroove .52s steps(4) infinite; transform-origin: 640px 686px; }
@keyframes catGroove {
  0%, 100% { transform: rotate(-1.4deg); }
  50% { transform: rotate(1.4deg); }
}
.life-heart {
  animation: lifeHeartUp 1.5s steps(8) forwards;
}
@keyframes lifeHeartUp {
  0%   { transform: translate(0, 0) scale(.7); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate(-8px, -44px) scale(1.15); opacity: 0; }
}

/* ---------- 面板 ---------- */
.life-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: #08050fd6; display: grid; place-items: center; padding: 16px;
  /* 列宽必须被容器夹住：以前是 auto 列 + 卡片 width:100%，
     列被内容撑到 max-width，手机上卡片就比屏幕还宽，右边整条边看不见了 */
  grid-template-columns: minmax(0, 1fr);
  overflow-y: auto; animation: lifeFade .16s steps(2) both;
}
@keyframes lifeFade { from { opacity: 0 } to { opacity: 1 } }

.life-sheet {
  width: 100%; max-width: 470px; background: #241b35;
  border: 4px solid var(--shadow, #0b0813);
  box-shadow: inset -4px -4px #171129, inset 4px 4px #33274a, 0 0 0 4px var(--shadow, #0b0813);
  animation: lifeUp .22s steps(4) both;
}
.life-sheet.life-sm { max-width: 380px; }
.life-sheet.life-cal-sheet { max-width: 430px; }
@keyframes lifeUp { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

.life-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: #1c1529; border-bottom: 4px solid var(--shadow, #0b0813);
}
.life-title { font-size: 15px; color: var(--gold, #ffcf6b); letter-spacing: 1px; }
.life-close {
  padding: 8px 14px; font-size: 14px; background: #33274a; color: var(--cream, #f7e7cf);
  border: 4px solid var(--shadow, #0b0813);
  box-shadow: inset -4px -4px #241b35, inset 4px 4px #463659;
  white-space: nowrap; cursor: pointer;
}
.life-close:hover { background: #3d2f57; }

.life-body { padding: 18px 18px 22px; }

.life-bigtime {
  font-size: 46px; color: #ffe9c9; letter-spacing: 2px; line-height: 1.1;
}
.life-colon { color: #ffcf6b; animation: lifeBlink 2s steps(2) infinite; }
@keyframes lifeBlink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
.life-sub { font-size: 12px; color: #cbb9a5; line-height: 1.9; margin-top: 6px; }
.life-sub.dim, .life-dim { color: #8f8199; }
.life-weather-row {
  margin-top: 12px; padding: 10px 12px; font-size: 13px; color: #f7e7cf;
  background: #1a1427; border: 3px solid #2f2440;
}
.life-weather-row b { color: #ffcf6b; font-weight: normal; font-size: 16px; }
.life-hint { margin-top: 14px; font-size: 11px; line-height: 1.9; color: #8f8199; }

/* 日历 */
.life-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.life-cal-w { text-align: center; font-size: 11px; color: #8f8199; padding: 4px 0; }
.life-cal-c {
  position: relative; min-height: 44px; padding: 3px 2px;
  background: #1a1427; border: 2px solid #2b2138; text-align: center;
}
.life-cal-c.empty { background: transparent; border-color: transparent; }
.life-cal-c .life-cal-d { display: block; font-size: 13px; color: #e9dcc8; }
.life-cal-c .life-cal-l { display: block; font-size: 8px; color: #7c6e88; line-height: 1.3; }
.life-cal-c .life-cal-f {
  display: block; font-size: 8px; color: #ff9aa8; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.life-cal-c.today {
  background: #ffcf6b; border-color: #ffe7a8;
}
.life-cal-c.today .life-cal-d { color: #2a1c0c; font-weight: bold; }
.life-cal-c.today .life-cal-l { color: #6b5426; }
.life-cal-c.today .life-cal-f { color: #8a3a3a; }
.life-cal-c.fest:not(.today) { border-color: #6a4a6a; }
.life-cal-foot { margin-top: 12px; font-size: 11px; color: #9c8ca8; }
.life-cal-foot.gold { color: #ffcf6b; }

/* 气泡（自造时复用原站风格） */
.life-bubble { cursor: pointer; }

@media (max-width: 420px) {
  .life-body { padding: 14px 12px 18px; }
  .life-bigtime { font-size: 38px; }
  .life-cal-c { min-height: 40px; }
  .life-cal-c .life-cal-f { font-size: 7px; }
}

/* ---------- 第二批：收音机 / 软木板 / 本子 / 花 / 彩蛋 / 鞋 ---------- */
.life-radio { cursor: pointer; }
.life-radio:hover { filter: brightness(1.15) drop-shadow(0 0 8px rgba(255, 207, 107, .35)); }
.life-radio-wave { animation: lifeWave 1.2s steps(3) infinite; }
@keyframes lifeWave { 0%,100% { opacity: .25 } 50% { opacity: .9 } }

.life-board { cursor: pointer; }
.life-board:hover { filter: brightness(1.08); }

.life-book { cursor: pointer; }
.life-book:hover { filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 207, 107, .5)); }

.life-flower { cursor: pointer; }
.life-flower:hover { filter: drop-shadow(0 0 6px rgba(255, 154, 168, .5)); }

/* 彩蛋：扫过去才亮 */
.life-egg { cursor: pointer; }
.life-egg .life-egg-glow { transition: opacity .25s steps(3); }
.life-egg:hover .life-egg-glow { opacity: .38; }

.life-shoes { pointer-events: none; }

/* 气球轻轻飘 */
.life-balloon { animation: lifeFloat2 3.6s steps(6) infinite; }
@keyframes lifeFloat2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.life-hat { animation: lifeHatBob 3s steps(6) infinite; }
@keyframes lifeHatBob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-2px) } }

/* ---------- 面板补充 ---------- */
.life-env-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.life-env-btn {
  padding: 12px 10px; font-size: 13px; color: #f7e7cf; background: #1c1529;
  border: 3px solid #0b0813; box-shadow: inset -3px -3px #241b35, inset 3px 3px #3a2c52;
  cursor: pointer; text-align: left;
}
.life-env-btn:hover { background: #2a2040; }
.life-env-btn.on { background: #ffcf6b; color: #2a1c0c; box-shadow: inset -3px -3px #c99a41, inset 3px 3px #ffe7a8; }
.life-env-ico { margin-right: 6px; }
.life-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.life-stop {
  padding: 10px 16px; font-size: 13px; background: #33274a; color: #f7e7cf;
  border: 4px solid #0b0813; box-shadow: inset -4px -4px #241b35, inset 4px 4px #463659; cursor: pointer;
}
.life-vol { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #b9a894; }
.life-vol input { width: 90px; accent-color: #ffcf6b; }

.life-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.life-photo-cell { padding: 0; border: 3px solid #0b0813; background: #1a1427; cursor: pointer; aspect-ratio: 3/4; overflow: hidden; }
.life-photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.life-photo-cell:hover { border-color: #ffcf6b; }
.life-photo-big { border: 3px solid #0b0813; background: #1a1427; max-height: 48vh; overflow: hidden; display: grid; place-items: center; }
.life-photo-big img { max-width: 100%; max-height: 48vh; object-fit: contain; display: block; }
.life-photo-desc { margin-top: 10px; font-size: 12px; line-height: 1.8; color: #dccdb8; }
.life-photo-meta { margin-top: 4px; font-size: 11px; color: #8f8199; }
.life-note-box { margin-top: 14px; padding-top: 12px; border-top: 2px dashed #3a2c52; }
.life-note-label { font-size: 11px; color: #b9a894; margin-bottom: 6px; }
.life-note-input, .life-guest-input, .life-wish-input {
  width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 12px; line-height: 1.7;
  color: #f7e7cf; background: #1a1427; border: 3px solid #2f2440; font-family: inherit; resize: vertical;
}
.life-note-save, .life-guest-save, .life-wish-save {
  margin-top: 8px; padding: 8px 14px; font-size: 12px; background: #ffcf6b; color: #2a1c0c;
  border: 3px solid #0b0813; box-shadow: inset -3px -3px #c99a41, inset 3px 3px #ffe7a8; cursor: pointer;
}
.life-note-ok, .life-wish-ok { margin-left: 10px; font-size: 11px; color: #7ee0a0; }

/* 本子：纸质感 */
.life-book-body { padding: 14px; }
.life-paper {
  min-height: 300px; padding: 20px 22px; background: #f3e9d2; color: #3a2b22;
  border: 3px solid #c9b79a;
  background-image: repeating-linear-gradient(#f3e9d2 0 27px, #e2d6bd 27px 28px);
  line-height: 28px;
}
.life-paper-head { font-size: 15px; color: #8a5a3a; margin-bottom: 10px; letter-spacing: 2px; }
.life-letter p { font-size: 12.5px; line-height: 28px; margin: 0 0 4px; }
.life-letter p.life-sign { text-align: right; margin-top: 12px; color: #6b5540; }
.life-guest-list { max-height: 180px; overflow-y: auto; margin-bottom: 10px; }
.life-guest-item { border-bottom: 1px dashed #cdbfa6; padding: 6px 0; }
.life-guest-txt { font-size: 12px; color: #4a3a2c; line-height: 22px; }
.life-guest-time { font-size: 10px; color: #9a8870; }
.life-guest-write { display: flex; gap: 8px; align-items: flex-start; }
.life-guest-write .life-guest-input {
  color: #3a2b22; background: #fffdf6; border: 2px solid #cdbfa6; flex: 1;
}
.life-guest-save {
  color: #fff2e2; background: #c85a5a; border: 2px solid #8a3a3a;
  box-shadow: inset -2px -2px #a34a4a, inset 2px 2px #e07a6a;
}
.life-book-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.life-prev, .life-next {
  padding: 8px 12px; font-size: 12px; background: #33274a; color: #f7e7cf;
  border: 3px solid #0b0813; cursor: pointer;
}
.life-page-dots { display: flex; gap: 6px; }
.life-page-dots i { width: 8px; height: 8px; background: #3a2c52; display: block; }
.life-page-dots i.on { background: #ffcf6b; }

.life-book-sheet .life-hint { color: #8a7358; }

.life-egg-text { font-size: 13px; line-height: 2; color: #f0e2cc; padding: 6px 0; }

@media (max-width: 420px) {
  .life-photo-grid { grid-template-columns: repeat(3, 1fr); }
  .life-paper { padding: 14px 16px; min-height: 260px; }
  .life-paper, .life-letter p { line-height: 26px; }
}

/* 自己造的说话浮层（不复用原站 .bubble） */
.life-say {
  position: relative; pointer-events: none;
  max-width: min(560px, 84vw); padding: 16px 22px;
  background: var(--cream, #f7e7cf); color: #2b2140;
  border: 4px solid var(--shadow, #0b0813);
  box-shadow: 4px 4px #0b081399;
  font-size: 15px; line-height: 1.85; text-align: center;
  transform-origin: 50% 100%;
  animation: lifeSayIn .46s cubic-bezier(.2, .76, .24, 1) both;
}

/* ---------- 字幕出现 / 换话的丝滑动效（2026-11-20） ---------- */
/* 出现：从下往上轻轻浮起来 + 淡入 + 微微放大，末尾收一下就不动，不硬跳 */
@keyframes lifeSayIn {
  0%   { opacity: 0; transform: translate3d(0, 15px, 0) scale(.962); }
  60%  { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.004); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
/* 换字：位置不挪，只让文字柔和地淡进来 */
@keyframes lifeSaySwap {
  0%   { opacity: .4; transform: translate3d(0, 5px, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 气泡从底部箭头那儿长出来，动画只在合成层跑，手机上不掉帧 */
.bubble-layer .bubble {
  /* 原站自带 pop .22s steps(3) 三帧硬跳；统一交给 life.js 的 lifeSayIn，
     不写 !important，行内动画照常覆盖它 */
  animation-name: none;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .bubble-layer .bubble, .life-say { animation-duration: .01s !important; }
}
.life-say:after {
  content: ""; position: absolute; left: 50%; bottom: -14px; margin-left: -7px;
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 10px solid var(--cream, #f7e7cf);
  filter: drop-shadow(0 4px 0 var(--shadow, #0b0813));
}

/* ---------- 手机端上下入口 ---------- */
.life-hud {
  position: fixed; top: 10px; right: 10px; z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  padding: 7px 10px; cursor: pointer;
  background: #1c1529ee; border: 3px solid #0b0813;
  box-shadow: inset -3px -3px #241b35, inset 3px 3px #3a2c52;
  font-family: inherit;
}
.life-hud-t { font-size: 14px; color: #ffcf6b; letter-spacing: 1px; line-height: 1.2; }
.life-hud-d { font-size: 9px; color: #cbb9a5; line-height: 1.3; }
.life-hud-w { font-size: 9px; color: #8f8199; line-height: 1.3; }

.life-menu { display: flex; flex-direction: column; gap: 8px; }
.life-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; background: #1c1529; color: #f7e7cf;
  border: 3px solid #0b0813; box-shadow: inset -3px -3px #241b35, inset 3px 3px #3a2c52;
  cursor: pointer; font-family: inherit;
}
.life-menu-item:hover { background: #2a2040; }
.life-menu-ico { font-size: 20px; line-height: 1; }
.life-menu-txt { display: flex; flex-direction: column; gap: 2px; }
.life-menu-txt b { font-size: 13px; font-weight: normal; color: #ffe9c9; }
.life-menu-txt i { font-size: 10px; font-style: normal; color: #8f8199; }

/* ---------- 地毯下的小纸条 · 抽屉便利贴（2026-11-19） ---------- */
.life-rug-paper { pointer-events: none; }
.life-rug-paper .life-rug-pad { pointer-events: all; }
.life-rug-pad { cursor: pointer; }

.life-quote {
  margin: 10px 0 8px; padding: 12px 16px;
  background: #f7e7cf; color: #3a2b1f;
  border: 3px solid #0b0813; box-shadow: 4px 4px #0b081399;
  font-size: 14px; line-height: 1.95; text-align: left;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: .5px;
}
.life-day-tag {
  display: inline-block; margin-top: 2px;
  font-size: 10px; letter-spacing: 1px; color: #8f8199;
}
.life-bless {
  margin-top: 14px; padding: 14px 16px 16px;
  background: linear-gradient(180deg, #2a2040, #1c1529);
  border: 3px solid #0b0813;
  box-shadow: inset -3px -3px #241b35, inset 3px 3px #3a2c52;
  text-align: center;
}
.life-bless-head {
  font-size: 11px; letter-spacing: 2px; color: #ffcf6b; opacity: .85;
}
.life-bless .life-day-tag { margin: 6px 0 8px; }
.life-bless-text {
  font-size: 15px; line-height: 1.95; color: #ffe9c9;
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: .6px;
}
