/* 喵屋 · 极简样式
   白底、黑字、一条灰线。不做卡片、渐变、光晕。 */

:root {
  --bg: #ffffff;
  --soft: #f5f5f3;
  --line: #ececea;
  --line-soft: #f5f5f3;
  --text: #121212;
  --muted: #9c9c9a;
  --faint: #c6c6c3;

  /* 主色：发送键 / 主按钮 / 开关 / 选中态 */
  --accent: #121212;
  --on-accent: #ffffff;
  /* 快捷按钮文字 */
  --act-text: #4a4a48;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* 绿白：微信那套 */
:root[data-theme='green'] {
  --bg: #ffffff;
  --soft: #f2f5f2;
  --line: #e8ebe8;
  --line-soft: #f2f5f2;
  --text: #131713;
  --muted: #8d948f;
  --faint: #c3c9c4;

  --accent: #07c160;
  --on-accent: #ffffff;
  --act-text: #3d4640;
}

/* 粉色：卡通一点 */
:root[data-theme='pink'] {
  --bg: #fffcfd;
  --soft: #fdeef4;
  --line: #f8e3ec;
  --line-soft: #fdf2f7;
  --text: #241a1e;
  --muted: #ab8b97;
  --faint: #dcc0ca;

  --accent: #ff6f9c;
  --on-accent: #ffffff;
  --act-text: #5a3a45;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', system-ui, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  border: 0;
  outline: none;
  background: none;
}

.app {
  height: 100%;
}

/* 主题切换的过渡，短一点，不要花哨 */
body,
.tabbar,
.head,
.btn-primary,
.sw,
.row {
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

/* ---------- 骨架 ---------- */

.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 底部页签 ---------- */

.tabbar {
  flex: none;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding-bottom: var(--safe-b);
}

.tab {
  position: relative;
  flex: 1;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--faint);
}

.tab.on {
  color: var(--accent);
}

.tab-ico .ico {
  width: 21px;
  height: 21px;
  display: block;
}

.tab-label {
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ---------- 页头 ---------- */

.head {
  flex: none;
  height: 50px;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.head .back,
.head .add {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--text);
  margin-left: -8px;
}

.head .add {
  margin: 0 -8px 0 0;
}

.head svg {
  width: 21px;
  height: 21px;
}

.head-pad {
  width: 34px;
}

/* ---------- 猫猫 ---------- */

/* 猫猫币：页头右上角，一枚图案跟一个数字 */
.coins {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.coins img {
  width: 24px;
  height: 24px;
  display: block;
}

.coins b {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 主人那端这枚币是个按钮（点开看账本）：把按钮的默认框子去掉，
   只留图案和数字；按下时数字淡一下，表示收到了这一下 */
button.coins {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.coins:active b {
  opacity: 0.55;
}

/* ---------- 猫猫 · 定位（只有主人那端有） ---------- */

/* 页头下面一行，点开是日历。刻意只写「定位」两个字 */

/* ---------- 猫猫页：一间屋子 ---------- */

/* 房间是一个「一点透视的盒子」：正墙是一块居中的矩形，左右墙和天花板、
   地板都是往它收窄的梯形。之前只有一个折角线，看着像墙上贴了块板。
   五个面靠 clip-path 拼，接缝没有重叠也没有缝。

   四面按明度从暗到亮：天花板 → 左墙 → 右墙 → 正墙，地板单独用木色。
   2026-11-28 之前四面全是 #f4~#fd 的近白，屏幕上分不出墙和地。 */
.cat-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 猫猫这台手机上：屋子连人一起铺满整屏。页头不再占一条白带子，
   只剩右上角那枚猫猫币浮在画面上（标题不显示）。 */
.page.cat-pet .head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 44px;
  justify-content: flex-end;
  border-bottom: 0;
  background: none;
  pointer-events: none;
}

.page.cat-pet .head h1 {
  display: none;
}

.page.cat-pet .head .coins {
  pointer-events: auto;
}

/* 主人这台手机上：页头下面先一行「定位」，再往下才是整块画面 */
.page.cat-master .head {
  border-bottom: 0;
}

.page.cat-master .loc-row {
  margin: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* ---------- 猫屋还锁着 ---------- */

/* 没解锁时整块是屋墙的颜色，什么都不画；问话的那张纸就浮在中间 */
.page.cat-lock {
  background: #f5f0e4;
}

.housegate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0 26px;
  opacity: 0;
  transition: opacity 0.16s ease-out;
}

.housegate[hidden] {
  display: none;
}

.housegate.on {
  opacity: 1;
}

.gate-card {
  width: 100%;
  max-width: 268px;
  padding: 0;
  text-align: center;
  background: #fffdf7;
  border: 1px solid #ded3ba;
  border-radius: 14px;
}

/* 弹窗里那行图：猫屋 → 币 + 张数（2026-11-29 去掉了文字） */
.gate-deal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 21px;
}

.gate-deal .gate-ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}

.gate-deal .gate-ico svg {
  width: 34px;
  height: 34px;
  display: block;
}

.gate-deal .gate-price {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gate-deal .gate-price img {
  width: 24px;
  height: 24px;
  display: block;
}

.gate-deal .gate-price b {
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 奖励那张纸：左边一枚币，右边那个数字两边各一个小按 —— 数字是唯一能按的东西 */
.gate-deal .pay-ico img {
  width: 34px;
  height: 34px;
  display: block;
}

.gate-step {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.gate-step .step-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
  color: #6f6555;
  border-radius: 9px;
}

.gate-step .step-btn:active {
  background: #f7f1e3;
}

.gate-step .step-btn[disabled] {
  color: #d8cfbc;
}

.gate-step b {
  min-width: 34px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 猫猫那端收到奖励时那个数：比礼物盒上的「2」大一号，因为它就是这张纸的全部内容 */
.rew-price b {
  font-size: 21px;
}

.gate-acts {
  display: flex;
  border-top: 1px solid #ece2cc;
}

.gate-btn {
  flex: 1;
  height: 47px;
  font-size: 15px;
  color: #8f887a;
}

.gate-btn + .gate-btn {
  border-left: 1px solid #ece2cc;
  color: #332d26;
  font-weight: 600;
}

.gate-btn:active {
  background: #f7f1e3;
}

/* 收起来之后挂在右边的那块「猫屋」小牌子（用户 2026-11-29 定的第三版：只放小屋子） */
.gate-dot {
  position: absolute;
  right: 12px;
  top: 34%;   /* 中间偏上：2026-11-29 用户定的位置，别再压回垂直正中 */
  z-index: 2;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #fffdf7;
  border: 1px solid #ded3ba;
  border-radius: 14px;
  transition: transform 0.12s ease-out;
}

.gate-dot[hidden] {
  display: none;
}

.gate-dot svg,
.gate-dot img {
  width: 26px;
  height: 26px;
  display: block;
}

/* 奖励收起来之后挂在右上角：猫猫端的页头只有一枚币，别压到它上面 */
.gate-dot.rew-dot {
  top: 56px;
}

.gate-dot:active {
  transform: scale(0.94);
}

/* 解锁完屋子刷出来：淡一下，别硬切 */
.page.cat-pet:not(.cat-lock) .cat-scroll {
  animation: roomIn 0.28s ease-out both;
}

@keyframes roomIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.room {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--wall);
  --ceil: #dfdcd3;
  --wall: #f5f0e4;
  --side: #ebe3d4;
  --floor: #e4d3b4;
  --plank: #d9c49d;
  --skirt: #fffdf7;
  --ink: #b2a791;
  --frame: #9d9581;
  --glass: #dceaf6;
  --moon: transparent;
}

.room[data-time='dusk'] {
  --ceil: #ded9ce;
  --wall: #f4eddf;
  --side: #eae0cd;
  --floor: #e3ceac;
  --plank: #d6bd92;
  --skirt: #fdf8ec;
  --ink: #b0a58d;
  --frame: #9a927d;
  --glass: #f6d7a6;
}

.room[data-time='night'] {
  --ceil: #d3d6de;
  --wall: #e9eaef;
  --side: #dcdee6;
  --floor: #cfd0d8;
  --plank: #bfc1ca;
  --skirt: #f2f3f7;
  --ink: #a6aab6;
  --frame: #969aa7;
  --glass: #2b323e;
  --moon: #d9dde6;
}

.room-ceil,
.room-side,
.room-floor,
.room-back {
  position: absolute;
  transition: background-color 0.9s ease, border-color 0.9s ease;
}

/* 天花板：前边贴着屏幕顶（最宽），后边收到正墙的上沿 */
.room-ceil {
  inset: 0;
  background: var(--ceil);
  clip-path: polygon(0 0, 100% 0, 100% 12%, 30% 12%);
}

/* 只留左边的侧墙。右边那道 2026-11-28 删了：左右对称的盒子看着像衣柜，
   右侧敞开、正墙一直延伸到画面外，屋子才显得有余量。
   近端比远端高，这个梯形就是全部的进深信息。 */
.room-side {
  inset: 0;
  background: var(--side);
  clip-path: polygon(0 0, 30% 12%, 30% 57%, 0 82%);
}

/* 正墙：从侧墙折角一直铺到画面外。右边不画边框，否则又成了盒子 */
.room-back {
  left: 30%;
  right: 0;
  top: 12%;
  bottom: 43%;
  border: 1.5px solid var(--ink);
  border-right: none;
  background: var(--wall);
}

/* 踢脚线：压在正墙下沿的一道白边。只做正墙这条，
   侧墙那条是斜的，画上去反而显脏 */
.room-back::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: var(--skirt);
  border-top: 1.5px solid var(--ink);
}

/* 地板：木色 + 横向板缝，间距往下越来越大（近大远小），
   不然和墙面一样平的条纹，读不出「躺在地上」 */
.room-floor {
  left: 0;
  right: 0;
  top: 57%;
  bottom: 0;
  background: var(--floor);
  background-image: linear-gradient(
    to bottom,
    transparent 0 7%,
    var(--plank) 7% calc(7% + 1.5px),
    transparent calc(7% + 1.5px) 16%,
    var(--plank) 16% calc(16% + 1.5px),
    transparent calc(16% + 1.5px) 27%,
    var(--plank) 27% calc(27% + 1.5px),
    transparent calc(27% + 1.5px) 40%,
    var(--plank) 40% calc(40% + 1.5px),
    transparent calc(40% + 1.5px) 56%,
    var(--plank) 56% calc(56% + 1.5px),
    transparent calc(56% + 1.5px) 75%,
    var(--plank) 75% calc(75% + 1.5px),
    transparent calc(75% + 1.5px)
  );
  /* 后边窄、前边宽：地板也是往后收的梯形，跟两侧墙脚线接上 */
  clip-path: polygon(0 100%, 0 58%, 30% 0, 100% 0, 100% 100%);
}

/* 侧墙和天花板、地板的交线。这两条是斜的，用百分比坐标写死角度会因为
   房间宽高比变化而错位，所以交给一个 viewBox 0..100 的 svg 拉伸 ——
   non-scaling-stroke 让线宽不跟着拉伸变形。没有这四条线，天花板像一块
   悬空的板子，墙脚也收不住。 */
.room-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room-lines path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.9s ease;
}

/* 侧墙踢脚线的白底。它画在交线下面一层，交线再压上去就是「上沿一道线」 */
.room-lines .skirt {
  fill: var(--skirt);
  stroke: none;
  transition: fill 0.9s ease;
}

/* 窗开在左墙上。左墙是往后收的，所以窗也得跟着斜 ——
   只转 rotateY 不够，还要有透视，不然就是墙上贴了一张正对镜头的纸。
   origin 在左边：左边离镜头近、右边离得远，右边缘因此会缩进去一点。 */
.win {
  position: absolute;
  left: 4%;
  top: 21%;
  width: 24%;
  height: 30%;
  /* 玻璃不是一块平色：上边靠天光、下边落在墙的暗部，给一道纵向渐变，
     再叠一层窗洞里侧的暗边（inset），窗才像凹进墙里而不是贴了张纸 */
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.34), rgba(120, 96, 64, 0.10)),
    var(--glass);
  border: 3px solid var(--frame);
  box-shadow:
    inset 0 0 0 5px rgba(72, 58, 40, 0.07),
    3px 4px 0 -1px rgba(96, 78, 52, 0.10);
  transform: perspective(420px) rotateY(37deg);
  transform-origin: left center;
  transition: background-color 0.9s ease, border-color 0.9s ease;
}

.win i {
  position: absolute;
  display: block;
  background: var(--frame);
  transition: background-color 0.9s ease;
}

.win .mv {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
}

.win .mh {
  top: 42%;
  left: 0;
  right: 0;
  height: 1.5px;
}

.win::after {
  content: '';
  position: absolute;
  left: -6%;
  right: -3%;
  bottom: -7px;
  height: 6px;
  border-top: 1.5px solid rgba(72, 58, 40, 0.22);
  background: var(--frame);
  box-shadow: 0 3px 4px -1px rgba(96, 78, 52, 0.16);
  /* 别再给窗台单独 rotate：一转就和窗框底边裂开一条楔形缝。
     改成上沿贴住窗框、下沿用 clip-path 做「近端厚、远端薄」，
     这才是斜墙上那块板的正确读法。 */
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%);
  transition: background-color 0.9s ease;
}

.win .moon {
  right: 15%;
  top: 13%;
  width: 33%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--moon);
}

/* 靠正墙的家具：一只两门衣橱、一只两抽矮柜，柜上方的墙面挂两排空搁板。
   两件都坐在墙脚线上 —— bottom: 43% 就是正墙下沿（地板从 57% 开始）；
   底边一条硬阴影 + 一圈落地软投影，缺了这两样柜子就是贴在墙上的一张纸。

   家具在 .room 里面（z-index 0），人在 .pet-wrap（z-index 1），所以衣橱左边一角
   会被人挡住 —— 人坐得比柜子近，这是对的，不用给家具提层。

   搁板一律空着，专门留给以后养成的小玩意儿。放东西前先看尺寸是否够看：
   屏幕 390 宽时搁板净宽约 150px、两层间距约 60px，一个物件做到 18~24px
   在手机上才看得清，小于 14px 就糊成一点。柜面同理（台面宽约 140px）。
   改大小只动下面的百分比，底边始终是 bottom: 43%。 */
.furn {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 木色跟矮桌同一套，比地板深一档；换时段在这里整片改，别在下面各处写死 */
  --wd-hi: #e2cea7;
  --wd-lo: #d2b98f;
  --door-hi: #ecdab6;
  --door-lo: #ddc79d;
  --plinth: #c6ad7b;
  --hold-hi: #e8d4ab;
  --hold-lo: #d6bc8e;
  --sh-hi: #ddc59a;
  --sh-lo: #cdb07f;
  --knob: #8b7a5b;
  --edge-soft: rgba(140, 120, 88, 0.42);
  --hard: rgba(150, 132, 100, 0.45);
  --drop: rgba(108, 90, 62, 0.42);
}

.room[data-time='dusk'] .furn {
  --wd-hi: #ddc69d;
  --wd-lo: #cdb07e;
  --door-hi: #e7d3ac;
  --door-lo: #d8c094;
  --plinth: #c1a672;
  --hold-hi: #e3cfa4;
  --hold-lo: #d1b787;
  --sh-hi: #d8c093;
  --sh-lo: #c8aa78;
  --hard: rgba(146, 128, 96, 0.45);
  --drop: rgba(104, 86, 58, 0.42);
}

.room[data-time='night'] .furn {
  --wd-hi: #c6c8d2;
  --wd-lo: #b6b9c4;
  --door-hi: #d0d2dc;
  --door-lo: #c0c3ce;
  --plinth: #adb1bd;
  --hold-hi: #cacdd7;
  --hold-lo: #bbc0cb;
  --sh-hi: #c2c5d0;
  --sh-lo: #b3b8c4;
  --knob: #7c8290;
  --edge-soft: rgba(124, 130, 146, 0.42);
  --hard: rgba(140, 146, 160, 0.4);
  --drop: rgba(96, 102, 118, 0.38);
}

/* ---------------- 衣橱 ---------------- */

/* 衣橱：两扇门。右沿钉在 57%（矮柜左沿 60%，中间留 3% ≈ 12px 缝）。
   宽度 21.5%（390 屏 ≈ 84px，高 214，2.6:1）—— 2026-11-29 晚用户说「搞宽一些，往左变宽」，
   从 17.5% 加到这里；早先 14% 时 3.9:1，瘦得像一只高脚药柜。**加宽只往左长，右沿不动**，
   否则它和矮柜的那道缝会被挤没。左沿 35.5%，离正墙折角（30%）还有 5%。 */
.furn .ward {
  position: absolute;
  left: 35.5%;
  top: 30%;
  bottom: 43%;
  width: 21.5%;
  box-sizing: border-box;
  background: linear-gradient(to bottom, var(--wd-hi), var(--wd-lo));
  border: 1.5px solid var(--ink);
  box-shadow:
    0 2px 0 var(--hard),
    0 9px 14px -7px var(--drop);
  transition: background 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

/* 两扇门：各自一圈细边 + 内侧一圈高光，像真柜门上那道凹槽 */
.furn .ward i {
  position: absolute;
  top: 3%;
  bottom: 5%;
  width: 44.5%;
  background: linear-gradient(165deg, var(--door-hi), var(--door-lo));
  border: 1px solid var(--edge-soft);
  box-shadow: inset 0 0 0 3px rgba(255, 253, 245, 0.35);
  transition: background 0.9s ease, border-color 0.9s ease;
}

.furn .ward i.d1 {
  left: 2.5%;
}

.furn .ward i.d2 {
  right: 2.5%;
}

/* 两个小圆把手，贴在中缝两侧 */
.furn .ward b {
  position: absolute;
  top: 46%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--knob);
  transition: background-color 0.9s ease;
}

.furn .ward b.k1 {
  left: calc(50% - 8px);
}

.furn .ward b.k2 {
  left: calc(50% + 5px);
}

/* 底下一道踢脚 */
.furn .ward u {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4%;
  min-height: 5px;
  background: var(--plinth);
  border-top: 1px solid var(--edge-soft);
  transition: background-color 0.9s ease;
}

/* ---------------- 矮柜（上顶板、下两层横抽屉） ---------------- */

/* 矮柜：中轴必须压在两排搁板的中轴上（搁板 left:58% right:3% → 中轴 77.5%，
   柜宽 35% → left 只能取 60%）。2026-11-29 晚用户点名「把抽屉跟上面两个置物架对齐」，
   所以这里是 60% 不是原来的 58%；改柜宽要连 left 一起算回来，否则中轴立刻歪掉。
   右沿 95%，离画面右边 5%（19px），顶板外挑 4px 也还在画面里。 */
.furn .cab {
  position: absolute;
  left: 60%;
  top: 45%;
  bottom: 43%;
  width: 35%;
  box-sizing: border-box;
  background: linear-gradient(to bottom, var(--wd-hi), var(--wd-lo));
  border: 1.5px solid var(--ink);
  box-shadow:
    0 2px 0 var(--hard),
    0 10px 15px -7px var(--drop);
  transition: background 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

/* 顶板比柜体宽出一点，才看得出台面是一块板 */
.furn .cab .top {
  position: absolute;
  left: -4px;
  right: -4px;
  top: -5px;
  height: 6px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, var(--hold-hi), var(--hold-lo));
  border: 1.5px solid var(--ink);
  transition: background 0.9s ease, border-color 0.9s ease;
}

.furn .cab .dr {
  position: absolute;
  inset: 0;
}

/* 两层横抽屉（上下各一）：390 屏上柜体 136×95，每层约 39px 高、宽 133px，
   宽高比 3.4:1，读作抽屉而不是两扇门。早先是左右并排两块 45%，
   门面 60×74 太方，加长横把手后整柜像双门柜 —— 用户 2026-11-29 点名要改。 */
.furn .cab .dr i {
  position: absolute;
  left: 3.5%;
  right: 3.5%;
  height: 41%;
  box-sizing: border-box;
  background: linear-gradient(165deg, var(--door-hi), var(--door-lo));
  border: 1px solid var(--edge-soft);
  transition: background 0.9s ease, border-color 0.9s ease;
}

.furn .cab .dr i:nth-child(1) {
  top: 7%;
}

.furn .cab .dr i:nth-child(2) {
  bottom: 7%;
}

/* 抽屉上的横把手 */
.furn .cab .dr i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  margin: -1px 0 0 -9px;
  border-radius: 1px;
  background: var(--knob);
  transition: background-color 0.9s ease;
}

/* ---------------- 墙上的工具箱（装扮页的入口） ---------------- */

/* 位置被上下一夹就没了余地：上要让开第二排搁板（35%）和它的托架，
   下要让开矮柜顶板（45%，那块板还往上挑了 5px），所以只能占 39.4%~44% 这一条。
   左右 2026-11-30 19:10 用户点名「左边移到跟抽屉左边平齐」—— 矮柜 left 60%，
   所以这里 left 也是 60%（跟柜体左沿同一条竖线），宽 15% 不动。
   4.6% 高（390 屏约 36px）配 15% 宽（约 58px）是 1.6:1，读作工具箱，
   再矮一点就像墙上贴了块板，再高一点就顶到柜面。 */
.furn .toolbox {
  position: absolute;
  left: 60%;
  width: 15%;
  top: 39.4%;
  height: 4.6%;
  box-sizing: border-box;
  background: linear-gradient(to bottom, var(--wd-hi), var(--wd-lo));
  border: 1.5px solid var(--ink);
  border-radius: 2.5px;
  box-shadow:
    0 2px 0 var(--hard),
    0 6px 10px -6px var(--drop);
  transition: background 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

/* 提手：一道门字形的铁线，坐在箱盖上沿外面。
   这个小方块能一眼读成「工具箱」全靠它 —— 去掉就是个木头盒子。 */
.furn .toolbox::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  width: 34%;
  height: 8px;
  margin-left: -17%;
  box-sizing: border-box;
  border: 1.5px solid var(--knob);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  transition: border-color 0.9s ease;
}

/* 盖缝：箱盖和箱体之间那道横线 */
.furn .toolbox::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  top: 30%;
  height: 1px;
  background: var(--edge-soft);
  transition: background-color 0.9s ease;
}

/* 搭扣：盖缝正中那一小块铁片 */
.furn .toolbox i {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 9px;
  height: 8px;
  margin-left: -4.5px;
  box-sizing: border-box;
  background: var(--door-hi);
  border: 1px solid var(--knob);
  border-radius: 1px;
  transition: background-color 0.9s ease, border-color 0.9s ease;
}

/* ---------------- 墙上的两排搁板（现在空着，留给以后的小玩意儿） ---------------- */

.furn .hold {
  position: absolute;
  left: 58%;
  right: 3%;
  height: 6px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, var(--hold-hi), var(--hold-lo));
  border: 1.5px solid var(--ink);
  box-shadow: 0 4px 6px -3px var(--drop);
  transition: background 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease;
}

/* 两道托架：托架下面是墙，所以只给很短一小截 */
.furn .hold::before,
.furn .hold::after {
  content: '';
  position: absolute;
  top: 100%;
  width: 2.5px;
  height: 9px;
  background: var(--edge-soft);
  transition: background-color 0.9s ease;
}

.furn .hold::before {
  left: 5%;
}

.furn .hold::after {
  right: 5%;
}

.furn .hold.h1 {
  top: 27.5%;
}

.furn .hold.h2 {
  top: 35%;
}

/* ---------------- 搁板上的格子（摆上去的东西） ---------------- */

/* 每排三等分（SLOTS 的 t0..t2 / b0..b2）。**平常没有框**，只有东西坐在这儿：
   底边贴在搁板上表面（bottom:100% 就是那块 6px 板子的顶）。
   高 42px：层间净空 53px，留 11px 顶隙 —— 46px 时猫头几乎顶到上层板，
   看着像塞满的柜子而不是摆件（2026-11-29 第一版就是这个毛病）。
   宽 42×0.71 ≈ 30px，在 50px 宽的格子里左右各留 10px，不大不小刚好占住一格。 */
.furn .hold {
  display: flex;
}

.furn .slot {
  position: relative;
  flex: 1 1 0;
}

.furn .slot .deco {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  height: 42px;
  width: auto;
  display: block;
  /* 第一层是「一道线」：用 0 位移的 drop-shadow 沿轮廓描一圈浅褐，
     猫才不会在暖米色墙上糊成一团白（屋子里的每件东西都有一道线，它也得有）。 */
  filter: drop-shadow(0 0 0.5px rgba(148, 124, 92, 0.55)) drop-shadow(0 2px 1.5px rgba(120, 98, 66, 0.3));
}

/* 矮柜是抽屉的入口、衣橱是换衣服的入口、工具箱是装扮屋子的入口。
   三个都只在猫猫端能点（主人端的东西在猫猫手机里，它只跟着穿、跟着看） */
.page.cat-pet .furn .cab,
.page.cat-pet .furn .ward,
.page.cat-pet .furn .toolbox {
  pointer-events: auto;
  cursor: pointer;
}

/* 抽屉页：八格物品栏 + 墙上那两排搁板 ----------------
   配色照屋子来（米白纸 + 木色板），不跟主题走 —— 它是屋子的一部分，
   切成绿白/粉色主题时这一页也不该变成别的颜色。
   **预览里的比例必须和屋里一模一样**：屋里格宽 49.7、物件 42 高（板顶到板顶 59），
   这一页格宽 ≈ 118，所以物件 100 高、板厚 8、层距 140。改一边就要连另一边算回来，
   否则「页面里看着合适、摆进屋子变样」。 */

.cat-drawer {
  background: #faf5e9;
}

/* 装扮页：左边一列分类、右边是那一类里的东西（2026-11-29 20:20 用户定）。
   分类是「上衣 / 下衣 / 鞋子 / 整身 / 头饰 / 脖饰 / 耳朵 / 头发」八行，
   竖排在最左边，右边那一片只装这一类的东西 —— 没有分段、没有标题、没有横线。
   左边那一列是**文字**（这八类没有能一眼认出来的图形），右边全是图，
   所以这一页只有左列有字，字要小、要压灰，选中的那一条才亮起来并压一道木色竖线。 */
.cat-look {
  background: #faf5e9;
}

.look-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.look-rail {
  flex: none;
  width: 74px;
  display: flex;
  flex-direction: column;
  padding: 2px 0 calc(18px + var(--safe-b));
  border-right: 1px solid #e8dcc4;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.look-tab {
  flex: none;
  margin: 0;
  padding: 11px 4px;
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #9d9585;
  background: none;
  border: 0;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 2px 0 0 transparent;
}

/* 正在看的那一类 */
.look-tab.on {
  color: #4a4237;
  font-weight: 600;
  box-shadow: inset 2px 0 0 #b9a684;
}

.look-pane {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 右边两列：立绘是 320×546 的整身，压太窄就只剩一团衣服看不出样子；
   纸卡片、木色描边跟抽屉页同一套语言，正在穿的那件 = 描边压深 + 纸色变白。 */
.looks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 6px 12px calc(24px + var(--safe-b));
}

/* 格子固定成竖版、图按 contain 缩放：平铺陈列图（320×591）和底身（320×546）
   比例不一样，不固定高度两张卡片就会一高一矮。 */
.look-cell {
  display: block;
  margin: 0;
  padding: 4px;
  aspect-ratio: 3 / 5;
  border: 1px solid #e4dac4;
  border-radius: 12px;
  background: #fdf9ee;
  cursor: pointer;
}

.look-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.look-cell.on {
  border-color: #9a8a72;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #9a8a72;
}

/* 「不穿」那一格 2026-11-29 22:45 起也摆一张平铺图（白内衣 + 白内裤，
   img/look-bare.png），跟其余格同一个样子 —— 用户：「画面布局跟那个
   T 恤牛仔裤鞋子一个样」。所以这里不再有虚线框和斜杠，`.off` 只作语义标记。 */

/* 这一类还没有东西：什么都不画，留白就够（别放「暂无」那种字，这一页不写字） */
.look-empty {
  display: block;
}

/* ---------------- 工具箱那一页（装扮屋子） ---------------- */

/* 右边同样是两列 + 纸卡片，但**格子是方的**：衣橱那页装的是整身立绘（3:5 竖版），
   这一页装的是家具，方格子才摆得下横着的矮桌也摆得下竖着的衣橱。
   内边距留 10px，图不贴边；一张卡片 = 一件东西，描边压深 = 正在用。 */
.tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 6px 12px calc(24px + var(--safe-b));
}

.tool-cell {
  display: block;
  position: relative;
  margin: 0;
  padding: 10px;
  aspect-ratio: 1 / 1;
  border: 1px solid #e4dac4;
  border-radius: 12px;
  background: #fdf9ee;
  cursor: pointer;
}

.tw-thumb {
  display: block;
  width: 100%;
  height: 100%;
}

.tool-cell.on {
  border-color: #9a8a72;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #9a8a72;
}

/* 没解锁的那几格：右下角一枚小锁 + 币 + 1（用户 2026-11-30 20:05 定的样子）。
   底下一小块纸色垫着，压在家具图上也不糊；锁和币都 11px，跟数字同一行。
   整块不吃点击 —— 点哪儿都算点这一格，弹窗由格子自己开。 */
.tool-lock {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 3px;
  border-radius: 6px;
  background: #fdf9ee;
  color: #8f887a;
  pointer-events: none;
}

.tool-lock svg {
  display: block;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-lock img {
  display: block;
  width: 12px;
  height: 12px;
}

.tool-lock b {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* 解锁那张纸左边摆的是「待解锁的那件东西」，比默认的 40px 图标大一号：
   衣柜竖着、地板横着，34px 里认不出是什么（衣柜只剩 13px 宽）。
   76×64 的框 + meet：衣柜 64 高（约 28 宽）、地板 76 宽，两样都还认得出。 */
.gate-deal .gate-ico.lock-ico {
  width: 76px;
  height: 64px;
}

.gate-deal .gate-ico.lock-ico svg {
  width: 76px;
  height: 64px;
}

/* 缩略图的配色就是屋子那套（`.room` / `.desk` 的变量这一页继承不到，照抄一份：
   木色分三档 —— 柜体最暗、门板亮一档、顶板再亮一点，跟真柜子一样有层次）。
   线统一 1.2 + 非缩放描边，缩到 60px 宽也不糊。 */
.cat-tool {
  --tw-floor: #e4d3b4;
  --tw-plank: #d9c49d;
  --tw-skirt: #fffdf7;
  --tw-wood: #e2cea7;
  --tw-door: #ecdab6;
  --tw-plinth: #c6ad7b;
  --tw-knob: #8b7a5b;
  --tw-ink: #b2a791;
  --tw-edge: rgba(140, 120, 88, 0.42);
  --tw-desk-top: #e3cda4;
  --tw-desk-edge: #d3b787;
  --tw-desk-panel: #cbae7d;
  --tw-desk-leg: #c3a473;
}

.tw-thumb rect,
.tw-thumb polygon,
.tw-thumb circle,
.tw-thumb line {
  stroke: var(--tw-ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* 地板：木色 + 三道横缝（间距往下越来越大）+ 顶上一道白踢脚 */
.tw-thumb .tw-floor {
  fill: var(--tw-floor);
}

.tw-thumb .tw-plank {
  stroke: var(--tw-plank);
}

.tw-thumb .tw-skirt {
  fill: var(--tw-skirt);
}

/* 衣橱 / 矮柜：木体、门板、顶板、踢脚、把手 */
.tw-thumb .tw-wood {
  fill: var(--tw-wood);
}

.tw-thumb .tw-door,
.tw-thumb .tw-drawer {
  fill: var(--tw-door);
  stroke: var(--tw-edge);
}

.tw-thumb .tw-top {
  fill: var(--tw-door);
}

.tw-thumb .tw-plinth {
  fill: var(--tw-plinth);
  stroke: none;
}

.tw-thumb .tw-knob,
.tw-thumb .tw-handle {
  fill: var(--tw-knob);
  stroke: none;
}

/* 置物架的托架：屋里那两道是 edge-soft 的一小截，不描边 */
.tw-thumb .tw-bracket {
  fill: var(--tw-edge);
  stroke: none;
}

/* 工具箱：盖缝一道细线、提手是描出来的铁线、搭扣是木色小铁片 */
.tw-thumb .tw-seam {
  stroke: var(--tw-edge);
}

.tw-thumb .tw-bar {
  fill: none;
  stroke: var(--tw-knob);
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.tw-thumb .tw-clasp {
  fill: var(--tw-door);
  stroke: var(--tw-knob);
}

.tw-thumb .tw-outline {
  fill: none;
}

/* 矮桌：点跟 room 里那张 svg 一模一样，只是把变量名换成本页这套 */
.tw-thumb .tw-dtop {
  fill: var(--tw-desk-top);
}

.tw-thumb .tw-dedge {
  fill: var(--tw-desk-edge);
}

.tw-thumb .tw-dpanel {
  fill: var(--tw-desk-panel);
}

.tw-thumb .tw-dleg {
  fill: var(--tw-desk-leg);
}

/* 只有返回箭头、没有标题的页头（抽屉页：那一页上下是两样东西，共用一个标题会误导） */
.head-bare {
  justify-content: flex-start;
}

/* 一页里两样东西：抽屉（存的东西）在上、置物架（摆出来的）在下。
   各一个小标题，中间压一道横线 —— 用户原话「下面那几格不是抽屉，是置物架了，
   分开呗，中间分明显一点。然后说明这是抽屉，这是置物架，不要在页面最上面挂一个抽屉」。
   所以：**别再把两块合成一整页共用一个标题，也别把标题删掉**。 */
.sect + .sect {
  margin-top: 20px;
  border-top: 1px solid #ddd0b4;
}

.sect-t {
  margin: 0;
  padding: 16px 18px 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #8f887a;
}

.bag {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 0 16px 6px;
}

.bag-cell {
  position: relative;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid #e4dac4;
  border-radius: 10px;
  background: #fdf9ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  color: inherit;
  cursor: default;
}

.bag-cell.has {
  cursor: pointer;
}

.bag-cell img {
  width: 74%;
  height: 74%;
  object-fit: contain;
}

/* 手上拿着它的时候：这一格亮出来、描边压深，架子上的空格同时浮出虚线框 */
.bag-cell.picked {
  border-color: #9a8a72;
  background: #fffdf7;
  box-shadow: inset 0 0 0 1px #9a8a72;
}

/* 反过来的那一路：手上拿着架上的东西，抽屉的空格才是落点。
   格子本来就是方的，给一道虚线就够了，不用再套一层小框。 */
.bag-cell.open {
  border: 1.5px dashed #c9bda6;
  background: rgba(255, 253, 247, 0.55);
  cursor: pointer;
}

.rack {
  margin: 0 18px calc(30px + var(--safe-b));
}

/* 一排就是一块板：物品坐在板上，板本身照屋里那条做法 —— 6~8px 木色 + 一圈描边 +
   落到下面对板子上的软影。只画一条横线的话，两排看着像悬空的两根线（第一版就是这样）。 */
.rack-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100px;
}

.rack-row::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, #e8d4ab, #d6bc8e);
  border: 1.5px solid #b2a791;
  box-shadow: 0 5px 8px -4px rgba(108, 90, 62, 0.45);
}

.rack-row + .rack-row {
  margin-top: 32px;
}

.rack-cell {
  flex: 1 1 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 10px 10px 0 0;
  font: inherit;
  color: inherit;
}

.rack-cell.has {
  cursor: pointer;
}

.rack-cell img {
  height: 100px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 0.8px rgba(148, 124, 92, 0.5)) drop-shadow(0 3px 2px rgba(120, 98, 66, 0.28));
}

/* 拿在手上、还没放下：人还站在架上，但淡下去一档，
   跟「抽屉里选中的那格亮起来」是同一个意思（亮处 = 手里有东西） */
.rack-cell.picked img {
  opacity: 0.45;
}

.rack-cell.picked {
  border-radius: 10px 10px 0 0;
  background: rgba(255, 253, 247, 0.45);
}

/* 只有拿着东西的时候才画框 —— 平常架子是空的，不摆一排空槽。
   框是个方形小槽（78px），坐在板上，别拉成整格的大矩形：一整格铺满会像表格单元格。 */
.rack-cell.open {
  cursor: pointer;
}

.rack-cell.open::after {
  content: '';
  display: block;
  align-self: flex-end;
  width: 78px;
  height: 78px;
  border: 1.5px dashed #c9bda6;
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.55);
}

/* 矮桌：挡在猫猫身前的一张座卓。桌面外挑一圈，下面两条腿 + 中间一块裙板
   （幕板）。裙板不是为了好看 —— 只做两条腿的话，中间是空的，
   盘腿的脚就从缝里透出来，等于没挡。
   屋子里的东西都是「平涂 + 一道线」，所以桌面不给它第二道装饰线。

   z-index 2 压在 .pet-wrap(1) 之上，所以人坐在桌子后面。

   位置不是写死的百分比，是 calc 挂在人身上：.pet-wrap 的 left 是 21.5%、
   人的宽固定 88px，中线就是 calc(21.5% + 44px)，桌子中心对的就是这条线
   （transform: translateX(-50%) 让 left 变成中心点）。
   不要再往右让：早先为了让桌宽加到 116 往右推了 10px，看着桌子和人错开半个身位。
   现在左边缘落在 21.5% - 14px（390 屏 17.9%、360 屏 17.6%），
   和墙脚线只剩 1px / 越过 4px —— 桌角压住一点墙脚线可以接受，
   桌子是前景，本来就该挡在墙前面；但**不能再加宽**，加宽就得连中心一起挪。
   高 30、顶边离脚底 21px、底边比脚底低 8px。
   顶边这 21px 是量出来的：素材里鞋顶在画幅 y≈480，显示出来比预想的高，
   桌顶必须压到它上面才挡得住，早先只提 17px 时鞋尖会从桌沿探出来一小截。
   底边多出来的 8px 是给 .pet .shadow 的：它连同 2.2px 模糊一直铺到脚底下 4px，
   桌子不压在它上面，桌底就会浮出半团灰雾。
   **顶边不能再高**：左墙踢脚线是 y = 82 - (25/30)x（viewBox 百分比），
   中心对齐后桌左边缘落在 17.9%（390）/ 17.6%（360）。实测桌顶与那条线的
   余量是 -4.4px（390，擦进墙面一点）/ +3.9px（360）；桌面左上角本身是斜切的
   （顶面 polygon 左边在 y=3.5 才起笔），实际木色还在线下方 8px，看不出压墙。
   但这已经是最后一格余量，再往高提就真画进墙里了 —— 改宽改高都用
   .test/_deskwall.mjs 重测。 */
.desk {
  position: absolute;
  left: calc(21.5% + 44px);
  top: calc(70.5% - 21px);
  z-index: 2;
  width: 116px;
  height: 30px;
  transform: translateX(-50%);
  pointer-events: none;
  /* 木色比地板(--floor #e4d3b4)深一档，桌面和地面才分得开；
     --ink 单独写一份：桌子是 .room 的兄弟节点，继承不到房间的变量。 */
  /* 从上到下依次压暗一档：顶面接光最亮 → 前缘 → 裙板（背光）→ 腿最深 */
  --desk-top: #e3cda4;
  --desk-edge: #d3b787;
  --desk-panel: #cbae7d;
  --desk-leg: #c3a473;
  --ink: #b2a791;
}

.desk svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.desk polygon,
.desk rect {
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 0.9s ease, stroke 0.9s ease;
}

.desk .d-top {
  fill: var(--desk-top);
}

.desk .d-edge {
  fill: var(--desk-edge);
}

.desk .d-panel {
  fill: var(--desk-panel);
}

.desk .d-leg {
  fill: var(--desk-leg);
}

.room[data-time='dusk'] ~ .desk {
  --desk-top: #ddc69d;
  --desk-edge: #cdb07e;
  --desk-panel: #c5a874;
  --desk-leg: #bd9f6b;
  --ink: #b0a58d;
}

.room[data-time='night'] ~ .desk {
  --desk-top: #c8cad4;
  --desk-edge: #b9bdc9;
  --desk-panel: #b1b5c1;
  --desk-leg: #a9adba;
  --ink: #a6aab6;
}

/* 桌上那个礼物盒 —— 橘猫的来处。
   坐在桌面上：桌顶在 70.5% - 21px，盒子高 32、底边压住桌面 1px，
   所以 top = 70.5% - 21px - 31px = 70.5% - 52px。
   **往右让 26px**：人坐在桌子正后方、手正好搭在桌面中央，盒子摆正中会被读成
   「她手里捧着个东西」；退到桌面右半边才是「桌上放着个礼物」。
   margin-left 半个宽度，让盒子中心对上桌子中线（.desk 那条 calc 同一条线）；
   不用 translateX(-50%) 是为了把 transform 留给按下时那点回弹。
   **它是 .desk 的兄弟节点，不是子节点**：.desk 是 pointer-events:none，
   放进去就点不动；而且 .desk 带 aria-hidden，按钮会连读屏都进不去。
   **两端都摆它**（用户 2026-11-29 18:04 定）：主人那端看得到、点不动 ——
   猫猫收下之后云端快照里记一笔，主人端开屏读到，盒子跟着消失。 */
.gift {
  position: absolute;
  left: calc(21.5% + 44px + 26px);
  top: calc(70.5% - 52px);
  z-index: 3;
  width: 34px;
  height: 32px;
  margin-left: -17px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 1.5px 1.5px rgba(120, 98, 66, 0.32));
  transition: transform 0.12s ease-out;
}

.gift svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* 跟屋子里其他东西一个读法：平涂一块颜色 + 一道线，不加第二层描边 */
.gift .g-body,
.gift .g-lid,
.gift .g-rib {
  stroke: #b2a791;
  stroke-width: 1.1;
}

/* 盒身压成陶土红：桌面是 #e3cda4，同色的盒子放上去等于没画 */
.gift .g-body {
  fill: #d2927a;
}

.gift .g-lid {
  fill: #e8b79c;
}

.gift .g-rib {
  fill: #fbf2df;
}

.gift:active {
  transform: translateY(1px) scale(0.96);
}

/* 主人那端是个 div，不能点、也不要有按下去的那点回弹：
   盒子在不在由猫猫决定，主人只是看着 */
.cat-master .gift {
  cursor: default;
  pointer-events: none;
}

/* 礼物那张纸条得压在所有东西上面：.gift 自己是 z-index 3 */
.giftgate {
  z-index: 6;
}

/* 纸条左边那只橘猫：竖图，按高度给，宽度自己撑开 */
.gate-deal .gift-ico img {
  height: 46px;
  width: auto;
  display: block;
}

/* 人坐在房间的左上角 —— 左墙和正墙夹出来的那个地面墙角，折角在 (30%, 57%)。
   不再居中：居中时屋子右边空着，人也像贴在海报上。坐进角落，右边一大片地板
   留白，屋子才「有地方」。
   横向不是随便写的：左墙脚线是从 (0,82%) 斜到 (30%,57%) 的一条线，x 处的高度
   = 82 - 0.8333x。人宽 88（=22.6% 屏宽），left 21.5% 时横跨 21.5%~44.1%。
   **这一版的最左列最容易踩线**：盘腿时裤腿外缘往两侧翘得最高，素材最左边那几列
   （x=2）的下沿比脚底高 90px，落在墙脚线之上。left 20.5% / top 68.2% 时
   360×640 上是 -2.25%（裤腿画进左墙 12px）。现在是 left 21.5% / top 70.5%，
   靠「右移 1% + 下移 2.3%」把余量拉到 +0.88%（360）/ +2.43%（390）。
   改宽度或位置后必须跑 `.test/_wallcheck.py` 逐列验，别看 overhangPct ——
   那只算 .pet 的左边框，不看轮廓。**脚底也必须低于那条线**。 */
.pet-wrap {
  position: absolute;
  left: 21.5%;
  top: 70.5%;
  z-index: 1;
  transform: translateY(-100%);
  pointer-events: none;
}

/* 人物：坐在地上、两脚平放的一整张图（img/pet-1.png，320×546）。
   盘腿坐：两膝向左右打开、手搭在膝盖上，两隻鞋**平放**在身前地面，
   鞋尖朝观众、鞋跟朝自己。
   这一版的尺寸回到 88px（= 第四版「腿前伸」那套）：素材头宽 231、
   占比 72%，跟第四版一模一样，人高 150.1px（第四版 149.9）—— 体量没变。
   之前那版蝴蝶坐为什么宽到 104：两膝张开的宽度是头宽的 1.83 倍，
   硬压回 88 头就缩没了。这版腿是收着的，宽度回到头宽的 1.37 倍，所以照旧。
   切不出能独立转的关节（手臂压在腿上），所以整体只做微动。
   改大小只调这一个数；改完要回头看 .pet-wrap 的 left：墙脚线是按人宽算的，
   调完跑 .test/_wallcheck.py 验一遍。 */
.pet {
  position: relative;
  width: 88px;
}

/* 整体微动（只剩呼吸）挂在这一层，不挂在 .sit 上（.sit 上有贴地投影 filter，
   动它会每帧重算阴影）。耳朵已经烘进素材，跟着这一层一起走。
   will-change 是为了别每帧重新栅格化整张插画 —— 1x 屏上那种「整体在抖」
   一半来自亚像素重采样，提成合成层之后只移动、不重绘。 */
.pet .body {
  position: relative;
  z-index: 1;
  transform-origin: 50% 88%;
  will-change: transform;
}

/* 一层套一层拼起来的人物（见 js/look.js）：.fig 是画幅，第一层撑开它，
   其余的 .layer 绝对定位压在同一块 320×546 上。 */
.pet .fig {
  position: relative;
  z-index: 1;
  /* 贴地投影：drop-shadow 跟着 alpha 轮廓走，鞋底、裤腿、膝外侧各自往下
     糊出一小圈暗部 —— 手画的椭圆永远对不上这些形状，所以交给它。
     第一层几乎不位移、模糊 0.8px，是「压在缝里」的那道硬边：
     位移一大就从「坐着」变成「浮着」。第二层只负责往地板上散一点。
     **挂在 .fig 上而不是单层上**：合成之后的轮廓才算数，否则叠上去的
     帽子/裙摆那圈影子会缺一块。 */
  filter: drop-shadow(0 2px 1.5px rgba(80, 52, 22, 0.42)) drop-shadow(0 5px 4px rgba(80, 52, 22, 0.22));
}

.pet .sit {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* 叠上身的那几层：同一套坐标，不做任何缩放/位移，直接盖上去 */
.pet .layer {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 表情贴图（眨眼 / ^^ 笑眼）：一块盖住两只眼睛的皮肤补丁，压在 .sit（z-index:1）
   上面。宽度是人物素材 121/320，位置固定在脸上，所以跟着人物整体缩放。
   靠 opacity 0/1 硬切，不加 transition —— 眨眼只有 100ms 上下，渐变会拖成「眯眼」。 */
.pet .face {
  position: absolute;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: none;
}

/* 接触暗斑：盖在**鞋底之上**的一小片 multiply 暗色，位置就在两隻鞋的最下沿。
   影子画在下面时鞋底那道白描边永远亮着，人和地面之间隔一条白线，怎么调都像贴纸；
   压上来以后鞋底「陷进」地面一截，重量才落下去。
   用 multiply 而不是叠灰色：白鞋底会被压成暖暗，深色裤腿几乎不变 ——
   直接盖半透明灰的话裤子会发白起雾。
   40% 宽 / 居中不是估的：这版素材底部 10px 内的接触列是画幅 30.3%~68.8%
   （两膝翘着不触底，最低点仍是两隻鞋），左鞋中心 39.5%、右鞋中心 59.7% ——
   相对这层（30%~70%）就是 24% / 76%，所以两团暗斑落在那里。 */
.pet .press {
  position: absolute;
  left: 50%;
  bottom: -2px;
  z-index: 3;
  width: 40%;
  height: 10px;
  pointer-events: none;
  transform: translateX(-50%);
  background:
    radial-gradient(46% 100% at 24% 62%, rgba(74, 48, 20, 0.84), transparent 78%),
    radial-gradient(46% 100% at 76% 62%, rgba(74, 48, 20, 0.84), transparent 78%);
  filter: blur(1.1px);
  mix-blend-mode: multiply;
}

/* 座下阴影：下落点就在两隻鞋那一带（膝盖翘着不触底），
   所以影子以脚为中心铺，别按人的整体宽度铺 —— 铺宽了会在脚的右边飘出一团，
   看着像地上有别人留下的污渍（腿前伸那版试过 86% 宽，就是这个毛病）。
   60% 宽比鞋段（30.3%~68.8%）两头各放一点，让裤腿外缘也有一点落影；
   只往右偏 1px（窗在左墙，光从左来）。
   bottom 是 -6px、20px 高：这版膝盖离地比上一版更高，影子要露出更多才托得住。 */
.pet .shadow {
  position: absolute;
  left: 50%;
  bottom: -6px;
  z-index: 0;
  width: 60%;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(30% 64% at 34% 58%, rgba(80, 50, 20, 0.72), transparent 72%),
    radial-gradient(30% 64% at 64% 60%, rgba(80, 50, 20, 0.72), transparent 72%),
    radial-gradient(closest-side, rgba(104, 70, 34, 0.3), transparent 78%);
  filter: blur(2.2px);
  transform: translateX(-50%) translateX(1px);
}

/* 影子颜色跟着屋子的时段走。夜里地板是灰蓝的（#dfe1e6 附近），
   暖棕的影子铺在蓝底上会读成一块黄褐斑，像洒了茶；所以要换成冷灰。
   .room 和 .pet-wrap 是兄弟节点，用 ~ 选，不用改 JS。白天用上面那套默认值。 */
.room[data-time="dusk"] ~ .pet-wrap .pet .shadow {
  background:
    radial-gradient(30% 64% at 34% 58%, rgba(74, 44, 18, 0.58), transparent 72%),
    radial-gradient(30% 64% at 64% 60%, rgba(74, 44, 18, 0.58), transparent 72%),
    radial-gradient(closest-side, rgba(96, 62, 30, 0.24), transparent 78%);
}

.room[data-time="night"] ~ .pet-wrap .pet .shadow {
  background:
    radial-gradient(30% 64% at 34% 58%, rgba(30, 34, 48, 0.48), transparent 72%),
    radial-gradient(30% 64% at 64% 60%, rgba(30, 34, 48, 0.48), transparent 72%),
    radial-gradient(closest-side, rgba(36, 40, 56, 0.22), transparent 78%);
}

.room[data-time="night"] ~ .pet-wrap .pet .press {
  background:
    radial-gradient(46% 100% at 24% 62%, rgba(26, 30, 44, 0.55), transparent 72%),
    radial-gradient(46% 100% at 76% 62%, rgba(26, 30, 44, 0.55), transparent 72%);
}

.loc-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  margin: auto 0 0;
  padding: 0 18px;
  font-size: 15px;
  color: var(--muted);
  text-align: left;
}

.loc-row:active {
  background: var(--soft);
}

.loc-chev {
  margin-left: auto;
  font-size: 17px;
  line-height: 1;
  color: var(--faint);
}

/* 日历：没有记录的日子淡、按不动；有记录的带一个点 */
.cal {
  padding-top: 6px;
}

.cal-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 46px;
  padding: 0 12px;
}

.cal-nav {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 21px;
  color: var(--muted);
}

.cal-nav:active {
  color: var(--text);
}

.cal-ym {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cal-wk,
.cal-g {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px;
}

.cal-wk span {
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--faint);
}

.cal-g {
  row-gap: 2px;
  padding-bottom: 6px;
}

.cal-c {
  height: 42px;
}

.cal-d {
  position: relative;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  border-radius: 8px;
}

.cal-d.has {
  color: var(--text);
}

.cal-d.today {
  font-weight: 600;
}

.cal-d:active:not(:disabled) {
  background: var(--soft);
}

.cal-d.has i {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-note {
  margin: 18px 18px 28px;
  font-size: 12px;
  color: var(--faint);
}

/* 账本：一天一笔，左边时间、中间是哪来的、右边加减。
   收到用实色、花掉用更浅的灰 —— 这是流水，不是行情，不要红绿。 */
.led {
  list-style: none;
  margin: 0;
  padding: 2px 18px 0;
}

.led-r {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: baseline;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.led-r:last-child {
  border-bottom: 0;
}

.led-t {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.led-k {
  font-size: 14px;
}

.led-d {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.led-d.up {
  color: var(--text);
}

.led-d.down {
  color: var(--faint);
}

/* 某一天：一次一行，时间在上、地图在下 */
.pts {
  list-style: none;
  margin: 0;
  padding: 2px 18px 0;
}

.pt {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--line-soft);
}

.pt:last-child {
  border-bottom: 0;
}

.pt-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
}

.pt-h b {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pt-h span {
  font-size: 12px;
  color: var(--faint);
}

.pt-m {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  overflow: hidden;
}

.pt-m img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--soft);
}

/* 图没出来就只留一行链接，别摆一排破图 */
.pt-mf {
  display: none;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.pt-m.fail {
  display: inline-block;
  border: 0;
}

.pt-m.fail img {
  display: none;
}

.pt-m.fail .pt-mf {
  display: inline;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--faint);
}

.pts-foot {
  margin: 16px 18px 28px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* ---------- 我的 ---------- */

.me-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 18px 24px;
}

.me-av {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
}

.me-name {
  font-size: 17px;
  font-weight: 600;
}

.me-role {
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  text-align: left;
}

.row:active {
  background: var(--soft);
}

.r-val {
  margin-left: auto;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

/* 主题选择器右侧的色点 */
.dot {
  flex: none;
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.row.on .dot {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.logout {
  width: 100%;
  height: 54px;
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--muted);
}

/* ---------- 开关 ---------- */

.sw {
  display: inline-block;
  flex: none;
  margin-left: auto;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: #e4e4e1;
  transition: background 0.18s;
}

.sw i {
  position: absolute;
  top: 3px;
  left: 3px;
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s;
}

.sw.on {
  background: var(--accent);
}

.sw.on i {
  transform: translateX(18px);
}

/* ---------- 表单 ---------- */

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 15px;
}

.input::placeholder {
  color: var(--faint);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.field-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.field-row .field {
  margin-bottom: 0;
}

.grow {
  flex: 1;
  min-width: 0;
}

.field-error {
  display: none;
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #d33b28;
}

.field-error.show {
  display: block;
}

/* 「正在自动重试」不是错，用灰字，别拿红色吓人 */
.field-error.wait {
  color: var(--muted);
}

.btn-primary {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 500;
}

.btn-primary:disabled {
  opacity: 0.5;
}

.btn-ghost {
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

.btn-soft {
  height: 46px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
  color: var(--text);
}

.wide {
  width: 100%;
}

/* 无边框文字按钮：只用来放「重新登录」这类出口 */
.btn-plain {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
  background: none;
}

/* ---------- 登录 ---------- */

.auth,
.bind,
.onboard {
  min-height: 100%;
  padding: calc(46px + var(--safe-t)) 24px calc(28px + var(--safe-b));
  display: flex;
  flex-direction: column;
}

.auth-top {
  text-align: center;
  margin-bottom: 30px;
}

.auth-cat {
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
}

.auth-cat img {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-title {
  margin: 14px 0 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-sub {
  display: none;
}

.auth-card {
  display: flex;
  flex-direction: column;
}

.seg {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 3px;
  border-radius: 11px;
  background: var(--soft);
}

.seg-btn {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
}

.seg-btn.on {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12px;
  color: var(--faint);
}

.or::before,
.or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-wechat {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wx-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #19bd4c;
}

.auth-hint {
  display: none;
}

/* 自建模式那几屏的说明文字（原来的 .auth-hint 是常驻隐藏的） */
.auth-note {
  margin: 14px 2px 0;
  font-size: 13px;
  line-height: 1.68;
  color: var(--muted);
}

/* 邀请码那一屏：输入框和两个按钮之间留一样的空 */
.auth-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 邀请码：大一点、字距拉开，方便照着念 */
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.demo-entry {
  margin-top: 22px;
  border-color: transparent;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 引导 / 绑定 ---------- */

.ob-head {
  margin-bottom: 24px;
}

.ob-kicker {
  display: none;
}

.ob-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.ob-sub {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.ob-avatar-preview {
  align-self: center;
  width: 78px;
  height: 78px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 36px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 14px 0 20px;
}

.avatar-pick {
  height: 44px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 21px;
  line-height: 1;
}

.avatar-pick.on {
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.link-back {
  align-self: flex-start;
  margin-bottom: 26px;
  font-size: 13px;
  color: var(--muted);
}

.link-back.center {
  align-self: center;
  margin-top: 26px;
}

.role-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}

.role-card:active {
  background: var(--soft);
}

.role-emoji {
  font-size: 26px;
  line-height: 1;
}

.role-text {
  display: flex;
  flex-direction: column;
}

.role-name {
  font-size: 15px;
}

.role-desc {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.bind-note {
  display: none;
}

.code-input {
  width: 100%;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 24px;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}

.code-card {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}

.code-label {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.code-value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.code-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.waiting-tip {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- 弹层 ---------- */

.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.2s;
}

.sheet-wrap.in .sheet-backdrop {
  opacity: 1;
}

.sheet {
  position: relative;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(20px + var(--safe-b));
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.3, 0.8, 0.4, 1);
}

.sheet-wrap.in .sheet {
  transform: translateY(0);
}

.sheet-grip {
  width: 34px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 2px;
  background: var(--line);
}

.sheet-title {
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  margin-bottom: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 8px;
  margin-right: -8px;
}

.sheet-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + var(--safe-b));
  transform: translate(-50%, 8px);
  max-width: 80vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.9);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 空态 / 故障 ---------- */

.empty,
.fatal {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 28px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.fatal {
  height: 100%;
}

.fatal .btn-primary {
  width: auto;
  padding: 0 24px;
}

/* ---------- 启动 ---------- */

.boot {
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 26px;
  opacity: 0.5;
}

.ico {
  width: 20px;
  height: 20px;
}

.seg {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.seg button {
  flex: 1;
  padding: 9px 0;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.seg button.on {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.step {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.input.area {
  height: auto;
  min-height: 76px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: none;
}

.pic-row {
  margin-top: 12px;
}

.pic-add {
  width: 100%;
  padding: 11px;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.pic-prev {
  position: relative;
  width: 96px;
  height: 96px;
}

.pic-prev img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
}

.pic-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  line-height: 1;
}

/* ---------- 我的：相识天数 / 头像照片 ---------- */

.me-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.me-sub.set {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.me-av img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--faint);
}

.scroll > .hint {
  padding: 0 18px;
}

/* ---------- toast 带操作按钮 ---------- */

.toast.with-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  max-width: 86vw;
  border-radius: 16px;
  pointer-events: auto;
  text-align: left;
}

.toast-text {
  flex: 1;
  min-width: 0;
}

.toast-act {
  flex: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.toast-act:active {
  background: rgba(255, 255, 255, 0.3);
}

.sheet-actions .btn-plain {
  text-align: center;
}

/* ---------- 弹层滚动细节 ---------- */

.sheet-body {
  scrollbar-width: thin;
}

.sheet-body::-webkit-scrollbar {
  width: 4px;
}

.sheet-body::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.sheet-body::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 屋子：应用格子 ----------
   三列小方块，跟手机桌面一个节奏。底块用 --soft，只做「这是个应用」的暗示，
   不加阴影不加描边。以后应用多了往下滚就行。 */

.apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 10px;
  padding: 28px 20px 40px;
}

.app-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.app-ico {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--soft);
  display: grid;
  place-items: center;
  transition: opacity 0.12s;
}

.app-ico svg {
  width: 42px;
  height: 42px;
  display: block;
}

.app-name {
  font-size: 11px;
  letter-spacing: 0.01em;
}

.app-cell:active .app-ico {
  opacity: 0.45;
}

