* { margin: 0; padding: 0; box-sizing: border-box; }

/* ============================================================
   v50 性能重构：所有持续动画只用 transform / opacity，
   彻底避开 layout（left/top）与 CSS 变量插值（@property）。
   照片拆成 4 层，每层只负责一种变换，互不覆盖：
     .slot  → translate3d 定位（位移过渡）
     .bob   → translateY 微浮动（无限循环，随机相位）
     .rise  → scale 浮起放大（riseCycle）
     .photo → rotate 静态倾斜（不参与动画）
     .glow  → 浮起高亮，只动 opacity（阴影本体静态，不重绘）
   ============================================================ */

:root {
  --pink: #ff9ecb;
  --deep: #1a0b2e;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 背景 ---------- */
body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 94, 161, .18), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(124, 58, 237, .25), transparent 55%),
    linear-gradient(160deg, #1a0b2e 0%, #2d1036 45%, #16081f 100%);
  color: #fff;
}

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky .star {
  position: absolute; border-radius: 50%;
  background: #fff; opacity: .35;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .15; } 50% { opacity: .6; } }

/* ---------- 标题 ---------- */
.site-header {
  position: fixed; top: 4vh; left: 0; right: 0;
  text-align: center; z-index: 5; pointer-events: none;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.site-title {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 700; letter-spacing: .06em;
  background: linear-gradient(90deg, #ff9ecb, #ffd3e8, #c4b5fd, #ff9ecb);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}
.site-title .heart { -webkit-text-fill-color: #ff5ea1; animation: heartbeat 1.6s ease-in-out infinite; display: inline-block; }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 25% { transform: scale(1.18); } 40% { transform: scale(1); } 60% { transform: scale(1.12); } }
.site-sub {
  margin-top: 6px; font-size: clamp(12px, 2vw, 15px);
  letter-spacing: .35em; color: rgba(255,255,255,.72);
}

/* ---------- 照片墙 ---------- */
.wall { position: fixed; inset: 0; z-index: 1; }

/* 第 1 层：定位。left/top 恒为 0，位置全部用 translate3d —— 不触发 layout，纯合成层平移 */
.slot {
  position: absolute;
  left: 0; top: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 3s cubic-bezier(.45,.05,.35,1), opacity .8s ease;
  z-index: 1;
}
.slot.entering { opacity: 0; }
.slot.landed { opacity: 1; }
.slot.raised { z-index: 15; }
.slot:hover { z-index: 30; }

/* 第 2 层：微浮动。纯 translate3d 关键帧，可完全提升到合成器线程；相位由 JS 随机错开 */
.bob {
  width: 100%; height: 100%;
  animation: bob 6s ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
}
@keyframes bob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -5px, 0); }
}

/* 第 3 层：浮起放大。scale 独占一层，不与 bob 的 translateY 抢同一个 transform。
   v50.1：换图与弹起合并为一个动作 —— JS 先在原地静默换好图（照片此时被上层盖住不可见），
   再触发 riseCycle 把「新照片」弹起来展示。视觉上是一次连贯动作：新照片浮现登场。 */
.rise {
  position: relative;
  width: 100%; height: 100%;
  transform: scale(1);
}
.rise.raising { animation: riseCycle 9s cubic-bezier(.45,.05,.35,1) forwards; }
/* 0-25% 弹起放大到 1.6 倍（缓出减速）；25-70% 缓慢缩回原大小；70-100% 停留在最上层 */
@keyframes riseCycle {
  0%   { transform: scale(1) translate3d(0,0,0);            animation-timing-function: cubic-bezier(.22,.61,.36,1); }
  25%  { transform: scale(1.6) translate3d(0,-10px,0);      animation-timing-function: cubic-bezier(.45,.05,.35,1); }
  70%  { transform: scale(1) translate3d(0,0,0);            animation-timing-function: ease-in-out; }
  100% { transform: scale(1) translate3d(0,0,0); }
}

/* 第 4 层：倾斜坐标系。rotate 独占一层，让 .photo 与 .glow 共处同一旋转坐标系 ——
   v50 首版把 rotate 放在 .photo 上、.glow 是它的兄弟节点，导致高亮描边是正方框、
   照片是斜的，放大 1.6 倍后偏差被放大、明显不贴合（杰哥 2026-08-27 反馈）。
   rotate 值来自静态 CSS 变量，不参与插值，不影响合成层性能。 */
.tilt {
  position: relative;
  width: 100%; height: 100%;
  transform: rotate(var(--rot, 0deg));
}

/* 第 5 层：图片本体。阴影/描边全程不变 → 只 paint 一次后由合成层缓存。
   v52：去掉换图的淡入淡出（杰哥 2026-08-27 反馈"多的淡化动作反而不简洁"）——
   换图时照片被上层盖住本就不可见，淡化纯属多余动作，还白等 400ms。
   现在是直接硬切 src，然后立刻弹起，动作最干净。 */
.photo {
  display: block;
  width: 100%; height: 100%;
  border-radius: 12px;
  object-fit: cover;
  cursor: pointer;
  /* blur 半径 18px → 12px：模糊成本按面积增长，电脑端照片大 4-8 倍，这里省的是首帧 paint 与层内存 */
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
  /* 粉色描边从 box-shadow spread 改为 outline，与阴影解耦，轮播换图时不引起阴影重算 */
  outline: 2px solid rgba(255,158,203,.35);
  outline-offset: -1px;
}

/* 浮起高亮层：与 .photo 同为 .tilt 的子节点，因此共享同一 rotate，描边始终贴合照片。
   box-shadow 本体静态，只有 opacity 在动画 —— 避免每帧重绘阴影 */
.glow {
  position: absolute; inset: 0;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(255,94,161,.45);
  outline: 2px solid rgba(255,158,203,.75);
  outline-offset: -1px;
  opacity: 0;
  pointer-events: none;
}
.rise.raising .glow { animation: glowCycle 9s cubic-bezier(.45,.05,.35,1) forwards; }
@keyframes glowCycle {
  0%        { opacity: 0; }
  25%       { opacity: 1; }
  70%, 100% { opacity: 0; }
}

/* 悬停：只改 outline 颜色（单个元素重绘，成本可忽略） */
.slot:hover .photo { outline-color: rgba(255,158,203,.75); }

/* 页面切到后台时冻结全部动画，不白烧 CPU / 电量 */
.anim-paused .bob,
.anim-paused .rise.raising,
.anim-paused .rise.raising .glow,
.anim-paused .star,
.anim-paused .site-title,
.anim-paused .site-title .heart,
.anim-paused .upload-btn { animation-play-state: paused; }

/* 尊重系统「减弱动态效果」偏好：关掉持续浮动，保留功能 */
@media (prefers-reduced-motion: reduce) {
  .bob, .star, .upload-btn { animation: none; }
  .slot { transition: opacity .8s ease; }
}

/* ---------- 上传按钮 ---------- */
.upload-btn {
  position: fixed; right: 22px; bottom: 24px; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 15px 26px; border-radius: 50px; border: none;
  font-size: 17px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #ff5ea1, #a855f7);
  box-shadow: 0 6px 22px rgba(255,94,161,.5);
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: btnPulse 2.2s ease-in-out infinite;
}
.upload-btn:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(255,94,161,.75); }
.upload-btn:active { transform: scale(.96); }
.upload-btn[hidden] { display: none; }
@keyframes btnPulse {
  0%,100% { box-shadow: 0 8px 26px rgba(255,94,161,.55); }
  50% { box-shadow: 0 8px 38px rgba(255,94,161,.9); }
}
/* 手机端：圆形大＋按钮，防文字溢出 */
@media (max-width: 480px) {
  .upload-btn {
    width: 58px; height: 58px; padding: 0;
    justify-content: center; gap: 0;
    font-size: 28px; border-radius: 50%;
  }
  .btn-label { display: none; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(8, 4, 16, .92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; } /* 关键：覆盖 display:flex，否则蒙版常驻 */
/* v54.6：双层轮换 —— 图片绝对定位居中（原 flex 流内布局 + CSS zoomIn 由 WAAPI 取代） */
.lb-img {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw; max-height: 88vh;
  border-radius: 10px; box-shadow: 0 0 60px rgba(255,94,161,.3);
}
@keyframes zoomIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lb-hint {
  position: absolute; top: 24px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.55); font-size: 13px; letter-spacing: .15em;
  pointer-events: none; z-index: 1;
}
.lb-close {
  position: absolute; top: 18px; right: 18px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: none; color: #fff; font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .95; transition: background .2s, transform .2s;
  z-index: 2;
}
.lb-close:hover { background: rgba(255,94,161,.4); transform: rotate(90deg); }
.lb-prev, .lb-next { display: none; } /* 左右切换箭头已移除 */
.lb-counter {
  position: absolute; bottom: 24px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.6); font-size: 14px; letter-spacing: .2em;
}
.lb-actions {
  position: absolute; bottom: 60px; left: 0; right: 0;
  display: flex; justify-content: center; z-index: 2;
}
.lb-del {
  padding: 10px 26px; border-radius: 50px; border: none;
  font-size: 15px; font-weight: 600; color: #fff; cursor: pointer;
  background: rgba(255, 80, 80, .9); box-shadow: 0 4px 16px rgba(255,80,80,.35);
  transition: transform .2s ease;
}
.lb-del:hover { transform: scale(1.06); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 24px; bottom: 104px; z-index: 30;
  background: rgba(20, 10, 30, .92); border: 1px solid rgba(255,158,203,.4);
  color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 600px) {
  .upload-btn { right: 18px; bottom: 18px; width: 54px; height: 54px; font-size: 26px; }
}

/* ---------- 备案号（蜀ICP备2026048814号-1） ---------- */
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 10px;
  text-align: center; z-index: 5;
  font-size: 11px; letter-spacing: .06em;
  color: rgba(255,255,255,.38);
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
  pointer-events: none; /* 容器不拦截照片点击，仅链接可点 */
}
.site-footer a {
  color: inherit; text-decoration: none;
  padding: 8px 14px; /* 扩大点击热区 */
  pointer-events: auto;
  transition: color .25s ease;
}
.site-footer a:hover { color: rgba(255,255,255,.8); }

/* ============================================================
   v54（2026-10-13）：上传密码门 + 左下角小工具面板（体重记录）
   全部为新增样式，不改动上面任何照片墙样式
   ============================================================ */

/* ---------- 上传密码门 ---------- */
.pwd-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8,4,16,.62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.pwd-mask[hidden] { display: none; }
.pwd-box {
  width: min(320px, 86vw); padding: 24px 22px 18px;
  background: rgba(22,11,34,.98); border: 1px solid rgba(255,158,203,.4);
  border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
}
.pwd-box h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 700; color: #fff;
}
.h3-ico { display: inline-flex; color: #ff9ecb; }
.h3-ico .line-ico { width: 19px; height: 19px; }
.pwd-tip { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.6); }
.pwd-input {
  width: 100%; margin-top: 14px; padding: 12px 14px;
  font-size: 16px; letter-spacing: .2em; border-radius: 12px;
  border: 1.5px solid rgba(255,158,203,.35);
  background: rgba(255,255,255,.06); color: #fff; outline: none;
}
.pwd-input:focus { border-color: #ff9ecb; }
.pwd-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: #ff7a9c; }
.pwd-btns { display: flex; gap: 10px; margin-top: 4px; }
.pwd-btns button {
  flex: 1; padding: 11px 0; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.pwd-cancel { background: rgba(255,255,255,.1); color: rgba(255,255,255,.75); }
.pwd-ok { background: linear-gradient(135deg, #ff5ea1, #a855f7); color: #fff; }

/* ---------- 小工具入口（左下角，低调样式：半透明浅底 + 三横杠） ---------- */
.tools-fab {
  position: fixed; left: 22px; bottom: 24px; z-index: 6;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-radius: 50px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.6); white-space: nowrap;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tools-fab:hover { background: rgba(255,255,255,.16); color: rgba(255,255,255,.85); }
.tools-fab:active { background: rgba(255,255,255,.22); }
.tf-bars { display: inline-flex; flex-direction: column; gap: 3px; }
.tf-bars i { display: block; width: 15px; height: 2px; border-radius: 1px; background: currentColor; }

.tools-panel {
  position: fixed; left: 22px; bottom: 88px; z-index: 8;
  width: min(340px, calc(100vw - 44px));
  max-height: min(74vh, 580px); overflow-y: auto;
  /* 苹果毛玻璃：半透明底 + 大模糊 + 提饱和，隐约透出后面的照片墙 */
  background: rgba(30,18,48,.66);
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
  padding: 14px 14px 12px;
}
.tools-panel[hidden] { display: none; }
.tp-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 10px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.tp-icon { display: inline-flex; align-items: center; color: rgba(255,255,255,.6); }
.tp-icon .tf-bars i { width: 13px; }
.tp-title { flex: 1; font-size: 15px; font-weight: 700; color: #fff; }
.tp-back, .tp-close {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.tp-back { font-size: 21px; }
.tp-back:hover, .tp-close:hover { background: rgba(255,94,161,.4); }
.tp-body { padding-top: 10px; }

.tool-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 12px; border-radius: 14px; border: none; cursor: pointer;
  background: rgba(255,255,255,.05); color: #fff;
  transition: background .15s, transform .15s;
}
.tool-item:hover { background: rgba(255,255,255,.1); transform: translateX(2px); }
.tool-item + .tool-item { margin-top: 8px; }
.ti-icon { display: inline-flex; align-items: center; color: rgba(255,158,203,.9); }
.line-ico {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.line-ico .dot { fill: currentColor; stroke: none; }
.ti-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ti-name { font-size: 15px; font-weight: 600; }
.ti-desc { font-size: 12px; color: rgba(255,255,255,.55); }
.ti-arrow { color: rgba(255,255,255,.35); font-size: 18px; }

/* ---------- 体重记录 ---------- */
.wt-loading { text-align: center; color: rgba(255,255,255,.55); padding: 24px 0; font-size: 14px; }
.wt-stats { display: flex; align-items: baseline; gap: 12px; padding: 4px 2px 8px; }
.wt-latest b { font-size: 34px; font-weight: 800; color: #ffd3e8; }
.wt-latest i { font-style: normal; font-size: 14px; color: rgba(255,255,255,.55); margin-left: 4px; }
.wt-sub { font-size: 12.5px; color: rgba(255,255,255,.6); line-height: 1.7; }
.wt-diff.down { color: #7be3b0; }
.wt-diff.up { color: #ff7a9c; }
.wt-chart { margin: 4px 0 10px; }
.wt-svg { width: 100%; height: auto; display: block; }
.wt-grid-txt { font-size: 10px; fill: rgba(255,255,255,.45); }
.wt-form { display: flex; gap: 8px; }
.wt-form input {
  min-width: 0; padding: 10px; border-radius: 12px; font-size: 14px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; outline: none;
  color-scheme: dark;
}
.wt-form input:focus { border-color: #ff9ecb; }
.wt-form input[type="date"] { flex: 1.35; }
.wt-form input[type="number"] { flex: 1; }
.wt-save {
  padding: 10px 18px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff5ea1, #a855f7);
}
.wt-list { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }
.wt-row {
  display: flex; justify-content: space-between; padding: 7px 4px;
  font-size: 13px; color: rgba(255,255,255,.75);
}
.wt-row .wt-kg { color: #ffd3e8; font-weight: 600; }

/* 手机端：工具按钮与上传按钮同款圆形（低调样式） */
@media (max-width: 480px) {
  .tools-fab {
    left: 18px; bottom: 18px; width: 58px; height: 58px; padding: 0;
    justify-content: center; gap: 0; border-radius: 50%;
  }
  .tf-label { display: none; }
}
@media (max-width: 600px) {
  .tools-fab {
    left: 18px; bottom: 18px; width: 54px; height: 54px; padding: 0;
    justify-content: center; gap: 0; border-radius: 50%;
  }
  .tf-label { display: none; }
  .tools-panel { left: 18px; bottom: 84px; width: calc(100vw - 36px); }
}

/* ---------- v54.2（2026-10-14）：大图翻页（箭头按钮 + 手机滑动） ---------- */
/* v54.3：箭头全透明无底，仅符号 + 暗影（亮照片上也可读） */
.lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: none; border: none; color: rgba(255,255,255,.85);
  font-size: 32px; font-weight: 300; line-height: 1; cursor: pointer; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 1px 10px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,.5);
  transition: color .15s;
}
.lb-arrow:hover { color: #fff; }
.lb-arrow-prev { left: 14px; }
.lb-arrow-next { right: 14px; }
@media (max-width: 600px) {
  .lb-arrow { width: 40px; height: 40px; font-size: 27px; }
  .lb-arrow-prev { left: 8px; }
  .lb-arrow-next { right: 8px; }
}

/* v54.4：大图翻页的旧图滑出层（幽灵层）——绝对定位居中，不参与 flex 布局 */
.lb-ghost {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 2;
  animation: none; /* 覆盖 .lb-img 的 zoomIn，幽灵层直接按 WAAPI 动画走 */
}

/* ============================================================
   v55（2026-10-26）：宠物打卡养成（柚子/橙子）
   沿用毛玻璃面板语言；任务/商品用大号彩色图标，5 岁孩子靠图认字
   ============================================================ */
.tools-panel.pet-wide { width: min(400px, calc(100vw - 44px)); max-height: min(82vh, 720px); }

.pet-hero { display: flex; gap: 12px; align-items: center; }
.pet-stage {
  flex: 0 0 46%; aspect-ratio: 1; border-radius: 20px; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 50% 78%, rgba(255,255,255,.2), rgba(255,255,255,.04) 70%);
  border: 1px solid rgba(255,255,255,.12); overflow: hidden; padding: 8px 6px 4px;
}
.pet-img { width: 94%; height: auto; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pet-stage.sad .pet-img { filter: grayscale(.55) brightness(.9); }
.pet-stage.low .pet-img { filter: saturate(.75); }
.pet-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pet-life { display: flex; align-items: baseline; gap: 4px; }
.pl-label { font-size: 12px; color: rgba(255,255,255,.6); margin-right: 2px; }
.pl-num { font-size: 40px; font-weight: 800; color: #ffd3e8; line-height: 1; }
.pl-max { font-size: 12px; color: rgba(255,255,255,.45); }
.pet-mood { font-size: 13px; font-weight: 600; }
.pet-mood.happy { color: #7be3b0; } .pet-mood.ok { color: #ffd479; }
.pet-mood.low { color: #ffab7a; } .pet-mood.sad { color: #ff7a9c; }
.pet-points {
  margin-top: 2px; display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  background: rgba(255,200,61,.16); border: 1px solid rgba(255,200,61,.35);
}
.pet-points svg { width: 20px; height: 20px; }
.pet-points b { font-size: 20px; color: #ffd86b; font-weight: 800; line-height: 1; }
.pet-points span { font-size: 12px; color: rgba(255,255,255,.65); }

.pet-stats { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pet-stat { display: flex; align-items: center; gap: 6px; }
.ps-name { font-size: 12px; color: rgba(255,255,255,.65); flex: 0 0 auto; }
.ps-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.ps-bar i { display: block; height: 100%; border-radius: 4px; transition: width .6s ease; }
.ps-num { font-size: 12px; color: rgba(255,255,255,.8); width: 22px; text-align: right; flex: 0 0 auto; }

.pet-sec-title { margin: 14px 2px 8px; font-size: 13px; font-weight: 700; color: rgba(255,255,255,.85); }
.pet-sec-title i { font-style: normal; font-weight: 400; font-size: 12px; color: rgba(255,255,255,.45); margin-left: 6px; }

.pet-tasks { display: flex; flex-direction: column; gap: 8px; }
.pet-task {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 16px; border: 1.5px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07); color: #fff; font-size: 14.5px;
  transition: background .15s, border-color .15s, transform .12s;
}
.pet-task:active { transform: scale(.98); }
.pt-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; padding: 4px; }
.pt-ico svg { width: 100%; height: 100%; }
.pt-name { flex: 1; font-weight: 600; line-height: 1.3; }
.pt-pts { font-size: 15px; font-weight: 800; color: #ffd86b; }
.pt-check {
  flex: 0 0 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; color: #fff;
}
.pet-task.done { background: rgba(79,209,139,.2); border-color: rgba(79,209,139,.65); }
.pet-task.done .pt-check { background: #3fbf7f; border-color: #3fbf7f; }
.pet-task.done .pt-name { color: rgba(255,255,255,.75); }

/* v56.31：处罚项（扣分）—— 红色调，与加分任务区分 */
.pet-task.penalty { border-color: rgba(226,100,90,.45); background: rgba(226,100,90,.1); }
.pet-task.penalty .pt-name { color: #ffb9b1; }
.pet-task.penalty .pt-ico { background: rgba(255,255,255,.9); }
.pet-task.penalty.done { background: rgba(226,100,90,.28); border-color: rgba(226,100,90,.8); }
.pet-task.penalty.done .pt-check { background: #e2645a; border-color: #e2645a; }
.pt-pts.neg { color: #ff8f85; }

/* v56.32：嗝屁锁定态道具（必须先买救命丹） */
.pet-item.locked { opacity: .42; filter: grayscale(.7); position: relative; }
.pet-item.locked::after {
  content: '🔒'; position: absolute; top: 6px; right: 6px; font-size: 12px; opacity: .9;
}
.pet-item.locked:active { transform: none; }

/* v56.33：负积分显示（处罚扣成负数时，红色提示，仍不能买东西） */
.pet-points.neg b { color: #ff8f85; }
.pet-points.neg span { color: #ff8f85; opacity: .75; }

.pet-shop { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pet-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
  padding: 10px 4px 8px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07); color: #fff; transition: background .15s, transform .12s;
}
.pet-item:hover { background: rgba(255,255,255,.13); }
.pet-item:active { transform: scale(.96); }
.pet-item.poor { opacity: .5; }
.pi-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.92); padding: 3px; display: flex; }
.pi-ico svg { width: 100%; height: 100%; }
.pi-name { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.pi-eff { font-size: 10.5px; color: rgba(255,255,255,.55); text-align: center; line-height: 1.25; min-height: 26px; }
.pi-price { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: #ffd86b; }
.pi-price svg { width: 14px; height: 14px; }

.pet-log-row { font-size: 12.5px; color: rgba(255,255,255,.7); padding: 3px 2px; display: flex; align-items: baseline; }
.pet-log-row.dim { color: rgba(255,255,255,.4); }

@media (max-width: 600px) {
  .tools-panel.pet-wide { width: calc(100vw - 36px); max-height: 80vh; }
  .pet-stage { flex-basis: 44%; }
  .pl-num { font-size: 34px; }
}

/* v55.1：工具入口的宠物形象小图（白底圆角小窗，和细线图标同尺寸语言） */
.ti-icon .ti-pet-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 8px; background: rgba(255,255,255,.92); padding: 1px;
}

/* v55.1 修正：图标位定死 44px 方形，防止宠物图把容器撑爆 */
.ti-icon { flex: 0 0 44px; width: 44px; height: 44px; }
.ti-icon svg { width: 44px; height: 44px; }

/* v55.2：入口宠物小图去白底，直接透在面板上 */
.ti-icon .ti-pet-img { background: transparent; padding: 0; }

/* v55.2：入口宠物小图去白底，直接透在面板上 */
.ti-icon .ti-pet-img { background: transparent; padding: 0; }

/* ---------- v55.4：购买动效粒子（爱心/泡泡/星光） ---------- */
.pet-stage { position: relative; }
.pet-fx { position: absolute; pointer-events: none; z-index: 3; }
.pet-fx-heart {
  bottom: 62%; color: #ff8fb7; font-weight: 700;
  animation: fxFloatUp 1.5s ease-out forwards;
  text-shadow: 0 0 6px rgba(255,143,183,.6);
}
@keyframes fxFloatUp {
  0% { opacity: 0; transform: translateY(6px) scale(.5); }
  25% { opacity: 1; transform: translateY(-6px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-42px) scale(.9); }
}
.pet-fx-bubble {
  bottom: 10%;
  border-radius: 50%;
  border: 1.5px solid rgba(190, 235, 255, .85);
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,.85), rgba(190,235,255,.18) 62%);
  animation: fxBubble 1.3s ease-in forwards;
}
@keyframes fxBubble {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  15% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-90%) translateX(14px); }
}
.pet-fx-spark {
  color: #9df5c0; font-weight: 700;
  animation: fxSpark 1.1s ease-out forwards;
  text-shadow: 0 0 8px rgba(110,240,160,.8);
}
@keyframes fxSpark {
  0% { opacity: 0; transform: scale(.2) rotate(0deg); }
  35% { opacity: 1; transform: scale(1.25) rotate(40deg); }
  100% { opacity: 0; transform: scale(.6) rotate(90deg); }
}

/* v55.5：道具图标落下（购买前奏） */
.pet-fx-itemdrop {
  position: absolute; left: 50%; top: 8%; z-index: 3; pointer-events: none;
  width: 52px; height: 52px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.4));
}
.pet-fx-itemdrop svg { width: 100%; height: 100%; }

/* ---------- v55.7：宠物页分区——宠物+数值固定顶部，任务/商店在下方滚动 ---------- */
.tools-panel.pet-wide { display: flex; flex-direction: column; overflow: hidden; }
.tools-panel.pet-wide .tp-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pet-fixed { flex: 0 0 auto; }
.pet-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding-bottom: 6px; margin-top: 4px;
  scrollbar-width: thin;
}
.pet-scroll::-webkit-scrollbar { width: 4px; }
.pet-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* ---------- v55.7：宠物页分区——宠物+数值固定顶部，任务/商店在下方滚动 ---------- */
.tools-panel.pet-wide { display: flex; flex-direction: column; overflow: hidden; }
.tools-panel.pet-wide .tp-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pet-fixed { flex: 0 0 auto; }
.pet-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding-bottom: 6px; margin-top: 4px;
  scrollbar-width: thin;
}
.pet-scroll::-webkit-scrollbar { width: 4px; }
.pet-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* v55.8：成长值展示（积分徽标下方） */
.pet-growth {
  margin-top: 6px; display: inline-flex; align-items: baseline; gap: 4px; align-self: flex-start;
  font-size: 12px; color: rgba(255,255,255,.55);
}
.pet-growth b { font-size: 15px; font-weight: 800; color: #8ef0b0; }
.pet-growth span { font-size: 10.5px; color: rgba(255,255,255,.38); }

/* v55.9 修复：pet-wide 的 display:flex 覆盖了 [hidden]{display:none}（同特异性、后定义者胜），
   导致点叉号 hidden=true 但面板仍显示 —— 必须显式补回隐藏规则 */
.tools-panel.pet-wide[hidden] { display: none; }

/* v55.9：成长值移到标题行（替换原 pet-side 内的展示） */
.tp-title .pet-growth {
  margin-left: 8px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5);
  display: inline-flex; align-items: baseline; gap: 2px;
}
.tp-title .pet-growth b { font-size: 14px; font-weight: 800; color: #8ef0b0; }

/* v55.9：成长值移到标题行（替换原 pet-side 内的展示） */
.tp-title .pet-growth {
  margin-left: 8px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.5);
  display: inline-flex; align-items: baseline; gap: 2px;
}
.tp-title .pet-growth b { font-size: 14px; font-weight: 800; color: #8ef0b0; }

/* v55.14 修复：宠物图溢出画框（竖长图按宽度 94% 撑高后超容器，被裁掉头顶） */
.pet-stage {
  align-items: center;          /* 原来是 flex-end，会把超高的图顶出上边界 */
  padding: 10px 8px;
  box-sizing: border-box;
}
.pet-img {
  width: auto;                  /* 不再固定 94% 宽度 */
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* v55.15：宠物图改用绝对定位 + inset 约束（不依赖 flex 百分比高度，Safari/WebKit 也稳）
   图片容器尺寸固定，object-fit: contain 让图等比缩放居中，永不裁切 */
.pet-stage {
  align-items: stretch;
  padding: 0;
}
.pet-img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

/* v55.16：嗝屁档滤镜（趴着憔悴沿用 sad 的去饱和，嗝屁更灰 + 灵魂出窍感） */
.pet-stage.dead .pet-img { filter: grayscale(.85) brightness(.75) contrast(.9); }
.pet-stage.dead { animation: deadPulse 2.4s ease-in-out infinite; }
@keyframes deadPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

/* v55.18：道具交互视频（覆盖在静态形象上播放，布局与 pet-img 一致） */
.pet-fx-video {
  position: absolute; inset: 8px;
  width: calc(100% - 16px); height: calc(100% - 16px);
  object-fit: contain; object-position: center;
  z-index: 4; border-radius: 12px;
  background: rgba(255,255,255,.04);
}

/* v55.19：舞台改白底（与视频背景统一衔接）；形象图为透明底，白舞台上即白底 */
.pet-stage {
  background: linear-gradient(180deg, #ffffff, #f6f1ec);
  border-color: rgba(120, 90, 140, .18);
}
.pet-fx-video { background: transparent; }

/* v56.27：交互视频淡入淡出衔接（opacity 交叉淡化，比左右擦除柔和）；
   循环层全程播放不动，不做位移缩放，舞台不露白 */
.pet-fx-video {
  transform: scale(1.18);
  opacity: 0;
  transition: opacity .32s ease;
}
.pet-fx-video.show { opacity: 1; }

/* v55.21：博美舞台用奶油黄底（白色宠物在白底看不清），与博美视频底色一致 */
.pet-stage.sp-pomeranian {
  background: linear-gradient(180deg, #fff8e7, #ffefc9);
  border-color: rgba(180, 130, 60, .22);
}

/* v55.28：动态形象（无缝循环视频层，盖在静态图上、交互视频之下） */
.pet-live {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; overflow: hidden; border-radius: 12px;
}
.pet-live .pl-v {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  opacity: 0; transition: opacity .8s ease;
}
.pet-live .pl-v.on { opacity: 1; }

/* ---------- v56 战斗体系样式 ---------- */
/* 战斗值（替代原生命值位置） */
.pet-battle { display: flex; align-items: baseline; gap: 6px; }
.pet-battle .pl-label { font-size: 12px; color: rgba(255,255,255,.55); }
.pet-battle .pl-num { font-size: 26px; font-weight: 900; color: #ffd76a; line-height: 1; }
/* 攻/防徽章行 */
.pet-stat-ad { display: flex; gap: 10px; }
.ps-ad { font-size: 12.5px; color: rgba(255,255,255,.6); display: inline-flex; align-items: baseline; gap: 3px; }
.ps-ad b { font-size: 16px; font-weight: 800; }
.ps-ad:first-child b { color: #8ef0b0; }
.ps-ad:last-child b { color: #8ec9ff; }
/* 武器徽章（形象角落） */
.pet-weapons {
  position: absolute; right: 6px; bottom: 6px; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end;
  max-width: 85%; pointer-events: none;
}
.w-badge {
  font-size: 10.5px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 8px;
  background: rgba(20, 12, 32, .72);
  border: 1px solid; backdrop-filter: blur(2px);
  white-space: nowrap;
}

/* v56.1：战斗值小徽章（积分旁展示） */
.pt-battle { font-style: normal; font-size: 11px; color: rgba(255,255,255,.5); margin-left: 8px; }
.pt-battle b { color: #ffd76a; font-size: 13px; }

/* v56.2：武器徽章实物图标版 */
.w-badge img { width: 22px; height: 22px; object-fit: contain; display: block; }
.w-badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; }
.w-badge i { font-style: normal; font-size: 11px; font-weight: 800; color: #ffe9b0; }

/* ---------- v56.4：数值胶囊行 + 滚动联动 ---------- */
.pet-stats { display: flex; gap: 6px; margin-top: 10px; }
.stat-pill {
  position: relative; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  height: 30px; border-radius: 15px; overflow: hidden;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
}
.stat-pill em { font-style: normal; font-size: 13px; line-height: 1; position: relative; z-index: 1; }
.stat-pill b { font-size: 14px; font-weight: 800; color: #fff; position: relative; z-index: 1; }
.pill-fill { position: absolute; left: 0; top: 0; bottom: 0; transition: width .6s ease; opacity: .28; }
.stat-pill.sp-atk b { color: #8ef0b0; }
.stat-pill.sp-def b { color: #8ec9ff; }
/* 滚动联动过渡 */
.pet-fixed { transition: transform .25s ease, opacity .25s ease; transform-origin: top center; }

/* v56.5：武器逐个图标（不计数），缩小放形象下侧居中 */
.pet-weapons {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 2px; right: auto; max-width: 92%;
  display: flex; gap: 2px; justify-content: center; flex-wrap: wrap;
  pointer-events: none;
}
.w-ico { width: 15px; height: 15px; object-fit: contain; display: block; opacity: .95; }

/* v56.6：武器行——单行靠右 + 浅底 */
.pet-weapons {
  left: auto; right: 4px; bottom: 3px; transform: none;
  flex-wrap: nowrap; overflow: hidden;
  justify-content: flex-end;
  background: rgba(255, 255, 255, .35);
  border-radius: 9px;
  padding: 2px 5px;
  backdrop-filter: blur(3px);
}

/* v56.7：去掉滚动联动；武器层提升到最上层（播放任何视频时都不消失） */
.pet-fixed { transition: none; transform: none !important; opacity: 1 !important; }
.pet-weapons { z-index: 6; }

/* v56.8：摸头加分反馈——开心胶囊跳动 + 飘字 */
@keyframes pillBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); box-shadow: 0 0 14px rgba(255, 207, 77, .85); border-color: rgba(255, 207, 77, .8); }
  100% { transform: scale(1); }
}
.stat-pill.bump { animation: pillBump .55s ease; z-index: 5; }
.happy-float {
  position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  font-size: 11px; font-weight: 800; color: #ffd76a; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
  animation: floatUp 1.15s ease forwards; pointer-events: none; z-index: 6;
}
@keyframes floatUp {
  0% { opacity: 0; translate: 0 6px; }
  20% { opacity: 1; }
  100% { opacity: 0; translate: 0 -22px; }
}

/* v56.9：点击粒子 */
.tap-particle {
  position: absolute; z-index: 7; pointer-events: none;
  line-height: 1; transform: translate(-50%, -50%);
  animation: tapBurst .8s cubic-bezier(.2, .7, .35, 1) forwards;
}
@keyframes tapBurst {
  0% { opacity: 0; scale: .4; }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    translate: var(--dx) var(--dy);
    rotate: var(--rot);
    scale: 1.15;
  }
}

/* v56.14：剑竖放紧凑排列 */
.pet-weapons { gap: 1px; padding: 2px 4px; }
.w-ico.w-sword { width: auto; height: 20px; }  /* 短粗小剑，与盾同高 */
.w-ico.w-shield { width: 20px; height: 20px; }

/* v56.20：视频层底色（修复交叉淡化时透出较小的静态图造成"缩小放大"错觉） */
.pet-stage.sp-golden .pet-live { background: linear-gradient(#ffffff, #f6f1ec); }
.pet-stage.sp-pomeranian .pet-live { background: linear-gradient(#fff8e7, #ffefc9); }

/* v56.21：单视频原生循环，常显无淡化 */
.pet-live .pl-v { opacity: 1 !important; transition: none !important; }

/* v56.25：最近动态 20 条 + 动作时间 */
.pet-log-row .pl-time { font-size: 11px; color: rgba(255,255,255,.42); margin-right: 6px; font-variant-numeric: tabular-nums; }

