/* ============================================================
   CodeLab · 宠物乐园（学生端）
   --------------------------------------------------------
   三个页面：我的宠物 / 宠物图鉴 / 宠物对战
   视觉 token（PET_SPEC 4.4）：
     米白 #FAF8F3（页底）· 深藏蓝 #142B5E（标题/强调）
     暖橙 #E67E22（CTA/高亮）· 浅米灰 #E7E1D4（描边）
     圆角：卡片 14px / 小卡 10px / 按钮 10px
   ⚠️ 所有类名统一 pet- 前缀，避免与既有样式冲突。
   ⚠️ 文字不许溢出/压框/重叠：flex 子项一律 min-width:0，
      长文本用 word-break，长列表用 grid minmax(0,1fr)。
   ============================================================ */

/* ---------- 页面底色 ---------- */
body.role-student .pet-page {
  background: #FAF8F3;
  border-radius: var(--r-l);
  padding: 18px;
  margin-bottom: 18px;
  min-height: 60vh;
}

/* ============================================================
   通用零件
   ============================================================ */
.pet-card {
  background: #fff;
  border: 1px solid #E7E1D4;
  border-radius: 14px;
  box-shadow: var(--sh-s);
  padding: 18px;
}
.pet-card-hd {
  display: flex; align-items: center; gap: 10px;
  justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 14px;
}
.pet-card-hd h3 {
  margin: 0; font-size: 15px; font-weight: 700; color: #142B5E;
  display: flex; align-items: center; gap: 7px; min-width: 0;
}
.pet-card-hd h3 > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-card-hd .desc { font-size: 12px; color: rgba(20,43,94,.55); }

/* 稀有度角标 */
.pet-rarity {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; flex: 0 0 auto;
}
.pet-rarity .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* 通用小进度条 */
.pet-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: #EFEAE0; position: relative;
}
.pet-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .45s ease; }
.pet-bar.sat > i { background: linear-gradient(90deg, #E67E22, #F0A85C); }
.pet-bar.mood > i { background: linear-gradient(90deg, #E85D8A, #F59CBB); }
.pet-bar.xp   > i { background: linear-gradient(90deg, #142B5E, #3C63A8); }
.pet-bar.task > i { background: linear-gradient(90deg, #0F6E56, #2FA98A); }

/* 经验环（SVG） */
.pet-ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.pet-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.pet-ring .track { fill: none; stroke: #EFEAE0; stroke-width: 8; }
.pet-ring .bar { fill: none; stroke: #E67E22; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.pet-ring .lbl {
  position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; line-height: 1.2; pointer-events: none;
}
.pet-ring .lbl b { display: block; font-size: 19px; font-weight: 800; color: #142B5E; font-family: var(--font-mono); }
.pet-ring .lbl small { display: block; font-size: 10.5px; color: rgba(20,43,94,.5); margin-top: 1px; }

/* 段落小标题 */
.pet-sec-t {
  font-size: 11.5px; font-weight: 700; color: rgba(20,43,94,.55);
  letter-spacing: .6px; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pet-sec-t::after { content: ''; flex: 1 1 12px; height: 1px; background: #EFE9DE; }

/* 空态 */
.pet-empty {
  text-align: center; padding: 46px 20px; color: rgba(20,43,94,.5);
}
.pet-empty .ic { font-size: 40px; margin-bottom: 10px; line-height: 1; }
.pet-empty .t { font-size: 15px; font-weight: 700; color: #142B5E; margin-bottom: 6px; }
.pet-empty .d { font-size: 13px; line-height: 1.7; margin-bottom: 18px; }

/* 加载中 */
.pet-loading { padding: 40px; text-align: center; color: rgba(20,43,94,.5); font-size: 13px; }

/* ============================================================
   ① 我的宠物（#/s/pet）
   ============================================================ */
.pet-home-grid {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 16px; align-items: start;
}

/* ---- 立绘主卡 ---- */
.pet-hero {
  background: linear-gradient(160deg, #FFFFFF 0%, #FFF7EC 100%);
  border: 1px solid #E7E1D4;
  border-radius: 14px; padding: 18px;
  box-shadow: var(--sh-s); text-align: center; position: relative; overflow: hidden;
}
.pet-hero::before {
  content: ''; position: absolute; left: 50%; top: -46px; transform: translateX(-50%);
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230,126,34,.13) 0%, rgba(230,126,34,0) 68%);
  pointer-events: none;
}
.pet-hero .art {
  position: relative; width: 190px; height: 190px; margin: 0 auto 10px;
}
.pet-hero .art img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(20,43,94,.16));
  animation: petBob 3.2s ease-in-out infinite;
}
@keyframes petBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.pet-hero .name {
  font-size: 21px; font-weight: 800; color: #142B5E; margin: 0 0 8px;
  overflow-wrap: anywhere; line-height: 1.3;
}
.pet-hero .tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.pet-hero .tags .tg {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #F3EFE6; color: rgba(20,43,94,.68); font-weight: 600;
  white-space: nowrap;
}
.pet-hero .stage-line {
  font-size: 12.5px; color: rgba(20,43,94,.55); margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.pet-hero .stage-line b { color: #E67E22; }

/* ---- 状态卡 ---- */
.pet-status-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pet-status-row .flex1 { flex: 1 1 220px; min-width: 0; }

.pet-stat {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.pet-stat .ic {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 16px;
}
.pet-stat.sat .ic { background: #FCEBD3; }
.pet-stat.mood .ic { background: #FBE4EE; }
.pet-stat .bd { flex: 1 1 auto; min-width: 0; }
.pet-stat .lb {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; font-size: 12.5px; color: rgba(20,43,94,.62); margin-bottom: 5px;
}
.pet-stat .lb b { font-family: var(--font-mono); font-size: 13px; color: #142B5E; font-weight: 700; }

/* 状态档位 */
.pet-tier {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: 10px;
  background: linear-gradient(135deg, #FFF4E2 0%, #FCEBD3 100%);
  border: 1px solid #F3D9B4;
}
.pet-tier .badge-ic { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.pet-tier .tx { min-width: 0; flex: 1 1 130px; }
.pet-tier .tx b { display: block; font-size: 13.5px; color: #142B5E; font-weight: 700; }
.pet-tier .tx small { display: block; font-size: 11.5px; color: rgba(20,43,94,.55); margin-top: 2px; }
.pet-tier .mult {
  font-family: var(--font-mono); font-size: 19px; font-weight: 800; color: #D26B12;
  flex: 0 0 auto; white-space: nowrap;
}

/* 经验条区 */
.pet-xp-box { margin-top: 14px; }
.pet-xp-box .lb {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  font-size: 12.5px; color: rgba(20,43,94,.62); margin-bottom: 6px;
}
.pet-xp-box .lb b { font-family: var(--font-mono); color: #142B5E; font-weight: 700; }
.pet-xp-box .hint { font-size: 11.5px; color: rgba(20,43,94,.5); margin-top: 6px; }

/* 操作按钮 */
.pet-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px; margin-top: 14px;
}
.pet-act {
  border: 1px solid #E7E1D4; background: #fff; border-radius: 10px;
  padding: 11px 8px; cursor: pointer; text-align: center;
  transition: all .18s ease; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 0; position: relative;
}
.pet-act:hover:not(:disabled) { border-color: #E67E22; background: #FFF8F0; transform: translateY(-1px); }
.pet-act:disabled { opacity: .55; cursor: not-allowed; }
.pet-act .ic { font-size: 19px; line-height: 1.1; }
.pet-act .lb { font-size: 12.5px; font-weight: 700; color: #142B5E; white-space: nowrap; }
.pet-act .cd { font-size: 10.5px; color: rgba(20,43,94,.5); font-family: var(--font-mono); white-space: nowrap; }
.pet-act.cool .cd { color: #C0392B; }
.pet-act.primary { background: #E67E22; border-color: #E67E22; }
.pet-act.primary .lb { color: #fff; }
.pet-act.primary .cd { color: rgba(255,255,255,.82); }
.pet-act.primary:hover:not(:disabled) { background: #D26B12; border-color: #D26B12; }

/* ---- 背包 / 房间 / 任务 / 战绩 ---- */
.pet-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px; margin-top: 16px; align-items: start;
}

.pet-inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.pet-inv {
  border: 1px solid #E7E1D4; border-radius: 10px; background: #fff;
  padding: 10px 8px; text-align: center; cursor: pointer;
  transition: all .18s ease; position: relative; min-width: 0;
}
.pet-inv:hover:not(:disabled) { border-color: #E67E22; transform: translateY(-2px); box-shadow: var(--sh-m); }
.pet-inv:disabled { opacity: .5; cursor: not-allowed; }
.pet-inv img { width: 46px; height: 46px; object-fit: contain; display: block; margin: 0 auto 6px; }
.pet-inv .nm {
  font-size: 12px; font-weight: 600; color: #142B5E; line-height: 1.35;
  overflow-wrap: anywhere;
}
.pet-inv .qt {
  position: absolute; top: 4px; right: 6px;
  font-size: 10.5px; font-family: var(--font-mono); font-weight: 700;
  color: #D26B12; background: #FCEBD3; border-radius: 999px; padding: 1px 6px;
}
.pet-inv .ef { font-size: 10.5px; color: rgba(20,43,94,.5); margin-top: 4px; font-family: var(--font-mono); }

.pet-room-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pet-room-slot {
  border: 1px solid #E7E1D4; border-radius: 10px; background: #FBF9F4;
  padding: 9px; text-align: center; min-width: 0;
}
.pet-room-slot .lb { font-size: 11px; color: rgba(20,43,94,.5); margin-bottom: 6px; }
.pet-room-slot .pic {
  height: 62px; border-radius: 8px; overflow: hidden;
  background: #F1ECE1; display: grid; place-items: center; margin-bottom: 6px;
}
.pet-room-slot .pic img { width: 100%; height: 100%; object-fit: contain; }
.pet-room-slot .nm {
  font-size: 11.5px; font-weight: 600; color: #142B5E;
  overflow-wrap: anywhere; line-height: 1.35;
}
.pet-room-slot.empty .nm { color: rgba(20,43,94,.35); font-weight: 400; }

/* ---------- 装备栏（2026-11-11）---------- */
.pet-gear-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pet-gear-slot {
  border: 1px solid #E7E1D4; border-radius: 10px; background: #FBF9F4;
  padding: 8px 6px; text-align: center; min-width: 0;
}
.pet-gear-slot img {
  width: 100%; height: 46px; object-fit: contain; display: block; margin-bottom: 5px;
}
.pet-gear-slot .nm {
  font-size: 11px; font-weight: 600; color: #142B5E;
  overflow-wrap: anywhere; line-height: 1.3;
}
.pet-gear-slot .ph { font-size: 11px; color: rgba(20,43,94,.35); }
.pet-gear-slot.empty { border-style: dashed; }

/* 每日任务 */
.pet-task {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px dashed #EFE9DE;
  min-width: 0;
}
.pet-task:last-child { border-bottom: 0; }
.pet-task .tx { flex: 1 1 auto; min-width: 0; }
.pet-task .tx .t {
  font-size: 13px; color: #142B5E; font-weight: 600; margin-bottom: 4px;
  overflow-wrap: anywhere;
}
.pet-task .tx .rw { font-size: 11.5px; color: rgba(20,43,94,.5); font-family: var(--font-mono); }
.pet-task .pb { width: 92px; flex: 0 0 auto; }
.pet-task .pb .lb {
  font-size: 10.5px; color: rgba(20,43,94,.5); text-align: right; margin-bottom: 3px;
  font-family: var(--font-mono);
}
.pet-task.done .tx .t { color: rgba(20,43,94,.45); text-decoration: line-through; }
.pet-task .btn { flex: 0 0 auto; }

/* 战绩 */
.pet-log { display: flex; flex-direction: column; gap: 8px; }
.pet-log-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border-radius: 10px; background: #FBF9F4;
  border: 1px solid #F0EBE0; font-size: 12.5px; min-width: 0;
}
.pet-log-row .rs {
  font-weight: 800; font-size: 12px; padding: 2px 9px; border-radius: 999px;
  flex: 0 0 auto; white-space: nowrap;
}
.pet-log-row .rs.win { background: #E1F5EE; color: #0F6E56; }
.pet-log-row .rs.lose { background: #FDE8E3; color: #C0392B; }
.pet-log-row .rs.draw { background: #F1F3F5; color: rgba(20,43,94,.62); }
.pet-log-row .op { color: rgba(20,43,94,.72); min-width: 0; overflow-wrap: anywhere; }
.pet-log-row .dt {
  margin-left: auto; font-size: 11px; color: rgba(20,43,94,.42);
  font-family: var(--font-mono); white-space: nowrap; flex: 0 0 auto;
}

/* ============================================================
   ② 宠物图鉴（#/s/petGuide）
   ============================================================ */
.pet-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #F1ECE1; border-radius: 10px; margin-bottom: 16px;
}
.pet-tabs button {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: rgba(20,43,94,.62); transition: all .18s ease; white-space: nowrap;
}
.pet-tabs button.on { background: #fff; color: #142B5E; box-shadow: var(--sh-s); }

/* 横向物种条 */
.pet-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.pet-strip::-webkit-scrollbar { height: 6px; }
.pet-strip::-webkit-scrollbar-thumb { background: #DED7C8; border-radius: 999px; }
.pet-strip-item {
  flex: 0 0 auto; width: 92px; scroll-snap-align: start;
  border: 1.5px solid #E7E1D4; border-radius: 12px; background: #fff;
  padding: 9px 6px 8px; text-align: center; cursor: pointer;
  transition: all .18s ease; position: relative;
}
.pet-strip-item:hover { border-color: #E67E22; transform: translateY(-2px); }
.pet-strip-item.on { border-color: #E67E22; background: #FFF8F0; box-shadow: 0 0 0 3px rgba(230,126,34,.12); }
.pet-strip-item .pic {
  width: 58px; height: 58px; margin: 0 auto 5px; position: relative;
}
.pet-strip-item .pic img { width: 100%; height: 100%; object-fit: contain; }
.pet-strip-item .rdot {
  position: absolute; right: 0; bottom: 0;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(20,43,94,.25);
}
.pet-strip-item .nm {
  font-size: 12px; font-weight: 700; color: #142B5E; line-height: 1.3;
  overflow-wrap: anywhere;
}
.pet-strip-item .rr { font-size: 10px; font-weight: 700; margin-top: 2px; }
.pet-strip-item .own {
  position: absolute; top: -6px; left: -4px;
  background: #0F6E56; color: #fff; font-size: 9.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; white-space: nowrap;
}

/* 图鉴主体：左大卡 + 右形态网格 */
.pet-guide-grid {
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 16px; align-items: start;
}

.pet-detail {
  background: #fff; border: 1px solid #E7E1D4; border-radius: 14px;
  padding: 18px; box-shadow: var(--sh-s); text-align: center;
}
.pet-detail .art {
  width: 176px; height: 176px; margin: 0 auto 8px; position: relative;
}
.pet-detail .art img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(20,43,94,.15));
}
.pet-detail .nm {
  font-size: 20px; font-weight: 800; color: #142B5E; margin: 4px 0 8px;
  overflow-wrap: anywhere; line-height: 1.3;
}
.pet-detail .quote {
  font-size: 12.5px; line-height: 1.8; color: rgba(20,43,94,.62);
  text-align: left; background: #FBF9F4; border-radius: 10px;
  padding: 11px 13px; margin: 12px 0; overflow-wrap: anywhere;
}
.pet-detail .ring-row {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 12px; border-radius: 10px; background: #F7F4EC; margin-bottom: 12px;
}
.pet-detail .ring-row .tx { min-width: 0; flex: 1 1 auto; }
.pet-detail .ring-row .tx b { display: block; font-size: 13px; color: #142B5E; font-weight: 700; }
.pet-detail .ring-row .tx small { display: block; font-size: 11.5px; color: rgba(20,43,94,.55); margin-top: 3px; }
.pet-detail .ring-row .tx .nmx { font-size: 12.5px; color: #E67E22; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }

.pet-adopt-btn {
  width: 100%; border: 0; cursor: pointer; font-family: inherit;
  background: #E67E22; color: #fff; border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s ease;
}
.pet-adopt-btn:hover:not(:disabled) { background: #D26B12; }
.pet-adopt-btn:disabled { background: #DDD6C6; cursor: not-allowed; }
.pet-adopt-btn .price {
  font-family: var(--font-mono); background: rgba(255,255,255,.22);
  border-radius: 999px; padding: 1px 9px; font-size: 12.5px;
}
.pet-adopt-note {
  font-size: 11.5px; color: rgba(20,43,94,.5); margin-top: 8px; line-height: 1.6;
}

/* 4×2 形态网格 */
.pet-forms {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.pet-form {
  border: 1.5px solid #E7E1D4; border-radius: 12px; background: #fff;
  padding: 10px; text-align: center; position: relative; overflow: hidden;
  min-width: 0;
}
.pet-form .pic {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 9px; overflow: hidden;
  background: #F7F4EC; position: relative; display: grid; place-items: center;
  margin-bottom: 8px;
}
.pet-form .pic img {
  width: 100%; height: 100%; object-fit: contain;
  transition: filter .25s ease, opacity .25s ease;
}
.pet-form .lv {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  background: #142B5E; color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; font-family: var(--font-mono);
}
.pet-form .nm {
  font-size: 12.5px; font-weight: 700; color: #142B5E; line-height: 1.35;
  overflow-wrap: anywhere;
}
.pet-form .st { font-size: 11px; color: #E67E22; font-weight: 700; margin-top: 2px; }
.pet-form .xp {
  font-size: 10.5px; color: rgba(20,43,94,.5); margin-top: 3px;
  font-family: var(--font-mono);
}
/* 未解锁：灰度 + 雾 + 锁 */
.pet-form.locked { background: #FAF8F3; border-style: dashed; }
.pet-form.locked .pic img { filter: grayscale(100%) brightness(.72) opacity(.45); }
.pet-form.locked .pic::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(250,248,243,.25) 0%, rgba(231,225,212,.85) 72%);
}
.pet-form.locked .nm { color: rgba(20,43,94,.42); }
.pet-form.locked .st { color: rgba(20,43,94,.32); }
.pet-form .lock {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 3; font-size: 20px; opacity: .8; pointer-events: none;
}
.pet-form .cur {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  background: #E67E22; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px;
}

/* ---- 徽章墙 ---- */
.pet-badge-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(0, 220px));
  gap: 14px;
}
.pet-badge {
  border: 1.5px solid #E7E1D4; border-radius: 14px; background: #fff;
  padding: 16px 14px; text-align: center; min-width: 0; position: relative;
}
.pet-badge .pic {
  width: 104px; height: 104px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 40%, #FFF6E8 0%, #F3EEE3 100%);
  border: 2px solid #EFE9DC;
}
.pet-badge .pic img { width: 84%; height: 84%; object-fit: contain; }
.pet-badge .nm { font-size: 14px; font-weight: 700; color: #142B5E; overflow-wrap: anywhere; }
.pet-badge .st { font-size: 11.5px; color: rgba(20,43,94,.5); margin-top: 4px; }
.pet-badge .bar { margin-top: 10px; }
.pet-badge .bar .lb {
  font-size: 10.5px; color: rgba(20,43,94,.5); margin-bottom: 4px;
  font-family: var(--font-mono);
}
.pet-badge.owned { border-color: #E67E22; box-shadow: 0 0 0 3px rgba(230,126,34,.12); }
.pet-badge.owned .pic { background: radial-gradient(circle at 50% 40%, #FFEBD2 0%, #F7DFBE 100%); border-color: #F0C98F; }
.pet-badge.owned .st { color: #0F6E56; font-weight: 600; }
.pet-badge.locked .pic img { filter: grayscale(100%) brightness(.72) opacity(.45); }

/* ============================================================
   ③ 宠物对战（#/s/petBattle）
   ============================================================ */
.pet-battle-lobby {
  background: linear-gradient(150deg, #142B5E 0%, #1F4483 62%, #2A5AA8 100%);
  border-radius: 14px; padding: 26px 22px; color: #fff;
  box-shadow: var(--sh-m); position: relative; overflow: hidden;
}
.pet-battle-lobby::before {
  content: ''; position: absolute; right: 0; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230,126,34,.28) 0%, rgba(230,126,34,0) 70%);
  pointer-events: none;
}
.pet-battle-lobby h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.pet-battle-lobby .sub { font-size: 13px; color: rgba(255,255,255,.72); line-height: 1.7; }
.pet-rank-big {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 18px 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  position: relative;
}
.pet-rank-big .ic {
  width: 54px; height: 54px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 26px;
  background: rgba(255,255,255,.14);
}
.pet-rank-big .tx { min-width: 0; flex: 1 1 150px; }
.pet-rank-big .tx b { display: block; font-size: 18px; font-weight: 800; }
.pet-rank-big .tx small { display: block; font-size: 12px; color: rgba(255,255,255,.7); margin-top: 3px; }
.pet-record { display: flex; gap: 16px; flex-wrap: wrap; }
.pet-record .it { text-align: center; min-width: 56px; }
.pet-record .it b { display: block; font-family: var(--font-mono); font-size: 22px; font-weight: 800; line-height: 1.1; }
.pet-record .it small { display: block; font-size: 11px; color: rgba(255,255,255,.65); margin-top: 3px; }
.pet-record .it.w b { color: #7BE0B4; }
.pet-record .it.l b { color: #FFA8A8; }

.pet-start-btn {
  border: 0; cursor: pointer; font-family: inherit;
  background: #E67E22; color: #fff; border-radius: 10px;
  padding: 13px 30px; font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .18s ease, transform .18s ease;
  position: relative;
}
.pet-start-btn:hover:not(:disabled) { background: #F08A33; transform: translateY(-1px); }
.pet-start-btn:disabled { opacity: .55; cursor: not-allowed; }

/* 段位榜 */
.pet-rank-list { display: flex; flex-direction: column; gap: 8px; }
.pet-rank-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 10px; background: #FBF9F4;
  border: 1px solid #F0EBE0; font-size: 13px; min-width: 0;
}
.pet-rank-row .no {
  width: 24px; text-align: center; font-family: var(--font-mono);
  font-weight: 800; color: rgba(20,43,94,.45); flex: 0 0 auto;
}
.pet-rank-row .no.top { color: #E67E22; }
.pet-rank-row .nm { font-weight: 600; color: #142B5E; min-width: 0; overflow-wrap: anywhere; }
.pet-rank-row .cls { font-size: 11.5px; color: rgba(20,43,94,.5); flex: 0 0 auto; }
.pet-rank-row .rt {
  margin-left: auto; font-family: var(--font-mono); font-weight: 800;
  color: #142B5E; flex: 0 0 auto;
}
.pet-rank-row .rk {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  flex: 0 0 auto; white-space: nowrap;
}

/* ---- 对战界面 ---- */
.pet-bt-hp {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px; align-items: center;
}
.pet-bt-side {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.pet-bt-side.right { flex-direction: row-reverse; }
.pet-bt-side .pic {
  width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto;
  background: #F5F1E8; display: grid; place-items: center; overflow: hidden;
  border: 1px solid #EDE7DA;
}
.pet-bt-side .pic img { width: 92%; height: 92%; object-fit: contain; }
.pet-bt-side .tx { min-width: 0; flex: 1 1 auto; }
.pet-bt-side .nm {
  font-size: 13.5px; font-weight: 700; color: #142B5E;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-bt-side .sub {
  font-size: 11px; color: rgba(20,43,94,.5); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-bt-vs {
  flex: 0 0 auto; font-family: var(--font-mono); font-weight: 800;
  font-size: 17px; color: #E67E22;
}
.pet-hp-bar {
  height: 7px; border-radius: 999px; background: #EFEAE0; overflow: hidden; margin-top: 5px;
}
.pet-hp-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .45s ease; }
.pet-hp-bar.me > i { background: linear-gradient(90deg, #1F4483, #4B7FD4); }
.pet-hp-bar.op > i { background: linear-gradient(90deg, #C0392B, #E8705F); }
.pet-bt-side.right .pet-hp-bar { transform: scaleX(-1); }

.pet-round-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: 10px; background: #FFF4E2;
  border: 1px solid #F3D9B4; margin-bottom: 14px;
}
.pet-round-bar .rd {
  font-family: var(--font-mono); font-weight: 800; font-size: 14px; color: #D26B12;
  flex: 0 0 auto;
}
.pet-round-bar .op-st {
  font-size: 12.5px; color: rgba(20,43,94,.62); min-width: 0;
  overflow-wrap: anywhere;
}
.pet-round-bar .op-st.done { color: #0F6E56; font-weight: 700; }

.pet-prob {
  border: 1px solid #E7E1D4; border-radius: 12px; background: #fff;
  padding: 14px 16px; margin-bottom: 14px;
}
.pet-prob .ttl {
  font-size: 14.5px; font-weight: 700; color: #142B5E; margin-bottom: 8px;
  overflow-wrap: anywhere; line-height: 1.45;
}
.pet-prob .dsc {
  font-size: 13px; line-height: 1.8; color: rgba(20,43,94,.75);
  white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 10px;
}
.pet-prob .sm {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px; margin-top: 8px;
}
.pet-prob .sm .bx {
  border: 1px solid #EFEAE0; border-radius: 9px; overflow: hidden; min-width: 0;
}
.pet-prob .sm .bx .h {
  font-size: 11px; font-weight: 700; color: rgba(20,43,94,.55);
  background: #F7F4EC; padding: 5px 10px; border-bottom: 1px solid #EFEAE0;
}
.pet-prob .sm .bx pre {
  margin: 0; padding: 9px 10px; font-family: var(--font-mono); font-size: 12px;
  color: #142B5E; white-space: pre-wrap; overflow-wrap: anywhere;
  background: #FCFBF7; max-height: 160px; overflow: auto;
}

/* 对战编辑器区（复用平台 .editor / .gutter / .code-hl 结构） */
.pet-editor-box {
  border: 1px solid #E7E1D4; border-radius: 12px; overflow: hidden;
  background: #fff; margin-bottom: 14px;
}
.pet-editor-box .code-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 10px; border-bottom: 1px solid #EFEAE0; background: #FBF9F4;
}
.pet-editor-box .code-tools .tip {
  font-size: 11.5px; color: rgba(20,43,94,.5); margin-right: auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-editor-box .editor { min-height: 240px; height: 260px; }
.pet-editor-box .editor textarea { font-size: 13.5px; line-height: 1.6; }

/* 判定结果 */
.pet-verdict {
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid; min-width: 0;
}
.pet-verdict .tg {
  font-family: var(--font-mono); font-weight: 800; font-size: 15px;
  padding: 3px 12px; border-radius: 8px; flex: 0 0 auto;
}
.pet-verdict .ms { font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.pet-verdict .dm { font-size: 12.5px; flex: 1 1 130px; min-width: 0; overflow-wrap: anywhere; }
.pet-verdict.ac { background: #E1F5EE; border-color: #C6E8D5; color: #0B6B36; }
.pet-verdict.wa { background: #FDE8E3; border-color: #F5C2C2; color: #96271A; }
.pet-verdict.wait { background: #FFF9F0; border-color: #F5DFB8; color: #92610B; }
.pet-verdict.wait .tg { background: #F5DFB8; color: #92610B; }
.pet-verdict.ac .tg { background: #0F6E56; color: #fff; }
.pet-verdict.wa .tg { background: #C0392B; color: #fff; }

/* 对战日志 */
.pet-bt-log {
  max-height: 168px; overflow-y: auto;
  border: 1px solid #EFEAE0; border-radius: 10px; background: #FBF9F4; padding: 10px 12px;
}
.pet-bt-log .ln {
  font-size: 12.5px; line-height: 1.7; color: rgba(20,43,94,.72);
  padding: 3px 0; overflow-wrap: anywhere;
}
.pet-bt-log .ln .rd {
  font-family: var(--font-mono); color: #E67E22; font-weight: 700; margin-right: 6px;
}

/* 结算弹层 */
.pet-result-mask {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(20,43,94,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px;
}
.pet-result {
  background: #fff; border-radius: 16px; padding: 26px 24px;
  max-width: 400px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(20,43,94,.3);
  max-height: 88vh; overflow-y: auto;
}
.pet-result .ttl { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.pet-result .ttl.win { color: #0F6E56; }
.pet-result .ttl.lose { color: #C0392B; }
.pet-result .ttl.draw { color: #142B5E; }
.pet-result .rsn { font-size: 13px; color: rgba(20,43,94,.6); margin-bottom: 18px; line-height: 1.7; }
.pet-result .rw {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px;
}
.pet-result .rw .it {
  border-radius: 10px; padding: 11px 8px; background: #F7F4EC; min-width: 0;
}
.pet-result .rw .it b {
  display: block; font-family: var(--font-mono); font-size: 21px; font-weight: 800; color: #E67E22;
}
.pet-result .rw .it small { display: block; font-size: 11px; color: rgba(20,43,94,.5); margin-top: 3px; }
.pet-result .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 匹配等待 */
.pet-waiting {
  text-align: center; padding: 40px 20px;
}
.pet-waiting .orb {
  width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #FFE0B8 0%, #E67E22 60%, #B8560C 100%);
  animation: petPulse 1.5s ease-in-out infinite;
}
@keyframes petPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.14); opacity: .78; }
}
.pet-waiting .t { font-size: 17px; font-weight: 700; color: #142B5E; margin-bottom: 6px; }
.pet-waiting .d { font-size: 13px; color: rgba(20,43,94,.55); line-height: 1.7; }

/* ============================================================
   响应式（窄屏 <900px 正常堆叠）
   ============================================================ */
@media (max-width: 900px) {
  body.role-student .pet-page { padding: 12px; }
  .pet-home-grid { grid-template-columns: minmax(0, 1fr); }
  .pet-guide-grid { grid-template-columns: minmax(0, 1fr); }
  .pet-forms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pet-battle-lobby { padding: 20px 16px; }
  .pet-bt-hp { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pet-bt-side.right { flex-direction: row; }
  .pet-bt-side.right .pet-hp-bar { transform: none; }
  .pet-bt-vs { text-align: center; }
  .pet-rank-row .cls { display: none; }
}
@media (max-width: 620px) {
  .pet-forms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pet-inv-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .pet-hero .art { width: 150px; height: 150px; }
  .pet-detail .art { width: 140px; height: 140px; }
  .pet-task { flex-wrap: wrap; }
  .pet-task .pb { width: 100%; order: 3; }
  .pet-task .pb .lb { text-align: left; }
}


/* ============================================================
   补充零件（主控实现时按实际 DOM 增补）
   ============================================================ */

/* ---------- 通用 ---------- */
.pet-hint { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.pet-empty-sm {
  padding: 22px 12px; text-align: center;
  font-size: 13px; color: var(--ink-3);
}
.tr {
  flex: 1 1 auto; min-width: 0; height: 8px;
  background: #F1EDE4; border-radius: 99px; overflow: hidden;
}
.tr > i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.pet-bar.sat .tr > i { background: linear-gradient(90deg, #6BD9B0, #2DD4A4); }
.pet-bar.mood .tr > i { background: linear-gradient(90deg, #FFB066, #FF8FB8); }
.pet-bar.xp .tr > i { background: linear-gradient(90deg, #74B6FF, #4DA8FF); }
.pet-bar.task .tr > i { background: linear-gradient(90deg, #E67E22, #FFB066); }
.pet-bar > b {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  color: var(--ink-2); flex: 0 0 auto; min-width: 46px; text-align: right;
}

/* ---------- 我的宠物 · Hero ---------- */
.pet-hero {
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 0%, #FBF6EC 100%);
  border: 1px solid #E7E1D4; border-radius: 14px;
  box-shadow: var(--sh-s); padding: 18px; margin-bottom: 16px;
}
.pet-hero-pic {
  flex: 0 0 auto; width: 168px; height: 168px;
  background: radial-gradient(circle at 50% 45%, #FFF6E8 0%, #F4EEE2 100%);
  border-radius: 14px; border: 1px solid #EDE6D8;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pet-hero-pic img { max-width: 94%; max-height: 94%; object-fit: contain; }
.pet-hero-info { flex: 1 1 260px; min-width: 0; }
.pet-hero-info h2 {
  margin: 8px 0 6px; font-size: 24px; font-weight: 800; color: #142B5E;
  overflow-wrap: anywhere;
}
.pet-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.pet-meta .lv, .pet-meta .el {
  font-size: 12px; font-weight: 700; color: #142B5E;
  background: var(--c-navy-soft); padding: 3px 9px; border-radius: 99px;
}
.pet-meta .el { background: var(--c-orange-soft); color: var(--c-orange-2); }
.pet-tier {
  font-size: 12.5px; font-weight: 700; color: var(--c-orange-2);
  background: var(--c-orange-soft); padding: 3px 10px; border-radius: 99px;
}
.pet-tier b { font-family: var(--font-mono); }
.pet-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pet-bar { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pet-bar > span {
  flex: 0 0 auto; width: 34px; font-size: 11.5px; color: var(--ink-3); font-weight: 700;
}
.pet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pet-coins { font-size: 12.5px; color: var(--ink-2); }
.pet-coins b { font-family: var(--font-mono); color: var(--c-orange-2); font-size: 14px; }

/* ---------- 网格 ---------- */
.pet-home-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.pet-hero + .pet-home-grid { margin-top: 0; }

/* ---------- 背包 / 任务 / 房间 ---------- */
.pet-inv-grid {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}
.pet-inv-item {
  background: #FBF8F2; border: 1px solid #EDE6D8; border-radius: 10px;
  padding: 8px 6px; text-align: center; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  min-width: 0;
}
.pet-inv-item:hover { transform: translateY(-2px); border-color: var(--c-orange); }
.pet-inv-item img {
  width: 40px; height: 40px; object-fit: contain; display: block; margin: 0 auto 4px;
}
.pet-inv-item .nm {
  display: block; font-size: 11px; color: #142B5E; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-inv-item .qty {
  display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
}
.pet-task-list { display: flex; flex-direction: column; gap: 8px; }
.pet-task {
  display: flex; align-items: center; gap: 10px;
  background: #FBF8F2; border: 1px solid #EDE6D8; border-radius: 10px; padding: 9px 11px;
  min-width: 0;
}
.pet-task.done { opacity: .78; }
.pet-task .tx { flex: 1 1 auto; min-width: 0; }
.pet-task .tx b {
  display: block; font-size: 13px; color: #142B5E; font-weight: 700;
  overflow-wrap: anywhere;
}
.pet-task .tx small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.pet-room-grid { display: grid; gap: 9px; grid-template-columns: repeat(3, 1fr); }
.pet-room-slot {
  background: #FBF8F2; border: 1px solid #EDE6D8; border-radius: 10px;
  padding: 9px; text-align: center; cursor: pointer; min-width: 0;
}
.pet-room-slot img { width: 100%; height: 46px; object-fit: contain; display: block; }
.pet-room-slot span { display: block; font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.pet-room-slot .ph { color: var(--ink-3); margin-top: 20px; }
.pet-badge-win {
  margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--c-orange-2);
  background: var(--c-orange-soft); padding: 6px 11px; border-radius: 10px; text-align: center;
}

/* ---------- 空态 ---------- */
.pet-empty {
  background: #fff; border: 1px solid #E7E1D4; border-radius: 14px;
  box-shadow: var(--sh-s); padding: 40px 20px; text-align: center;
}
.pet-empty-pic { width: 140px; height: 140px; margin: 0 auto 14px; }
.pet-empty-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pet-empty h3 { margin: 0 0 8px; font-size: 19px; color: #142B5E; }
.pet-empty p { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.pet-empty-actions {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}

/* ---------- 图鉴 ---------- */
.pet-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.pet-tab {
  border: 1px solid #E7E1D4; background: #fff; color: var(--ink-2);
  padding: 7px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.pet-tab.on { background: #142B5E; color: #fff; border-color: #142B5E; }
.pet-strip {
  display: flex; gap: 9px; overflow-x: auto; padding: 11px;
  background: #fff; border: 1px solid #E7E1D4; border-radius: 14px;
  box-shadow: var(--sh-s); margin-bottom: 14px;
}
.pet-strip-item {
  flex: 0 0 auto; width: 84px; text-align: center; cursor: pointer;
  padding: 7px 4px; border-radius: 10px; border: 2px solid transparent;
  transition: all .15s ease; position: relative; background: #FBF8F2;
}
.pet-strip-item:hover { background: #F6F1E6; }
.pet-strip-item.on { border-color: var(--c-orange); background: var(--c-orange-soft); }
.pet-strip-item img {
  width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto;
}
.pet-strip-item .nm {
  display: block; font-size: 11px; font-weight: 600; color: #142B5E; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-strip-item .dot {
  display: block; width: 7px; height: 7px; border-radius: 50%; margin: 3px auto 0;
}

/* 🔴 2026-11-26：已拥有标记显示在**名字下方**（原来只是名字后一个 ✓）。
   空占位（.own-txt 不带 .on）高度一致 → 未拥有/已拥有的格子底部对齐。 */
.pet-strip-item .own-txt {
  display: block; height: 14px; line-height: 14px; margin-top: 1px;
  font-size: 10px; font-weight: 700; color: #0F6E56; text-align: center;
}

/* 左侧大卡：宠物名下面的「已拥有」标记 */
.pet-owned-tag {
  display: inline-block; margin: 4px 0 2px; padding: 2px 10px;
  border-radius: 999px; background: #0F6E56; color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
}
/* 🔴 2026-11-26：老师要求「已拥有」标记移到下面（原来领养按钮的位置），
   已拥有时不再显示「再领养一只」按钮 → 这个位置空出来放标记 */
.pet-owned-tag.bottom {
  display: block; width: 100%; margin: 0; padding: 9px 12px;
  border-radius: 10px; text-align: center; font-size: 13px; line-height: 1.4;
}
.pet-guide-grid {
  display: grid; gap: 14px; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}
.pet-detail {
  background: #fff; border: 1px solid #E7E1D4; border-radius: 14px;
  box-shadow: var(--sh-s); padding: 18px; text-align: center;
}
.pet-detail-pic {
  width: 190px; height: 190px; margin: 10px auto 6px;
  background: radial-gradient(circle at 50% 45%, #FFF6E8 0%, #F4EEE2 100%);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.pet-detail-pic img { max-width: 92%; max-height: 92%; object-fit: contain; }
.pet-detail h2 { margin: 6px 0 4px; font-size: 21px; color: #142B5E; }
.pet-detail-stage {
  display: block; width: fit-content; margin: 0 auto 8px;
  font-size: 12px; font-weight: 700; color: #142B5E;
  background: #E7E1D4; padding: 3px 11px; border-radius: 99px;
}
.pet-trait {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--c-orange-2);
  background: var(--c-orange-soft); padding: 3px 11px; border-radius: 99px; margin-bottom: 10px;
}
.pet-quote {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.75; text-align: left;
  margin: 0 0 12px; overflow-wrap: anywhere;
}
.pet-ring-wrap { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 12px 0; }
.pet-ring { flex: 0 0 auto; }
.pet-ring-tx { font-size: 13px; font-weight: 700; color: #142B5E; }
.pet-adopt-btn { width: 100%; }
.pet-adopt-note { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.pet-forms-wrap {
  background: #fff; border: 1px solid #E7E1D4; border-radius: 14px;
  box-shadow: var(--sh-s); padding: 18px;
}
.pet-guide-grid-forms {
  display: grid; gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}
.pet-form {
  position: relative; background: #FBF8F2; border: 1px solid #EDE6D8;
  border-radius: 10px; padding: 8px; text-align: center; min-width: 0;
}
.pet-form img {
  width: 100%; height: 78px; object-fit: contain; display: block; margin: 0 auto 4px;
}
.pet-form .lv {
  position: absolute; top: 6px; left: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--c-orange-2);
  background: var(--c-orange-soft); padding: 1px 6px; border-radius: 99px;
}
.pet-form .nm { display: block; font-size: 11.5px; color: #142B5E; font-weight: 600; }
.pet-form .xp { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.pet-form .lock { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 19px; }
.pet-form.locked img {
  filter: grayscale(100%) brightness(.72); opacity: .45;
}
.pet-form.locked .nm, .pet-form.locked .xp { opacity: .55; }

/* ---------- 对战 ---------- */
.pet-battle-stage {
  background: linear-gradient(180deg, #142B5E 0%, #1B3A78 100%);
  border-radius: 14px; padding: 18px; color: #fff;
  box-shadow: var(--sh-s);
}
.pet-round-bar {
  text-align: center; font-size: 13px; font-weight: 700; color: #FFFFFF;
  background: rgba(255,255,255,.14); border-radius: 99px;
  padding: 7px 16px; margin: 0 auto 14px; width: fit-content; max-width: 100%;
}
.pet-bt-hp {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.pet-bt-side {
  flex: 1 1 240px; min-width: 0; display: flex; gap: 11px; align-items: center;
  background: rgba(255,255,255,.1); border-radius: 12px; padding: 11px;
}
.pet-bt-side.right { flex-direction: row-reverse; text-align: right; }
.pet-bt-side .pic {
  flex: 0 0 auto; width: 62px; height: 62px; border-radius: 10px;
  background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center;
}
.pet-bt-side .pic img { width: 92%; height: 92%; object-fit: contain; }
.pet-bt-side .tx { min-width: 0; flex: 1 1 auto; }
.pet-bt-side .nm {
  font-size: 14px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-bt-side .nm .ai {
  font-size: 10px; background: rgba(255,255,255,.25); padding: 1px 6px;
  border-radius: 99px; margin-left: 4px; font-weight: 600;
}
.pet-bt-side .sub { font-size: 11px; color: rgba(255,255,255,.7); margin: 2px 0 5px; }
.pet-bt-vs {
  flex: 0 0 auto; font-size: 17px; font-weight: 800; color: var(--c-orange-vivid);
}
.pet-hp-bar {
  position: relative; height: 15px; border-radius: 99px; overflow: hidden;
  background: rgba(0,0,0,.28); margin-top: 4px;
}
.pet-hp-bar > i {
  display: block; height: 100%; border-radius: 99px; transition: width .45s ease;
}
.pet-hp-bar.me > i { background: linear-gradient(90deg, #6BD9B0, #2DD4A4); }
.pet-hp-bar.op > i { background: linear-gradient(90deg, #FF8FB8, #FF6B9D); }
.pet-hp-bar > span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.pet-skill-zone {
  background: #FFFFFF; border-radius: 12px; padding: 14px; color: var(--ink-2);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.pet-skill-tx { font-size: 13px; font-weight: 700; color: #142B5E; margin-bottom: 9px; }
.pet-skill-list { display: grid; gap: 9px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.pet-skill {
  background: #FBF8F2; border: 1.5px solid #EDE6D8; border-radius: 10px;
  padding: 10px; text-align: left; cursor: pointer; min-width: 0;
  transition: all .15s ease; font-family: inherit;
}
.pet-skill:hover:not(:disabled) { border-color: var(--c-orange); transform: translateY(-2px); }
.pet-skill b { display: block; font-size: 13.5px; color: #142B5E; margin-bottom: 3px; }
.pet-skill small {
  display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  margin-bottom: 3px;
}
.pet-skill em { display: block; font-size: 11px; color: var(--ink-2); font-style: normal; line-height: 1.5; }
.pet-skill.lack { opacity: .45; cursor: not-allowed; }
.pet-energy {
  font-size: 12px; color: var(--ink-3); margin-top: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pet-energy b { font-family: var(--font-mono); color: var(--c-orange-2); font-size: 13px; }
.pet-energy-bar {
  flex: 0 0 130px; height: 7px; border-radius: 99px;
  background: #F1EDE4; overflow: hidden;
}
.pet-energy-bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #74B6FF, #E67E22);
  transition: width .35s ease;
}
.pet-energy em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.pet-waiting {
  text-align: center; padding: 22px 10px; font-size: 14px; font-weight: 700; color: #142B5E;
}
/* ★ 战斗日志用独立类名，避开「战绩列表」的 .pet-log（白底） */
.pet-bt-log {
  margin-top: 14px; max-height: 160px; overflow-y: auto;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pet-bt-log-row {
  font-size: 12.5px; color: #FFFFFF; line-height: 1.8;
  overflow-wrap: anywhere; font-weight: 500;
  background: transparent; border: none; padding: 2px 0; border-radius: 0;
}
.pet-bt-actions { margin-top: 14px; display: flex; justify-content: center; }
.pet-bt-actions .btn {
  background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3);
}
.pet-result-mask {
  position: fixed; inset: 0; background: rgba(20,43,94,.55);
  display: flex; align-items: center; justify-content: center; z-index: 900; padding: 20px;
}
.pet-result {
  background: #fff; border-radius: 14px; padding: 26px 24px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.pet-result h2 { margin: 0 0 6px; font-size: 25px; font-weight: 800; }
.pet-result-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.pet-result-gain {
  font-size: 14px; color: var(--ink-2); background: #FBF8F2;
  border-radius: 10px; padding: 11px; margin-bottom: 16px;
}
.pet-result-gain b { font-family: var(--font-mono); color: var(--c-orange-2); font-size: 17px; }
.pet-result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pet-record-list { display: flex; flex-direction: column; gap: 7px; }
.pet-record {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  background: #FBF8F2; border: 1px solid #EDE6D8; border-radius: 10px; padding: 8px 11px;
}
.pet-record .rs {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; color: #fff;
  padding: 2px 9px; border-radius: 99px;
}
.pet-record .rs.win { background: var(--c-ok); }
.pet-record .rs.lose { background: var(--c-ink-3); }
.pet-record .rs.draw { background: var(--c-navy-2); }
.pet-record .op { flex: 1 1 auto; font-size: 12.5px; color: #142B5E; min-width: 0; overflow-wrap: anywhere; }
.pet-record .rw { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-orange-2); }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .pet-guide-grid { grid-template-columns: 1fr; }
  .pet-guide-grid-forms { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pet-hero-pic { width: 128px; height: 128px; }
  .pet-skill-list { grid-template-columns: 1fr; }
  .pet-room-grid { grid-template-columns: 1fr; }
  .pet-bt-side.right { flex-direction: row; text-align: left; }
}
@media (max-width: 560px) {
  .pet-home-grid { grid-template-columns: 1fr; }
  .pet-guide-grid-forms { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pet-hero-info h2 { font-size: 20px; }
}


/* ============================================================
   Q宠大乱斗 · 今日对手列表
   ============================================================ */
.pet-rank-big2 {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex: 0 0 auto; min-width: 0;
}
.pet-rank-big2 span { font-size: 12px; color: rgba(255,255,255,.85); white-space: nowrap; }
.pet-rank-big2 span:first-child { font-weight: 700; color: #fff; font-size: 13px; }

.pet-opponent-list {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.pet-opponent {
  display: flex; align-items: center; gap: 11px;
  background: #FBF8F2; border: 1px solid #EDE6D8; border-radius: 10px;
  padding: 10px 12px; min-width: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.pet-opponent:hover { border-color: var(--c-orange); transform: translateY(-1px); }
.pet-opponent.beaten { opacity: .6; background: #F6F4EF; }
.pet-opponent .pic {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, #FFF6E8 0%, #F1EBDE 100%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pet-opponent .pic img { width: 92%; height: 92%; object-fit: contain; }
.pet-opponent .tx { flex: 1 1 auto; min-width: 0; }
.pet-opponent .nm {
  font-size: 13.5px; font-weight: 700; color: #142B5E;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-opponent .nm .ai {
  font-size: 10px; background: var(--c-navy-soft); color: var(--c-navy-2);
  padding: 1px 6px; border-radius: 99px; margin-left: 4px; font-weight: 600;
}
.pet-opponent .sub {
  font-size: 11px; color: var(--ink-3); margin: 2px 0 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-opponent .stars { font-size: 13px; color: var(--c-orange); letter-spacing: 1px; }
.pet-opponent .stars .dim { color: #DDD5C6; font-style: normal; }
.pet-opponent .stars b {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  margin-left: 4px; font-weight: 700;
}
.pet-opponent .stars em {
  font-style: normal; font-size: 11px; color: var(--ink-3);
  margin-left: 6px; letter-spacing: 0;
}
.pet-opponent .go { flex: 0 0 auto; }
.pet-opponent .done-flag {
  font-size: 11px; font-weight: 700; color: var(--c-ok);
  background: var(--c-ok-bg); padding: 3px 9px; border-radius: 99px;
}

/* 普通攻击按钮略突出 */
.pet-skill.basic { border-color: #E7E1D4; background: #F6F2EA; }
.pet-skill.basic:hover:not(:disabled) { border-color: var(--c-navy); }

/* 结算里的奖励 / 惩罚 */
.pet-result-gain b.bad { color: var(--c-err); }
.pet-result-msg {
  font-size: 12px; color: var(--ink-3); line-height: 1.6;
  margin: -6px 0 14px; overflow-wrap: anywhere;
}
.pet-rw-bonus {
  margin-top: 7px; font-size: 12.5px; font-weight: 700; color: var(--c-orange-2);
}
.pet-rw-note {
  margin-top: 7px; font-size: 11.5px; color: var(--ink-3);
}

/* ============================================================
   宠物互动页（舞台 + 动作 + 台词 + 动画）
   ============================================================ */
.pet-play-wrap { display: grid; gap: 14px; }
.pet-play-stage {
  position: relative; height: 400px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #F6F1E8 0%, #F1E7D6 58%, #E9D3A8 58%, #DCBE8C 100%);
  box-shadow: var(--sh-s); border: 1px solid #E7E1D4;
}
.pet-play-sky { position: absolute; inset: 0 0 42% 0; pointer-events: none; }
.pet-play-clouds i {
  position: absolute; width: 110px; height: 34px; border-radius: 99px;
  background: rgba(255,255,255,.72); filter: blur(1px);
}
.pet-play-clouds i:nth-child(1) { left: 8%;  top: 12%; animation: petCloud 26s linear infinite; }
.pet-play-clouds i:nth-child(2) { left: 48%; top: 22%; animation: petCloud 34s linear infinite -8s; transform: scale(.75); }
.pet-play-clouds i:nth-child(3) { left: 76%; top: 8%;  animation: petCloud 30s linear infinite -16s; transform: scale(.6); }
@keyframes petCloud { 0% { margin-left: -40px; } 50% { margin-left: 40px; } 100% { margin-left: -40px; } }

/* ---------- 房间层（2026-11-19 对齐 steam.fun 原生房间） ----------
   🔴 三处根因，之前把平台原厂素材做成了"半透明蒙层"，导致房间发灰发假：
   1. 墙/地板 opacity .55/.6 → 改成 1（实底）
   2. background-size 用 auto 100% + repeat-x → **不能用 cover**：
      素材是 512×512 方图，cover 会按宽放大到舞台宽（1080+），
      垂直方向被裁掉一大半 → 墙只剩踢脚线、地板只剩一条边（实测翻车）
      auto 100% + repeat-x 才是"纵向压到槽高、横向平铺"，
      能保住地板素材自带的近大远小竖条透视
   3. 飘云是纯色圆角矩形（很假），平台房间没有飘云 → 有墙时隐藏
   4. 墙脚补一条投影带，墙与地板的接缝不生硬
*/
.pet-play-deco { position: absolute; pointer-events: none; background-repeat: repeat; }
/* 🔴 2026-11-19 精确铺贴参数（逐行测量 12 张素材得出，结构完全一致）：
     所有房间素材都是「上下各约 83px 纯色留白 + 中间 y83~426 是内容」的同一套模板，
     有效内容占比 f ≈ 0.667。
     → 墙：background-size: auto 150% + background-position: center 50%
        （图内 y=85 精确对齐容器顶、y=425 对齐容器底 → 壁纸填满、踢脚线正好落在墙脚、无白带）
     → 地板：把地板层改成房间进深的 **30%（墙 70% / 地 30%，真实房间比例）**，
        图放大到 auto 118% 让图**溢出裁切**、底部浅色留白被裁掉 →
        纹理一直铺到地板层底：无缝、无分界、不露舞台底色；
        V 单元约 193px（820 宽里 4.2 个），密度比原来（246px / 3.3 个）自然得多。
        ⚠️ 不用两向 repeat：人字拼垂直重复会错位，产生横向接缝。
        ⚠️ 铺贴不到的部分由**同色背景色**补齐（floorBg，见 data-pets.js）。 */
.pet-play-deco.wall   { inset: 0 0 30% 0; background-size: auto 150%; background-position: center 50%;
  background-repeat: repeat-x; opacity: 1; }
.pet-play-deco.floor  { inset: 70% 0 0 0; background-size: auto 118%; background-position: 0% -106%;
  background-repeat: repeat-x; opacity: 1; }
.pet-play-deco.window { left: 50%; top: 1.5%; width: 196px; height: 156px; transform: translateX(-50%);
  background-size: contain; background-repeat: no-repeat; background-position: center; opacity: 1;
  filter: drop-shadow(0 5px 12px rgba(20,43,94,.22)); }
.pet-play-stage.has-wall .pet-play-clouds { display: none; }
/* 整幅型墙（森林/星空/海滩/胡萝卜）：一张完整风景 → 铺满整个舞台，地板层隐藏
   （cover + center 50% 恰好让图的有效内容区 y83~426 完整显示，不裁不拉伸） */
.pet-play-stage.has-wall-full .pet-play-deco.wall {
  inset: 0; background-size: cover; background-position: center 50%; background-repeat: no-repeat; opacity: 1;
}
.pet-play-stage.has-wall-full .pet-play-deco.floor { display: none; }
.pet-play-stage.has-wall-full .pet-play-clouds { display: none; }
.pet-play-stage.has-wall-full::after { display: none; }
/* 墙脚接缝：一道很淡的投影，让壁纸与地板之间有层次（踢脚线已在贴图里，这里只补一点点） */
.pet-play-stage::after {
  content: ''; position: absolute; left: 0; right: 0; top: 70%; height: 10px; z-index: 1;
  pointer-events: none; background: linear-gradient(180deg, rgba(120,92,52,.10), rgba(120,92,52,0));
}

.pet-play-bubble {
  position: absolute; left: 50%; top: 6%; transform: translate(-50%, 8px);
  max-width: min(76%, 420px); padding: 9px 16px; border-radius: 14px;
  background: var(--ex-bg, #FFFDF8); color: #142B5E; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(20,43,94,.16); text-align: center;
  opacity: 0; transition: opacity .22s ease, transform .22s ease; pointer-events: none; z-index: 4;
}
.pet-play-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 8px solid var(--ex-bg, #FFFDF8);
}
.pet-play-bubble.show { opacity: 1; transform: translate(-50%, 0); }

/* 容器保持稳定（可点击 / 自动化可命中），动画全部落在 img 上 */
.pet-play-pet {
  position: absolute; left: 50%; bottom: 4%; width: 300px; height: 320px;
  transform: translateX(-50%); cursor: pointer; z-index: 3;
}
/* ---------- 装备叠加层（2026-11-11）----------
   装备图与宠物立绘同坐标系（都是 512×512）→ 用百分比锚点直接叠。
   pointer-events:none 让点击穿透到宠物（点击宠物有互动动画）。 */
.pet-gear-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  transform-origin: 50% 90%;
  animation: petIdle 3.2s ease-in-out infinite;
}
/* 背包/火箭包这类要画在角色**身后** → 单独一层，z 序在立绘之下 */
.pet-gear-layer.back { z-index: 0; }
/* ⚠️ 动作图与基础立绘构图完全不同（姿势/比例/角色画风都变）→ 播放动作时先收起装备层，
   否则帽子会飘在错位的地方。常驻表情（expr-*）不切图，装备保持显示。 */
.pet-gear-layer { transition: opacity .18s ease; }
.pet-play-pet[class*="act-"] .pet-gear-layer { opacity: 0; }
.pet-gear-item {
  position: absolute; display: block;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 4px rgba(60,40,20,.22));
}
.pet-gear-item img {
  width: 100%; height: auto; display: block; object-fit: contain;
}
/* 宠物动作时装备层跟着一起动（同一节奏） */
.pet-play-pet.act-tap .pet-gear-layer,
.pet-play-pet.act-pat .pet-gear-layer,
.pet-play-pet.act-feed .pet-gear-layer,
.pet-play-pet.act-play .pet-gear-layer,
.pet-play-pet.act-sleep .pet-gear-layer {
  animation: petIdle 3.2s ease-in-out infinite;
}
/* 商店里的装备卡片 */
.pet-gear-card.locked { opacity: .5; }
.pet-gear-card .pet-tier-ex { background: #F1EFE8 !important; color: #854F0B !important; }
.pet-gear-summary {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  background: #F6F1FF; color: #5A2CA0; font-size: 12px; font-weight: 500;
}
.pet-gear-off { background: #F1EFE8 !important; color: #5F5E5A !important; }
/* 稀有度角标 */
.pet-tier {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 500;
  vertical-align: middle;
}
.pet-play-pet img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 90%;
  filter: drop-shadow(0 10px 12px rgba(80,60,30,.18));
  animation: petIdle 3.2s ease-in-out infinite;
}
.pet-play-pet:hover { filter: brightness(1.04); }
@keyframes petIdle {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-9px) scale(1.02); }
}
.pet-play-pet.act-tap img   { animation: petTap .7s ease; }
.pet-play-pet.act-pat img   { animation: petPat .95s ease; }
.pet-play-pet.act-feed img  { animation: petFeed 1s ease; }
.pet-play-pet.act-play img  { animation: petPlay 1s ease; }
.pet-play-pet.act-sleep img { animation: petSleep 1.6s ease; }
/* 表情条预览用的立绘动作 */
.pet-play-pet.act-happy img  { animation: petHappy 1s ease; }
.pet-play-pet.act-hungry img { animation: petHungry 1.1s ease; }
.pet-play-pet.act-sad img    { animation: petSad 1.2s ease; }
/* 🔴🔴 2026-11-26 21:40 老师截图：「点一下宠物就变扁了」
 *
 * 根因：这几条关键帧用的是**非等比缩放** scale(x, y)。
 *   实测（Playwright，本地实跑）：点宠物 → shy 表情 → act-tap → petTap
 *   → transform = matrix(1.0933, 0, 0, 0.9067, 0, 0)
 *   → 横向拉宽 9.3% + 纵向压扁 9.3% → 立绘当场变形。
 *
 * ✅ 修法：**只用等比 scale**，动作感改用「位移 / 旋转 / 缩放」组合表达，
 *    绝不再出现 scale(x, y) 这种非等比写法。
 */
@keyframes petTap   { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-11px) scale(1.07); } 70% { transform: translateY(3px) scale(.97); } }
@keyframes petPat   { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg) translateY(-6px); } 55% { transform: rotate(8deg) translateY(-10px); } }
@keyframes petFeed  { 0%,100% { transform: translateY(0) scale(1); } 25% { transform: translateY(-7px) scale(1.06); } 45% { transform: translateY(3px) scale(.96); } 70% { transform: translateY(-2px) scale(1.03); } }
@keyframes petPlay  { 0% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-42px) rotate(-12deg); } 70% { transform: translateY(-6px) rotate(10deg); } 100% { transform: translateY(0) rotate(0); } }
@keyframes petSleep { 0%,100% { transform: translateY(0) scale(1); } 30%,70% { transform: translateY(10px) scale(1.02); } }
@keyframes petHappy { 0%,100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-34px) scale(1.06); } 70% { transform: translateY(-4px) scale(.98); } }
@keyframes petHungry{ 0%,100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-5deg) scale(1.03); } 75% { transform: rotate(5deg) scale(1.03); } }
@keyframes petSad   { 0%,100% { transform: translateY(0) scale(1); } 45%,70% { transform: translateY(10px) scale(.97); } }
.pet-play-stage.is-weak .pet-play-pet { filter: grayscale(.55) brightness(.9); }
.pet-play-stage.is-weak .pet-play-pet img { animation-duration: 5s; }

/* ---------- steam.fun 同款互动视频层（2026-11-14） ----------
   视频自带 alpha（VP9 alpha_mode=1），浏览器直接透明叠在场景上；
   不要用 mix-blend-mode:screen —— 浅色角色会被冲成一片白。 */
.pet-anim-layer {
  position: absolute; inset: 0; z-index: 1; display: none; pointer-events: none;
}
.pet-anim-layer.on { display: block; }
.pet-anim-v {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transform-origin: 50% 90%;
  filter: drop-shadow(0 10px 12px rgba(80,60,30,.18));
  transition: opacity .18s ease;
}
#petAnimBase { opacity: 1; }
#petAnimOver { opacity: 0; }
/* 视频里已是完整角色 → 收起静态立绘与装备层，避免双影 / 两个帽子。
   同时停掉 petIdle 呼吸缩放（scale(1.02) 会让父节点多出 3px 横向溢出）。 */
.pet-play-stage.has-anim .pet-play-pet > img { opacity: 0; animation: none; }
.pet-play-stage.has-anim .pet-gear-layer { display: none !important; }
/* weak 视频本身已经耷拉眼，不再额外叠灰度 */
.pet-play-stage.is-weak.has-anim .pet-play-pet { filter: none; }

.pet-play-fx { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.pet-fx {
  position: absolute; bottom: 34%; font-size: 22px; font-style: normal;
  opacity: 0; animation: petFxUp 1.35s ease-out forwards;
}
@keyframes petFxUp {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6) rotate(0); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 40px), -150px) scale(1.25) rotate(var(--rot, 20deg)); }
}

.pet-play-nameplate {
  position: absolute; left: 14px; bottom: 12px; z-index: 4;
  background: rgba(255,253,248,.92); border-radius: 10px; padding: 7px 12px;
  display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(20,43,94,.12);
}
.pet-play-nameplate b { font-size: 14px; color: #142B5E; }
.pet-play-nameplate span { font-size: 11px; color: #6B7280; }
.pet-play-weak {
  position: absolute; right: 12px; top: 12px; z-index: 4;
  background: rgba(192,57,43,.92); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 7px 11px; border-radius: 99px;
}

.pet-play-bars {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.pet-play-bar {
  display: flex; align-items: center; gap: 8px; background: #FFFDF8;
  border: 1px solid #E7E1D4; border-radius: 10px; padding: 9px 12px; font-size: 12px;
}
.pet-play-bar > span { flex: 0 0 auto; color: #142B5E; font-weight: 700; white-space: nowrap; }
.pet-play-bar .tr { flex: 1 1 auto; height: 9px; border-radius: 99px; background: #EFEAE0; overflow: hidden; }
.pet-play-bar .tr i { display: block; height: 100%; border-radius: 99px; transition: width .6s ease; }
.pet-play-bar.sat .tr i  { background: linear-gradient(90deg,#F0B35B,#E67E22); }
.pet-play-bar.mood .tr i { background: linear-gradient(90deg,#F6A6B8,#E86A8E); }
.pet-play-bar.xp .tr i   { background: linear-gradient(90deg,#7FA9E8,#2F5FA8); }
.pet-play-bar > b { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11px; color: #6B7280; }

.pet-play-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pet-play-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #FFFDF8; border: 1.5px solid #E7E1D4; border-radius: 12px;
  padding: 13px 8px 11px; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.pet-play-btn:hover:not(:disabled) { transform: translateY(-3px); border-color: #E67E22; box-shadow: 0 6px 16px rgba(230,126,34,.16); }
.pet-play-btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.pet-play-btn:disabled { opacity: .5; cursor: not-allowed; }
.pet-play-btn em { font-size: 27px; font-style: normal; line-height: 1.2; }
.pet-play-btn b { font-size: 13.5px; color: #142B5E; }
.pet-play-btn small { font-size: 10.5px; color: #8A8F9A; }
.pet-play-tip { font-size: 11.5px; color: #8A8F9A; text-align: center; }

.pet-play-treasure {
  display: none; position: absolute; inset: 0; z-index: 7;
  background: rgba(20,43,94,.72); flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.pet-play-treasure.open { display: flex; animation: petFade .2s ease; }
@keyframes petFade { from { opacity: 0; } to { opacity: 1; } }
.pet-treasure-hd { color: #fff; font-size: 16px; font-weight: 800; }
.pet-treasure-row { display: flex; gap: 16px; }
.pet-treasure-box {
  width: 82px; height: 82px; border-radius: 14px; border: 2px solid rgba(255,255,255,.5);
  background: #FFFDF8; font-size: 36px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.pet-treasure-box:hover:not(:disabled) { transform: translateY(-6px) scale(1.06); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.pet-treasure-box:disabled { cursor: default; }
.pet-treasure-box.picked { border-color: #E67E22; }
.pet-treasure-box.hit { background: #FFF1D6; box-shadow: 0 0 0 4px rgba(230,126,34,.45); animation: petBoxPop .5s ease; }
.pet-treasure-box.miss { opacity: .55; filter: grayscale(.7); }
@keyframes petBoxPop { 0% { transform: scale(1); } 50% { transform: scale(1.2) rotate(-8deg); } 100% { transform: scale(1); } }
.pet-treasure-close {
  background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff;
  border-radius: 99px; padding: 6px 18px; font-size: 12px; cursor: pointer;
}

/* ============================================================
   对战动画：冲刺 / 受击 / 伤害飘字 / 技能横幅
   ============================================================ */
.pet-battle-stage { position: relative; overflow: hidden; }
/* ★ 战斗动画节奏：下列时长已按 pet-center.js 的 BT_SPEED(1.5) 放大
   （1 → 1.25 → 1.5，老师 11-08 要求对战再慢一点点）。
   想整体再调快慢请同步改两处，避免「动画已结束但 JS 还在等」的停顿感。 */
.pet-bt-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  pointer-events: none; transition: opacity .22s ease; z-index: 6;
}
.pet-bt-flash.on { opacity: .32; }
.pet-bt-banner {
  position: absolute; left: 50%; top: 48px; transform: translate(-50%, -6px);
  max-width: 84%; padding: 8px 18px; border-radius: 99px; z-index: 5;
  background: rgba(255,253,248,.95); color: #142B5E; font-size: 12.5px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.pet-bt-banner.show { opacity: 1; transform: translate(-50%, 0); }
.pet-bt-banner.show.me  { border-bottom: 3px solid #2DD4A4; }
.pet-bt-banner.show.foe { border-bottom: 3px solid #FF6B9D; }
.pet-bt-banner.pop { animation: petBannerPop .62s ease; }
@keyframes petBannerPop { 0% { scale: .86; } 55% { scale: 1.06; } 100% { scale: 1; } }

.pet-bt-side { position: relative; }
.pet-bt-side .pic { position: relative; z-index: 2; transition: filter .2s ease; }
.pet-fighter-fx { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.pet-dmg-fx {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 26px; font-weight: 900; color: #FF6B6B;
  text-shadow: 0 2px 0 #7A1D1D, 0 0 12px rgba(255,80,80,.7); white-space: nowrap;
  animation: petDmgUp 1.55s ease-out forwards;
}
.pet-dmg-fx.crit { font-size: 34px; color: #FFD35C; text-shadow: 0 2px 0 #8A5A00, 0 0 16px rgba(255,190,60,.9); }
@keyframes petDmgUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  22%  { opacity: 1; transform: translate(-50%, -6px) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -62px) scale(1); }
}
/* 🔴🔴 2026-11-27 老师指示：「宠物攻击和受击不要改变宠物角度，正常做个特效就行」
 *
 * 原实现里，攻击/受击/闪避/倒下 全都用 rotate() / skewX() 表达，
 * 战斗一开打宠物就歪了 → 观感就是「变形」。
 * ✅ 处置：**动作一律不改角度**
 *   · 攻击 → 向前平移冲刺 + 等比放大 + 发光（drop-shadow）
 *   · 受击 → 水平颤动（translateX）+ 受击变红（hue-rotate 是颜色滤镜，不是角度）
 *   · 闪避 → 上跳（translateY）+ 等比放大，去掉 skewX（skewX 是真变形）
 *   · 倒下 → 下沉 + 等比缩小 + 灰度，去掉 rotate(-18deg)
 * 战斗反馈交给已有的特效层：能量弹飞行 + 命中冲击环 + 伤害飘字 + 暴击闪屏 + 舞台震动。
 */
.pet-bt-side .pic.act-atk { animation: petAtkR .62s ease; z-index: 5; }
.pet-bt-side.right .pic.act-atk { animation-name: petAtkL; }
@keyframes petAtkR {
  0% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
  45% { transform: translateX(26px) scale(1.14); filter: drop-shadow(0 0 14px rgba(255,190,60,.9)) brightness(1.12); }
  100% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
}
@keyframes petAtkL {
  0% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
  45% { transform: translateX(-26px) scale(1.14); filter: drop-shadow(0 0 14px rgba(255,190,60,.9)) brightness(1.12); }
  100% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
}
.pet-bt-side .pic.act-hit { animation: petHit .5s ease; filter: brightness(1.5) sepia(.5) hue-rotate(-35deg); }
@keyframes petHit {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  45% { transform: translateX(8px); }
  70% { transform: translateX(-5px); }
}
.pet-bt-side .pic.act-miss { animation: petMiss .54s ease; opacity: .6; }
@keyframes petMiss { 0%,100% { transform: translateX(0); filter: none; } 50% { transform: translateX(20px); filter: blur(2px); } }
.pet-bt-side .pic.act-down { filter: grayscale(1) brightness(.7); transform: translateY(10px) scale(.92); transition: all .74s ease; }
.pet-battle-stage.shake { animation: petShake .62s ease; }
@keyframes petShake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-5px,2px); } 50% { transform: translate(5px,-2px); } 75% { transform: translate(-3px,1px); } }
.pet-bt-log-row.new { animation: petLogIn .46s ease; }
@keyframes petLogIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 合并后的「我的宠物」：左互动舞台 + 右状态/任务（steam.fun 式） ---------- */
.pet-home-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px; align-items: start; margin-bottom: 14px;
}
.pet-home-stage-col { min-width: 0; }
.pet-home-side { display: grid; gap: 12px; min-width: 0; }
.pet-home-side .pet-card { padding: 13px 14px; }
.pet-home-side .pet-card-hd { margin-bottom: 9px; }
.pet-profile h2 {
  margin: 8px 0 9px; font-size: 21px; font-weight: 800; color: #142B5E;
  overflow-wrap: anywhere;
}
.pet-profile .pet-rarity { display: inline-block; }
.pet-profile .pet-meta { margin-bottom: 9px; }
.pet-profile .pet-coins { font-size: 12px; line-height: 1.6; }
.pet-side-bars .pet-play-bars { grid-template-columns: 1fr; gap: 8px; }
.pet-side-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pet-side-actions .btn { flex: 1 1 auto; text-align: center; }
.pet-profile .pet-side-actions { margin-top: 10px; }
/* 放大舞台填满左栏（右栏有档案/状态/任务三卡），避免合并页出现大片留白
   下方新增表情条约占 40px，舞台同步收 30px 保持两栏齐平 */
.pet-home-stage-col .pet-play-stage { height: 530px; }
.pet-home-stage-col .pet-play-pet { width: 360px; height: 400px; }
.pet-home-side .pet-task-list { gap: 6px; }
.pet-home-side .pet-task { padding: 7px 9px; }
.pet-home-side .pet-task .tx b { font-size: 12.5px; }

/* ============================================================
   宠物列表（多宠 + 出战位 · 老师 11-08 · 参考 steam.fun）
   ============================================================ */
.pet-list-bar {
  background: #FFFFFF; border: 1px solid #EDE6D8; border-radius: 12px;
  padding: 10px 12px 12px; margin-bottom: 12px;
}
.pet-list-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 9px;
}
.pet-list-hd span { font-size: 13.5px; font-weight: 800; color: #142B5E; }
.pet-list-hd em { font-style: normal; font-size: 11px; color: #8A93A3; }
.pet-slot-list {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 3px;
  scrollbar-width: thin;
}
.pet-slot {
  position: relative; flex: 0 0 auto; width: 116px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 6px 9px; border-radius: 11px;
  background: #FBF9F4; border: 2px solid #EEE8DB;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.pet-slot:hover { transform: translateY(-2px); border-color: #E0D6C2; }
.pet-slot.active {
  border-color: #E67E22; background: #FFF7EC;
  box-shadow: 0 3px 10px rgba(230,126,34,.18);
}
.pet-slot.switching { opacity: .55; pointer-events: none; }
.pet-slot .pic { position: relative; width: 72px; height: 72px; display: block; }
.pet-slot .pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pet-slot .pic .badge {
  position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; color: #fff; background: #E67E22;
  padding: 1px 7px; border-radius: 99px; white-space: nowrap;
}
.pet-slot .pic .badge-god { left: auto; right: -4px; transform: none; background: none; font-size: 14px; padding: 0; }
.pet-slot .tx { text-align: center; width: 100%; }
.pet-slot .tx b {
  display: block; font-size: 12px; color: #142B5E;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-slot .tx small { display: block; font-size: 10px; color: #8A93A3; margin-top: 1px; }
.pet-slot .rar {
  position: absolute; top: 5px; left: 5px;
  font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 5px;
}
.pet-slot-retire {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; line-height: 16px; text-align: center;
  font-size: 13px; color: #A0A6B0; background: #fff;
  border: 1px solid #E7E1D4; border-radius: 50%;
  cursor: pointer; padding: 0; opacity: 0; transition: opacity .16s ease;
}
.pet-slot:hover .pet-slot-retire { opacity: 1; }
.pet-slot-retire:hover { color: #C0392B; border-color: #C0392B; }
.pet-slot-add {
  flex: 0 0 auto; width: 100px; min-height: 116px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 11px; border: 2px dashed #D8D2C6; background: #FCFBF8;
  color: #B07B33; font-size: 22px; text-decoration: none;
}
.pet-slot-add:hover { border-color: #E67E22; background: #FFF9F0; }
.pet-slot-add span { font-size: 11px; font-weight: 700; }

/* 窄屏：列表横向滚动即可，不换行 */
@media (max-width: 720px) {
  .pet-slot { width: 104px; }
  .pet-slot .pic { width: 62px; height: 62px; }
}

/* ============================================================
   技能树（随等级解锁 · 老师 11-08）
   ============================================================ */
.pet-skill-tree { display: flex; flex-direction: column; gap: 5px; }
.pet-skill-tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 9px;
  background: #FFFDF8; border: 1px solid #EFE8DA;
}
.pet-skill-tree-item .ic { flex: 0 0 auto; font-size: 16px; line-height: 1; }
.pet-skill-tree-item .bd { flex: 1 1 auto; min-width: 0; }
.pet-skill-tree-item .bd b { display: block; font-size: 12.5px; color: #142B5E; }
.pet-skill-tree-item .bd small { display: block; font-size: 10px; color: #8A93A3; margin-top: 1px; }
.pet-skill-tree-item .lv {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; color: #2E9C81;
  background: #E8F8F2; padding: 2px 7px; border-radius: 99px;
}
.pet-skill-tree-item.locked { background: #F6F5F2; border-color: #E7E1D4; opacity: .72; }
.pet-skill-tree-item.locked .bd b { color: #9AA1AD; }
.pet-skill-tree-item.locked .lv { color: #A0A6B0; background: #ECEAE5; }

/* 对战出招栏里的锁定技能 */
.pet-skill.locked {
  position: relative; display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 8px 22px; border-radius: 10px;
  background: #F6F5F2; border: 1px dashed #D8D2C6; color: #9AA1AD;
  cursor: not-allowed; opacity: .8;
}
.pet-skill.locked .pet-skill-body b { color: #8A93A3; }
.pet-skill.locked .pet-skill-body em { color: #B07B33; font-style: normal; font-weight: 700; }
.pet-skill.locked .pet-skill-cost { color: #A0A6B0; }
.pet-skill-next {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: #B07B33;
  background: #FFF4DE; padding: 2px 8px; border-radius: 99px;
}

/* ============================================================
   表情状态：色调 / 大表情 / 状态徽章 / 表情条 / 立绘状态
   ============================================================ */
.tone-gold   { --ex: #C9861A; --ex-bg: #FFF4DE; }
.tone-mint   { --ex: #2E9C81; --ex-bg: #E8F8F2; }
.tone-blue   { --ex: #3C6FB5; --ex-bg: #EDF4FF; }
.tone-gray   { --ex: #77808E; --ex-bg: #F1F2F4; }
.tone-orange { --ex: #D2691E; --ex-bg: #FFF0E2; }
.tone-violet { --ex: #7C5BB5; --ex-bg: #F3EDFF; }
.tone-red    { --ex: #C0392B; --ex-bg: #FDECEA; }
.tone-pink   { --ex: #D4578A; --ex-bg: #FFEDF4; }

/* 左上：当前状态徽章（自动判定） */
.pet-expr-badge {
  position: absolute; left: 12px; top: 12px; z-index: 6;
  display: flex; align-items: center; gap: 8px; max-width: 46%;
  padding: 5px 12px 5px 7px; border-radius: 99px;
  background: var(--ex-bg, #FFFDF8); border: 1.5px solid var(--ex, #E7E1D4);
  box-shadow: 0 3px 10px rgba(20,43,94,.12);
}
.pet-expr-badge em { font-style: normal; font-size: 22px; line-height: 1; }
.pet-expr-badge span { display: flex; flex-direction: column; min-width: 0; }
.pet-expr-badge b { font-size: 12.5px; color: var(--ex, #142B5E); white-space: nowrap; }
.pet-expr-badge small {
  font-size: 10.5px; color: #6B7280;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 右侧：头顶大表情（浮动 + 切换弹跳，两个动画用不同属性避免互相覆盖） */
.pet-emoji {
  position: absolute; right: 9%; top: 27%; z-index: 5;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; line-height: 1; background: #FFFDF8;
  border: 3px solid var(--ex, #E7E1D4);
  box-shadow: 0 6px 18px rgba(20,43,94,.18); pointer-events: none;
  animation: petEmojiFloat 3s ease-in-out infinite;
}
.pet-emoji.pop { animation: petEmojiPop .55s ease, petEmojiFloat 3s ease-in-out .55s infinite; }
@keyframes petEmojiFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes petEmojiPop {
  0%   { opacity: 0; transform: scale(.4) rotate(-18deg); }
  55%  { opacity: 1; transform: scale(1.22) rotate(8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* 动作条下方：表情状态条（点击任意表情可预览，不消耗资源） */
.pet-emoji-dock { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pet-emoji-dock-hd { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; color: #6B7280; padding-top: 7px; }
.pet-emoji-bar {
  /* 2026-11-08：表情从 15 个加到 21 个（新增 6 个日常动作表情）
     → 改成换行显示，横向滚动会让小学生找不到后面的表情。
     overflow-x 保留作兜底（极窄屏时仍可滑）。 */
  display: flex; flex-wrap: wrap; gap: 6px; min-width: 0;
  overflow-x: auto;
  padding: 3px 1px 6px; scrollbar-width: thin;
}
.pet-emoji-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 99px; border: 1px solid #E7E1D4;
  background: #FFFDF8; color: #6B7280; font-size: 11px; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pet-emoji-chip em { font-style: normal; font-size: 16px; line-height: 1; }
.pet-emoji-chip:hover { border-color: var(--ex, #E7E1D4); box-shadow: 0 2px 8px rgba(20,43,94,.1); }
.pet-emoji-chip.on {
  background: var(--ex-bg, #FFFDF8); border-color: var(--ex, #E7E1D4);
  color: var(--ex, #142B5E); font-weight: 800;
  box-shadow: 0 2px 8px rgba(20,43,94,.1);
}

/* 立绘状态：只改滤镜，不改 animation（否则会盖掉动作动画） */
.pet-play-stage.expr-happy .pet-play-pet img  { filter: drop-shadow(0 0 14px rgba(233,162,59,.65)) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-content .pet-play-pet img{ filter: drop-shadow(0 0 8px rgba(96,190,150,.4)) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-low .pet-play-pet img    { filter: grayscale(.3) brightness(.96) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-hungry .pet-play-pet img { filter: sepia(.16) saturate(1.15) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-sad .pet-play-pet img    { filter: grayscale(.45) brightness(.92) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-weak .pet-play-pet img   { filter: grayscale(.72) brightness(.88) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
.pet-play-stage.expr-sleepy .pet-play-pet img { filter: grayscale(.25) brightness(.94) drop-shadow(0 10px 12px rgba(80,60,30,.18)); }
/* 舞台氛围光：不挡立绘（z-index 2 < 立绘 3） */
.pet-play-stage.expr-happy::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 52%, rgba(255,214,120,.3), transparent 58%);
}
.pet-play-stage.expr-sad::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(96,126,182,.16), transparent 62%);
}
.pet-play-stage.expr-weak::after, .pet-play-stage.expr-low::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: rgba(90,96,108,.09);
}

/* 对战：立绘右上角小表情
   ⚠️ 上方 .pet-bt-side .pic 有 overflow:hidden，会裁掉角标 → 必须在这里放开 */
.pet-bt-side .pic { overflow: visible; }
.pet-bt-emoji {
  position: absolute; right: -9px; top: -9px; z-index: 7;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; background: #FFFDF8;
  border: 2px solid #E7E1D4; box-shadow: 0 2px 8px rgba(20,43,94,.2);
  pointer-events: none;
}
.pet-bt-emoji.pop { animation: petBtEmojiPop .66s ease; }
@keyframes petBtEmojiPop {
  0%   { transform: scale(.4) rotate(-20deg); }
  60%  { transform: scale(1.25) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

@media (max-width: 1100px) {
  .pet-home-main { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 860px) {
  .pet-home-main { grid-template-columns: 1fr; }
  .pet-home-stage-col .pet-play-stage { height: 330px; }
  .pet-home-stage-col .pet-play-pet { width: 220px; height: 240px; }
  .pet-play-stage { height: 330px; }
  /* 🔴 2026-11-19：aspect-ratio 与固定 height 同时存在会互相打架 → 窄屏解除比例锁定 */
  .pet-sf-stage .pet-play-stage { aspect-ratio: auto; max-width: none; height: 330px; }
  .pet-play-pet { width: 220px; height: 240px; }
  .pet-play-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-play-bars { grid-template-columns: 1fr; }
  .pet-emoji { width: 48px; height: 48px; font-size: 27px; right: 5%; top: 24%; }
  .pet-expr-badge { max-width: 62%; }
  .pet-emoji-dock { flex-wrap: wrap; gap: 6px; }
}

/* ==========================================================================
   Q宠大乱斗式「擂台舞台」对战界面（2026-11-08）
   --------------------------------------------------------------------------
   参考形式：两只宠物左右站在擂台上面对面，上方双方血条 HUD，中间回合 /
   技能横幅 / 冲刺互殴 / 伤害飘字，下方出招栏与逐行滚动的战斗播报。
   ⚠️ 只重排视觉，所有 id / class 与服务端结算逻辑保持不变。
   ========================================================================== */

/* ---------- 今日挑战页顶部的小擂台预览 ---------- */
.pet-lobby-arena {
  position: relative; height: 138px; margin: 12px 0 14px;
  border-radius: 12px; overflow: hidden; border: 1px solid #E7E1D4;
  background: #142B5E;
}
.pet-lobby-sky {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 110%, rgba(230,126,34,.45), transparent 58%),
              linear-gradient(180deg, #0B1B3F 0%, #1B3A78 68%, #3D5388 100%);
}
.pet-lobby-beam {
  position: absolute; top: -12%; width: 46%; height: 100%;
  background: linear-gradient(180deg, rgba(255,226,170,.3), transparent 76%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); filter: blur(5px);
}
.pet-lobby-beam.l { left: 3%; } .pet-lobby-beam.r { right: 3%; }
.pet-lobby-floor {
  position: absolute; left: 0; right: 0; bottom: -22px; height: 62px;
  border-radius: 50% 50% 0 0 / 40% 40% 0 0;
  background: linear-gradient(180deg, #F0E6CE, #C9B592);
  border-top: 3px solid #FFF6E2;
}
.pet-lobby-fighter {
  position: absolute; bottom: 8px; width: 108px; height: 108px; z-index: 2;
  object-fit: contain; filter: drop-shadow(0 6px 7px rgba(0,0,0,.4));
}
.pet-lobby-fighter.me { left: 12%; }
.pet-lobby-fighter.foe { right: 12%; transform: scaleX(-1); }
.pet-lobby-mid {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 3; text-align: center; color: #FFF7E8; white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.pet-lobby-mid span { display: block; font-size: 26px; line-height: 1.2; }
.pet-lobby-mid b { display: block; font-size: 16px; font-weight: 800; letter-spacing: 2px; }
.pet-lobby-mid small { display: block; font-size: 11px; opacity: .82; margin-top: 2px; }

/* ---------- 战斗舞台：上半擂台 + 下半出招栏/播报 ---------- */
.pet-battle-stage {
  --arena-h: 420px;
  --pet-dash: 220px;
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  padding: calc(var(--arena-h) + 14px) 14px 14px;
  background: #FAF8F3; border: 1px solid #E7E1D4; border-radius: 16px;
  color: #fff; box-shadow: var(--sh-s); overflow: hidden;
}
.pet-arena-deco {
  position: absolute; left: 0; right: 0; top: 0; height: var(--arena-h);
  overflow: hidden; pointer-events: none; z-index: 0;
}
.pet-arena-sky {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(230,126,34,.34), transparent 62%),
              linear-gradient(180deg, #081538 0%, #142B5E 42%, #2A4780 74%, #6D6D96 100%);
}
.pet-arena-crowd {
  position: absolute; left: 0; right: 0; top: 38%; height: 34%;
  background-color: rgba(6,15,38,.55);
  background-image: radial-gradient(circle at 13px 11px, rgba(255,214,160,.38) 0 3.5px, transparent 4.5px);
  background-size: 27px 21px;
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
}
.pet-arena-beam {
  position: absolute; top: -8%; width: 48%; height: 88%;
  background: linear-gradient(180deg, rgba(255,231,182,.28), transparent 78%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  filter: blur(6px); animation: petBeamSway 5s ease-in-out infinite alternate;
}
.pet-arena-beam.l { left: 2%; }
.pet-arena-beam.r { right: 2%; animation-delay: -2.4s; }
@keyframes petBeamSway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.pet-arena-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  border-radius: 50% 50% 0 0 / 16% 16% 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(20,43,94,.07) 0 1px, transparent 1px 54px),
    linear-gradient(180deg, #F1E7D0 0%, #DAC9A7 58%, #B79B72 100%);
  border-top: 4px solid #FFF7E5;
  box-shadow: inset 0 16px 32px rgba(20,43,94,.14), 0 -8px 26px rgba(255,220,160,.14);
}
.pet-arena-ring {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  width: 44%; height: 58px; border: 3px solid rgba(20,43,94,.2);
  border-radius: 50%; box-shadow: 0 0 0 12px rgba(255,255,255,.1);
}
.pet-arena-seal {
  position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; color: rgba(20,43,94,.3); white-space: nowrap;
}
.pet-arena-dust i {
  position: absolute; bottom: 22%; width: 4px; height: 4px; border-radius: 50%;
  background: #FFE1A8; opacity: 0; box-shadow: 0 0 10px #FFD180;
  animation: petDust 4.2s ease-in-out infinite;
}
.pet-arena-dust i:nth-child(1) { left: 16%; animation-delay: .1s; }
.pet-arena-dust i:nth-child(2) { left: 29%; animation-delay: 1.2s; }
.pet-arena-dust i:nth-child(3) { left: 42%; animation-delay: 2.1s; }
.pet-arena-dust i:nth-child(4) { left: 58%; animation-delay: .7s; }
.pet-arena-dust i:nth-child(5) { left: 71%; animation-delay: 2.8s; }
.pet-arena-dust i:nth-child(6) { left: 84%; animation-delay: 1.8s; }
@keyframes petDust {
  0%,100% { opacity: 0; transform: translateY(0) scale(.6); }
  40% { opacity: .8; }
  70% { opacity: .3; transform: translateY(-70px) scale(1.2); }
}
.pet-battle-stage.over .pet-arena-deco::after {
  content: ''; position: absolute; inset: 0; background: rgba(8,18,44,.42);
}
.pet-battle-stage .pet-bt-flash { height: var(--arena-h); bottom: auto; }

/* ---------- 顶部 HUD：双方名牌 / 血条 / 能量 ---------- */
.pet-battle-stage .pet-bt-hp {
  position: absolute; left: 14px; right: 14px; top: 12px; z-index: 8;
  display: grid; grid-template-columns: minmax(0,1fr) 64px minmax(0,1fr);
  align-items: start; gap: 10px; margin: 0; flex-wrap: nowrap;
}
.pet-battle-stage .pet-bt-side {
  position: static; display: block; min-width: 0; padding: 9px 12px;
  background: rgba(8,20,48,.72); border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; backdrop-filter: blur(7px);
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
}
.pet-battle-stage .pet-bt-side.right { text-align: right; flex-direction: row; }
.pet-battle-stage .pet-bt-side.right .pet-hp-bar { transform: none; }
.pet-battle-stage .pet-bt-side .tx { min-width: 0; }
.pet-battle-stage .pet-bt-side .nm { font-size: 13.5px; }
.pet-battle-stage .pet-bt-side .sub { margin: 1px 0 3px; }
.pet-battle-stage .pet-hp-bar { height: 14px; margin-top: 3px; }
.pet-battle-stage .pet-hp-bar.energy { height: 10px; }
.pet-battle-stage .pet-bt-vs {
  justify-self: center; align-self: center; text-align: center;
  width: 56px; height: 56px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 18px; font-weight: 900;
  color: #fff; background: linear-gradient(145deg, #F5A742, #E67E22);
  box-shadow: 0 6px 18px rgba(230,126,34,.5), inset 0 0 0 3px rgba(255,255,255,.35);
}
.pet-battle-stage .pet-round-bar {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  z-index: 8; margin: 0; padding: 5px 16px; font-size: 12px; white-space: nowrap;
  background: rgba(8,20,48,.74); border: 1px solid rgba(255,255,255,.24);
  color: #FFE6B8; letter-spacing: 1px;
}
.pet-battle-stage .pet-bt-banner { top: 132px; z-index: 9; max-width: 74%; }

/* ---------- 台上两只宠物：面对面站立 ---------- */
.pet-battle-stage .pet-bt-side .pic {
  position: absolute; top: 146px; left: 8%; z-index: 3;
  width: 210px; height: 210px; padding: 0; border: 0; border-radius: 0;
  background: transparent; display: block; overflow: visible;
  transition: filter .2s ease;
}
.pet-battle-stage .pet-bt-side.right .pic { left: auto; right: 8%; }
.pet-battle-stage .pet-bt-side .pic img {
  position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 12px 9px rgba(0,0,0,.36));
  animation: petArenaIdle 3.2s ease-in-out infinite;
}
.pet-battle-stage .pet-bt-side.right .pic img { animation-name: petArenaIdleFoe; }
@keyframes petArenaIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes petArenaIdleFoe {
  0%,100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-8px); }
}
.pet-fighter-shadow {
  position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%);
  width: 76%; height: 22px; border-radius: 50%; z-index: 1;
  background: radial-gradient(ellipse, rgba(20,43,94,.48), transparent 72%);
}
/* 🔴 战斗帧动画层（sprite sheet 逐帧播放）—— 2026-12-01
   · 素材：assets/img/pet/anim/battle/{sp}/{sp}_L{n}_{act}.webp（横排，每帧 320px）
   · 用 background-position 百分比逐帧切换（老宝可梦同款做法）
   · 默认 display:none → 播的时候加 .on 显形；播完移除 → 回落到待机立绘
   ⚠️ 右侧（对手）整体水平翻转，让两只面对面 */
.pet-bt-frames {
  display: none;
  position: absolute; inset: 0; z-index: 2;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: auto 100%;
  filter: drop-shadow(0 12px 9px rgba(0,0,0,.36));
  pointer-events: none;
}
.pet-bt-frames.on { display: block; }
.pet-battle-stage .pet-bt-side.right .pet-bt-frames { transform: scaleX(-1); }
.pet-fighter-tag {
  position: absolute; left: 50%; bottom: -28px; transform: translateX(-50%);
  z-index: 3; white-space: nowrap; font-size: 11px; font-weight: 800;
  padding: 3px 13px; border-radius: 99px;
  background: #2DD4A4; color: #06251B; box-shadow: 0 3px 8px rgba(0,0,0,.25);
}
.pet-battle-stage .pet-bt-side.right .pet-fighter-tag { background: #FF7BAC; color: #431020; }
.pet-battle-stage .pet-fighter-fx {
  position: absolute; top: 146px; left: 8%; width: 210px; height: 210px; z-index: 5;
}
.pet-battle-stage .pet-bt-side.right .pet-fighter-fx { left: auto; right: 8%; }
.pet-battle-stage .pet-dmg-fx { top: 30%; }

/* ---------- 技能飞行 / 命中爆点 / MISS ---------- */
.pet-arena-fx {
  position: absolute; left: 0; right: 0; top: 0; height: var(--arena-h);
  z-index: 7; pointer-events: none; overflow: hidden;
}
.pet-fx-shot {
  position: absolute; top: 46%; font-size: 30px; line-height: 1;
  filter: drop-shadow(0 0 10px #FFD35C);
}
.pet-fx-shot.from-me { animation: petShotR .7s ease-in forwards; }
.pet-fx-shot.from-foe { animation: petShotL .7s ease-in forwards; }
@keyframes petShotR {
  0% { left: 16%; opacity: 0; transform: scale(.5); }
  18% { opacity: 1; }
  100% { left: 76%; opacity: 1; transform: scale(1.4) rotate(18deg); }
}
@keyframes petShotL {
  0% { left: 76%; opacity: 0; transform: scale(.5); }
  18% { opacity: 1; }
  100% { left: 16%; opacity: 1; transform: scale(1.4) rotate(-18deg); }
}
.pet-fx-hit { position: absolute; top: 42%; width: 92px; height: 92px; }
.pet-fx-hit.left { left: 10%; } .pet-fx-hit.right { right: 10%; }
.pet-fx-hit i {
  position: absolute; inset: 0; border: 3px solid #FFD35C; border-radius: 50%;
  animation: petRing .78s ease-out forwards;
}
.pet-fx-hit i:nth-child(2) { animation-delay: .13s; }
.pet-fx-hit i:nth-child(3) { animation-delay: .28s; }
.pet-fx-hit.crit i { border-color: #FF6B6B; }
@keyframes petRing {
  from { transform: scale(.2); opacity: .95; }
  to { transform: scale(1.5); opacity: 0; }
}
.pet-fx-miss {
  position: absolute; top: 36%; font-family: var(--font-mono);
  font-size: 23px; font-weight: 900; color: #FFF3D0;
  text-shadow: 0 2px 0 #8A5A00, 0 0 14px rgba(255,210,120,.9);
  animation: petMissUp 1.2s ease-out forwards;
}
.pet-fx-miss.left { left: 12%; } .pet-fx-miss.right { right: 12%; }
@keyframes petMissUp {
  0% { opacity: 0; transform: translateY(8px) scale(.7); }
  25% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-38px) scale(1); }
}

/* ---------- 下方：出招栏 + 战斗播报 ---------- */
.pet-battle-stage .pet-skill-zone {
  grid-column: 1; grid-row: 1; margin: 0; padding: 12px;
  background: #FFFFFF; border: 1px solid #EDE6D8; border-radius: 12px;
  color: var(--ink-2); box-shadow: none;
}
.pet-battle-stage .pet-skill-tx {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px;
  font-size: 13px; color: #142B5E;
}
.pet-battle-stage .pet-skill-tx span { font-weight: 800; }
.pet-battle-stage .pet-skill-tx em { font-style: normal; font-weight: 500; font-size: 11px; color: var(--ink-3); }
/* ★ 技能随等级解锁后最多 5 个 → 自适应列数（3 列会在窄栏挤成两行且高度不齐） */
.pet-battle-stage .pet-skill-list {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px; align-items: stretch;
}
.pet-battle-stage .pet-skill { height: 100%; }
.pet-battle-stage .pet-skill {
  position: relative; display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 8px 22px; text-align: left;
}
.pet-skill-ic { flex: 0 0 auto; font-size: 20px; line-height: 1.2; }
.pet-skill-body { flex: 1 1 auto; min-width: 0; }
.pet-battle-stage .pet-skill-body b { font-size: 12.5px; margin-bottom: 2px; }
.pet-battle-stage .pet-skill-body small { font-size: 10px; margin-bottom: 2px; }
.pet-battle-stage .pet-skill-body em { font-size: 10.5px; line-height: 1.4; }
.pet-skill-cost {
  position: absolute; right: 8px; bottom: 6px; font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700; color: #B07B33;
}
.pet-battle-stage .pet-skill.lack .pet-skill-cost { color: #A0A6B0; }
.pet-battle-stage .pet-bt-log {
  grid-column: 2; grid-row: 1; margin: 0; min-height: 200px; max-height: 260px;
  background: #142B5E; border: 1px solid #29457E; border-radius: 12px;
}
.pet-battle-stage .pet-bt-log::before {
  content: '战斗播报'; display: block; flex: 0 0 auto;
  font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #FFD9A0;
  padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px dashed rgba(255,255,255,.2);
}
.pet-battle-stage .pet-bt-log-row { font-size: 12px; line-height: 1.7; }
.pet-battle-stage .pet-bt-actions {
  grid-column: 1 / -1; grid-row: 2; margin: 0; justify-content: flex-end;
}
.pet-battle-stage .pet-bt-actions .btn {
  background: #FFFFFF; color: #142B5E; border: 1px solid #E7E1D4;
  font-size: 12px; padding: 6px 16px;
}

/* ---------- 登台 / 冲刺 / 受击 / 闪避 / 倒下 / 胜利 ---------- */
.pet-battle-stage.intro .pet-bt-side .pic { animation: petEnterL .94s cubic-bezier(.2,.9,.3,1.2) both; }
.pet-battle-stage.intro .pet-bt-side.right .pic { animation-name: petEnterR; }
@keyframes petEnterL { from { transform: translateX(-130%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes petEnterR { from { transform: translateX(130%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.pet-battle-stage .pet-bt-side .pic.act-atk {
  animation: petArenaDashR .68s cubic-bezier(.3,.7,.3,1) both; z-index: 6;
}
.pet-battle-stage .pet-bt-side.right .pic.act-atk { animation-name: petArenaDashL; }
/* 🔴 攻击不改变角度（去 rotate），改用「前冲 + 等比放大 + 发光」 */
@keyframes petArenaDashR {
  0% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
  22% { transform: translateX(-20px) scale(.93); filter: drop-shadow(0 0 8px rgba(255,190,60,.5)); }
  60% { transform: translateX(var(--pet-dash)) scale(1.16); filter: drop-shadow(0 0 18px rgba(255,190,60,.95)) brightness(1.14); }
  76% { transform: translateX(var(--pet-dash)) scale(1.16); filter: drop-shadow(0 0 18px rgba(255,190,60,.95)) brightness(1.14); }
  100% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
}
@keyframes petArenaDashL {
  0% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
  22% { transform: translateX(20px) scale(.93); filter: drop-shadow(0 0 8px rgba(255,190,60,.5)); }
  60% { transform: translateX(calc(-1 * var(--pet-dash))) scale(1.16); filter: drop-shadow(0 0 18px rgba(255,190,60,.95)) brightness(1.14); }
  76% { transform: translateX(calc(-1 * var(--pet-dash))) scale(1.16); filter: drop-shadow(0 0 18px rgba(255,190,60,.95)) brightness(1.14); }
  100% { transform: translateX(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,190,60,0)); }
}
.pet-battle-stage .pet-bt-side .pic.act-hit { animation: petArenaHitL .53s ease; }
.pet-battle-stage .pet-bt-side.right .pic.act-hit { animation-name: petArenaHitR; }
/* 🔴 受击不改变角度（去 rotate），水平颤动 + 受击变红 */
@keyframes petArenaHitL {
  0%,100% { transform: translateX(0); filter: none; }
  25% { transform: translateX(-15px); filter: brightness(1.6) sepia(.35); }
  55% { transform: translateX(9px); }
}
@keyframes petArenaHitR {
  0%,100% { transform: translateX(0); filter: none; }
  25% { transform: translateX(15px); filter: brightness(1.6) sepia(.35); }
  55% { transform: translateX(-9px); }
}
.pet-battle-stage .pet-bt-side .pic.act-miss {
  animation: petArenaMiss .55s ease; opacity: .55;
}
/* 🔴 闪避去掉 skewX（那是真变形）→ 改成上跳 + 等比放大 */
@keyframes petArenaMiss {
  0%,100% { transform: translateX(0) translateY(0) scale(1); }
  50% { transform: translateY(-26px) scale(1.07); }
}
.pet-battle-stage .pet-bt-side .pic.act-down {
  filter: grayscale(1) brightness(.62); transform: translateY(14px) scale(.9);
  transition: all .74s ease; animation: none;
}
.pet-battle-stage .pet-bt-side .pic.act-win { animation: petWinJump 1.02s ease 2; z-index: 6; }
@keyframes petWinJump {
  0%,100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-34px) scale(1.08); }
  65% { transform: translateY(-6px) scale(.97); }
}

/* ---------- 窄屏：舞台缩短，出招栏与播报改为上下排列 ---------- */
@media (max-width: 860px) {
  .pet-battle-stage {
    --arena-h: 330px;
    grid-template-columns: minmax(0,1fr);
    padding: calc(var(--arena-h) + 12px) 12px 12px;
  }
  .pet-battle-stage .pet-skill-zone,
  .pet-battle-stage .pet-bt-log,
  .pet-battle-stage .pet-bt-actions { grid-column: 1; grid-row: auto; }
  .pet-battle-stage .pet-bt-log { min-height: 0; max-height: 150px; }
  .pet-battle-stage .pet-bt-hp {
    left: 10px; right: 10px; gap: 6px;
    grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr);
  }
  .pet-battle-stage .pet-bt-side { padding: 7px 8px; }
  .pet-battle-stage .pet-bt-vs { width: 40px; height: 40px; font-size: 13px; }
  .pet-battle-stage .pet-bt-side .nm { font-size: 12px; }
  .pet-battle-stage .pet-round-bar { top: 88px; font-size: 11px; }
  .pet-battle-stage .pet-bt-banner { top: 120px; font-size: 11px; max-width: 88%; }
  .pet-battle-stage .pet-bt-side .pic,
  .pet-battle-stage .pet-fighter-fx { top: 132px; width: 140px; height: 140px; }
  .pet-battle-stage .pet-bt-side .pic { left: 5%; }
  .pet-battle-stage .pet-bt-side.right .pic { right: 5%; }
  .pet-battle-stage .pet-fighter-fx { left: 5%; }
  .pet-battle-stage .pet-bt-side.right .pet-fighter-fx { left: auto; right: 5%; }
  .pet-battle-stage .pet-skill-list { grid-template-columns: 1fr; }
  .pet-lobby-fighter { width: 84px; height: 84px; }
  .pet-lobby-fighter.me { left: 5%; } .pet-lobby-fighter.foe { right: 5%; }
  .pet-lobby-arena { height: 118px; }
}

/* ==========================================================================
   宠物商店 + 房间布置（2026-11-10 新增）
   ========================================================================== */
.pet-card-hd { position: relative; }
.pet-card-btn {
  flex: 0 0 auto; font: inherit; font-size: 12px; color: #E67E22;
  background: #FDF0E3; border: 1px solid rgba(230,126,34,.30);
  border-radius: 999px; padding: 3px 11px; cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.pet-card-btn:hover { background: #F8DFC4; transform: translateY(-1px); }

.pet-shop-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20,43,94,.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: petShopFade .16s ease;
}
@keyframes petShopFade { from { opacity: 0; } to { opacity: 1; } }
.pet-shop-panel {
  background: #FAF8F3; border-radius: 16px; width: 100%; max-width: 720px;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 48px rgba(20,43,94,.28);
}
.pet-shop-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid #E7E1D4; background: #FFFDF8;
}
.pet-shop-hd b { font-size: 15px; color: #142B5E; font-weight: 600; }
.pet-shop-coin { margin-left: auto; font-size: 13px; color: #854F0B; font-weight: 600; }
.pet-shop-coin i { font-style: normal; color: #E67E22; font-size: 15px; }
.pet-shop-x {
  border: 0; background: transparent; font-size: 17px; color: #888780;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1;
}
.pet-shop-x:hover { background: #F1EFE8; color: #142B5E; }

.pet-shop-tabs { display: flex; gap: 8px; padding: 12px 18px 0; }
.pet-shop-tabs button {
  font: inherit; font-size: 13px; color: #6B7280; background: #F1EFE8;
  border: 1px solid transparent; border-radius: 999px; padding: 6px 15px; cursor: pointer;
}
.pet-shop-tabs button.on { background: #142B5E; color: #fff; font-weight: 600; }

.pet-shop-body { padding: 14px 18px 20px; overflow-y: auto; }
.pet-shop-item {
  display: flex; align-items: center; gap: 12px;
  background: #FFFDF8; border: 1px solid #E7E1D4; border-radius: 12px;
  padding: 10px 12px; margin-bottom: 9px;
}
.pet-shop-item img { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }
.pet-shop-item.poor { opacity: .55; }
.si-tx { flex: 1 1 auto; min-width: 0; }
.si-tx b { display: block; font-size: 13.5px; color: #142B5E; font-weight: 600; }
.si-tx small { display: block; font-size: 11.5px; color: #888780; margin-top: 1px; }
.si-eff { display: block; font-size: 11px; color: #B4793A; margin-top: 3px; }
.si-buy {
  flex: 0 0 auto; font: inherit; font-size: 12.5px; font-weight: 600; color: #fff;
  background: #E67E22; border: 0; border-radius: 9px; padding: 7px 13px; cursor: pointer;
}
.si-buy:disabled { background: #D3D1C7; cursor: not-allowed; }
.si-buy:not(:disabled):hover { background: #D8731A; }

.pet-shop-slots { display: flex; gap: 8px; margin-bottom: 12px; }
.pet-shop-slots button {
  font: inherit; font-size: 12.5px; color: #6B7280; background: #F1EFE8;
  border: 1px solid transparent; border-radius: 999px; padding: 5px 14px; cursor: pointer;
}
.pet-shop-slots button.on { background: #142B5E; color: #fff; font-weight: 600; }
.pet-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pet-shop-deco {
  background: #FFFDF8; border: 1px solid #E7E1D4; border-radius: 12px;
  padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.pet-shop-deco.on { border-color: #E67E22; box-shadow: 0 0 0 2px rgba(230,126,34,.16); }
.pet-shop-deco.poor { opacity: .55; }
.pet-shop-deco img { width: 100%; height: 72px; object-fit: contain; }
.pet-shop-deco b { font-size: 12.5px; color: #142B5E; font-weight: 600; }
.pet-shop-deco small { font-size: 11px; color: #888780; line-height: 1.45; min-height: 30px; }
.pet-shop-deco .si-buy { margin-top: 2px; }

@media (max-width: 720px) {
  .pet-shop-panel { max-height: 92vh; }
  .pet-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   宠物主界面 · steam.fun 风格改版（2026-11-14）
   布局：我的伙伴(左) │ 警示条·信息条·舞台(中) │ 成长阶段·宠物状态·今日任务(右)
   配色取自 steam.fun 实拍：紫 #8346E8 / 蓝 #1C88BF / 绿 #22AB7F / 红 #E93B3B
   ============================================================ */
/* 🔴 2026-11-19 房间尺寸对齐 steam.fun
   实测：steam.fun 房间 745×570（宽高比 1.31，竖向紧凑），我们原来是 1115×468（比例 2.38，横向扁长）
        steam.fun 的宠物占房间宽 25%，我们只有 11.6% → 看着"房间空、宠物小"
   改法：中间列给固定上限 820px 并整体居中；房间加高到 560；宠物放大到 380×430 */
.pet-sf {
  display: grid;
  grid-template-columns: 190px minmax(0, 820px) 272px;
  justify-content: center;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

/* ── 左栏：我的伙伴 ───────────────────────────────── */
.pet-sf-partners {
  background: #FFFFFF; border: 1px solid #EDE6D8; border-radius: 16px;
  padding: 12px 10px; box-shadow: 0 2px 10px rgba(124,58,237,.06);
}
.pet-sf-phead {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 4px 10px; margin-bottom: 10px; border-bottom: 1px dashed #EEE8DB;
}
.pet-sf-phead span { font-size: 13px; font-weight: 800; color: #142B5E; }
.pet-sf-phead em {
  font-style: normal; font-size: 11px; font-weight: 700; color: #7C3AED;
  background: #F5F3FF; border: 1px solid #DDD6FE; border-radius: 999px; padding: 1px 8px;
}
.pet-sf-plist { display: grid; gap: 8px; }

/* 紧凑横排卡（覆盖 .pet-slot 原竖排大卡） */
.pet-sf-plist .pet-slot {
  width: auto; flex-direction: row; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 12px; background: #F9FAFB;
  border: 1.5px solid #F0F0F0; box-shadow: none;
}
.pet-sf-plist .pet-slot:hover { transform: translateY(-1px); border-color: #C4B5FD; background: #F5F3FF; }
.pet-sf-plist .pet-slot.active {
  background: linear-gradient(90deg, #F5F3FF, #EEF2FF);
  border-color: #C4B5FD; box-shadow: 0 0 0 2px rgba(139,92,246,.12);
}
.pet-sf-plist .pet-slot.switching { opacity: .55; }
.pet-sf-plist .pet-slot .pic { width: 46px; height: 46px; }
.pet-sf-plist .pet-slot .tx { text-align: left; flex: 1; min-width: 0; }
.pet-sf-plist .pet-slot .tx b {
  font-size: 12.5px; color: #142B5E; display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-sf-plist .pet-slot .tx small { font-size: 10.5px; }
.pet-sf-plist .pet-slot .rar {
  position: static; transform: none; font-size: 10px; padding: 1px 6px; border-radius: 6px;
}
.pet-sf-plist .pet-slot .cur {
  font-size: 10px; font-weight: 700; color: #fff; background: #8B5CF6;
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; flex: 0 0 auto;
}

/* 空位卡 */
.pet-sf-vacancy {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 14px; border: 1.5px dashed #E5E7EB; background: #FCFCFD;
}
.pet-sf-vacancy .egg { font-size: 20px; opacity: .42; }
.pet-sf-vacancy .t1 { font-size: 11.5px; font-weight: 700; color: #D1D5DB; }
.pet-sf-vacancy .t2 { margin-left: auto; font-size: 10.5px; color: #D1D5DB; }

/* 底部领养 */
.pet-sf-pfoot { margin-top: 10px; }
.pet-sf-add {
  display: block; text-align: center; padding: 9px 0; border-radius: 12px;
  background: linear-gradient(135deg, #3B82F6, #2563EB); color: #fff;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 12px rgba(37,99,235,.22);
}
.pet-sf-add:hover { filter: brightness(1.06); }
.pet-sf-add.disabled { background: #E5E7EB; color: #9CA3AF; box-shadow: none; }

/* ── 中栏 ─────────────────────────────────────────── */
.pet-sf-center { min-width: 0; display: grid; gap: 12px; }

/* 警示条 */
.pet-sf-alert {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 14px; border: 1px solid #F5C6BE; background: #FEF2F0; color: #8E2B1E;
}
.pet-sf-alert .ic {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
  display: grid; place-items: center; font-size: 16px;
  background: #E93B3B; color: #fff; box-shadow: 0 3px 8px rgba(233,59,59,.3);
}
.pet-sf-alert .tx { flex: 1; min-width: 0; }
.pet-sf-alert .tx b { display: block; font-size: 13.5px; font-weight: 800; }
.pet-sf-alert .tx small { font-size: 11px; opacity: .78; }
.pet-sf-alert.warn { border-color: #F0D9B0; background: #FFF8EC; color: #7A4E08; }
.pet-sf-alert.warn .ic { background: #F59E0B; box-shadow: 0 3px 8px rgba(245,158,11,.3); }
.pet-sf-alert.ok { border-color: #B7E3C8; background: #EDF9F1; color: #1F5A32; }
.pet-sf-alert.ok .ic { background: #22AB7F; box-shadow: 0 3px 8px rgba(34,171,127,.3); }
.pet-sf-alert-btn {
  border: none; cursor: pointer; padding: 7px 15px; border-radius: 999px;
  background: #E93B3B; color: #fff; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(233,59,59,.28); white-space: nowrap;
}
.pet-sf-alert-btn:hover { filter: brightness(1.06); }
.pet-sf-alert.warn .pet-sf-alert-btn { background: #F59E0B; box-shadow: 0 3px 10px rgba(245,158,11,.3); }

/* 宠物信息条 */
.pet-sf-infobar {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  background: #fff; border: 1px solid #EDE6D8; border-radius: 14px;
  padding: 9px 13px; box-shadow: 0 2px 8px rgba(20,43,94,.05);
}
.pet-sf-avatar {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px;
  background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
  border: 1px solid #E9E5FF; display: grid; place-items: center; overflow: hidden;
}
.pet-sf-avatar img { width: 100%; height: 100%; object-fit: contain; }
.pet-sf-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pet-sf-who > b { font-size: 15px; font-weight: 800; color: #142B5E; }
.pet-sf-tag {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: #EAF4EC; color: #1F5A32; border: 1px solid #B7D9C0;
}
.pet-sf-tag.bad { background: #FEF2F0; color: #8E2B1E; border-color: #F5C6BE; }
/* ★ 2026-11-19：状态档位 × 成长倍率（顶栏 chip，替舞台左下名牌） */
.pet-sf-tier {
  font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: #EEF2FF; color: #35479B; border: 1px solid #CBD5F5;
  white-space: nowrap;
}
.pet-sf-tier.good { background: #FFF7EC; color: #B45309; border-color: #F5D9AE; }
.pet-sf-tier.bad { background: #FEF2F0; color: #8E2B1E; border-color: #F5C6BE; }
.pet-sf-rar { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.pet-sf-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.pet-sf-op {
  border: 1px solid #E7E1D4; background: #FBF9F4; color: #142B5E;
  font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 3px;
  transition: background .15s, border-color .15s;
}
.pet-sf-op:hover { background: #FFF7EC; border-color: #E67E22; }
.pet-sf-lvbox { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pet-sf-lv {
  background: linear-gradient(135deg, #8B5CF6, #7C3AED); color: #fff;
  font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 3px 9px rgba(124,58,237,.28);
}
.pet-sf-stage-name { font-size: 11.5px; color: #8A93A3; }
.pet-sf-xp { display: flex; align-items: center; gap: 7px; width: 168px; }
.pet-sf-xp .tr { flex: 1; height: 7px; border-radius: 999px; background: #EFEAFB; overflow: hidden; }
.pet-sf-xp .tr i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #A78BFA, #7C3AED); transition: width .4s ease;
}
.pet-sf-xp b { font-size: 11px; color: #7C3AED; font-weight: 700; white-space: nowrap; }
.pet-sf-hunger {
  font-size: 11.5px; font-weight: 700; color: #B45309;
  background: #FFF7EC; border: 1px solid #F5D9AE; border-radius: 999px; padding: 3px 10px;
}

/* 舞台
   🔴 2026-11-19：用 aspect-ratio 锁定房间宽高比（820:560 ≈ 1.46，贴近 steam.fun 的 1.31），
      窄屏时高度自动跟着缩，不会被压成竖条；宠物尺寸改成百分比，跟着房间等比缩放。 */
.pet-sf-stage .pet-play-wrap { gap: 12px; }
.pet-sf-stage .pet-play-stage {
  width: 100%; height: auto; aspect-ratio: 820 / 560;
  border-radius: 18px;
}
.pet-sf-stage .pet-play-pet { width: 46%; height: 77%; }

/* 底部动作条（steam.fun 大按钮观感） */
.pet-sf-stage .pet-play-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pet-sf-stage .pet-play-btn {
  border-radius: 14px; padding: 9px 8px; border: 1px solid transparent;
  display: grid; justify-items: center; gap: 1px;
}
.pet-sf-stage .pet-play-btn.pat   { background: #E8F5FE; border-color: #CDE8FA; }
.pet-sf-stage .pet-play-btn.feed  { background: #FFF4E6; border-color: #FBE0BE; }
.pet-sf-stage .pet-play-btn.game  { background: #F4F1FE; border-color: #E0D9FB; }
.pet-sf-stage .pet-play-btn.sleep { background: #EDF9F1; border-color: #C9E9D6; }
.pet-sf-stage .pet-play-btn:hover:not(:disabled) {
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,43,94,.12);
}

/* ── 右栏 ─────────────────────────────────────────── */
.pet-sf-side { display: grid; gap: 12px; min-width: 0; }
.pet-sf-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid #EDE6D8; box-shadow: 0 2px 10px rgba(124,58,237,.06);
}
.pet-sf-card-hd { display: flex; align-items: center; gap: 7px; padding: 9px 13px; color: #fff; }
.pet-sf-card-hd .ic { font-size: 14px; }
.pet-sf-card-hd b { font-size: 13px; font-weight: 800; }
.pet-sf-card-hd em {
  margin-left: auto; font-style: normal; font-size: 10.5px;
  background: rgba(255,255,255,.22); border-radius: 999px; padding: 1px 8px;
}
.pet-sf-card.purple .pet-sf-card-hd { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.pet-sf-card.blue   .pet-sf-card-hd { background: linear-gradient(135deg, #1D9BD1, #0E7BB8); }
.pet-sf-card.green  .pet-sf-card-hd { background: linear-gradient(135deg, #22AB7F, #159A6C); }
.pet-sf-card-bd { padding: 11px 12px 13px; }
.pet-sf-card.purple .pet-sf-card-bd { background: linear-gradient(180deg, #FBFAFF, #fff); }
.pet-sf-card.blue   .pet-sf-card-bd { background: linear-gradient(180deg, #F7FDFF, #fff); }
.pet-sf-card.green  .pet-sf-card-bd { background: linear-gradient(180deg, #F7FFFB, #fff); }

/* 成长阶段链 */
.pet-sf-card.purple .pet-forms { display: flex; gap: 8px; flex-wrap: wrap; }
.pet-sf-card.purple .pet-form {
  width: 46px; height: 46px; border-radius: 12px; overflow: hidden; position: relative;
  background: #F5F3FF; border: 1px solid #E9E5FF; display: grid; place-items: center;
}
.pet-sf-card.purple .pet-form img { width: 100%; height: 100%; object-fit: contain; }
.pet-sf-card.purple .pet-form .lv {
  position: absolute; left: 2px; bottom: 1px; font-size: 9px; font-weight: 800;
  background: rgba(124,58,237,.85); color: #fff; border-radius: 5px; padding: 0 4px;
}
.pet-sf-card.purple .pet-form.locked { filter: grayscale(1); opacity: .42; }
.pet-sf-card.purple .pet-form .lock {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px;
}

/* 状态条 */
.pet-sf-card.blue .pet-play-bars { grid-template-columns: 1fr; gap: 8px; }
.pet-sf-grow { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.pet-sf-grow span { font-size: 11.5px; color: #142B5E; font-weight: 600; white-space: nowrap; }
.pet-sf-grow .tr { flex: 1; height: 7px; border-radius: 999px; background: #E6F4FB; overflow: hidden; }
.pet-sf-grow .tr i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8, #0E7BB8);
}
.pet-sf-grow b { font-size: 11px; color: #0E7BB8; font-weight: 700; }
.pet-sf-meta {
  margin-top: 9px; padding-top: 8px; border-top: 1px dashed #E3EEF5;
  font-size: 11.5px; color: #5A6B7D;
}
.pet-sf-meta b { color: #142B5E; }

/* 响应式 */
@media (max-width: 1240px) {
  .pet-sf { grid-template-columns: 176px minmax(0, 1fr); }
  .pet-sf-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
    align-items: start;
  }
}
@media (max-width: 860px) {
  .pet-sf { grid-template-columns: minmax(0, 1fr); }
  .pet-sf-partners { order: 2; }
  .pet-sf-lvbox { margin-left: 0; }
}

/* ── 打磨：成长阶段未解锁格子 + 禁用按钮可读性（2026-11-14）── */
.pet-sf-card.purple .pet-form.locked img { opacity: .30; }
.pet-sf-card.purple .pet-form .lock {
  width: 22px; height: 22px; margin: auto; font-size: 12px; line-height: 22px;
  text-align: center; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #7C3AED;
  box-shadow: 0 2px 6px rgba(124,58,237,.28);
}
.pet-sf-card.purple .pet-form .lv { z-index: 2; }
.pet-sf-stage .pet-play-btn:disabled { opacity: .68; }
.pet-sf-stage .pet-play-btn:disabled b { color: #6B7686; }
.pet-sf-stage .pet-play-btn:disabled small { color: #97A0AE; }

/* ── 修复：左栏紧凑卡横向溢出 + 退役按钮越界（2026-11-14）── */
/* 🔴 2026-11-19 房间尺寸对齐 steam.fun：中间列给 820px 上限并整体居中
   （这一条在文件后部，会覆盖前面的 .pet-sf 定义，必须同步改） */
.pet-sf { grid-template-columns: 200px minmax(0, 820px) 272px; justify-content: center; }
.pet-sf-plist .pet-slot { width: 100%; min-width: 0; }
.pet-sf-plist .pet-slot .tx b,
.pet-sf-plist .pet-slot .tx small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.pet-sf-plist .pet-slot-retire {
  top: 2px; right: 2px; width: 16px; height: 16px; line-height: 14px;
  font-size: 11px; background: #fff; color: #9AA3B2;
}
.pet-sf-plist .pet-slot-retire:hover { color: #C0392B; border-color: #C0392B; }
/* 🔴 2026-11-19：同步为百分比，跟随房间等比缩放（覆盖上面的固定 330px） */
.pet-sf-stage .pet-play-pet { width: 46%; height: 77%; }

/* ── 未解锁形态：问号样式（父级不再整体灰度，否则锁图标会被一起吃掉）── */
.pet-sf-card.purple .pet-form.locked { filter: none; background: #FBFAFF; }
.pet-sf-card.purple .pet-form .q {
  font-size: 20px; font-weight: 800; color: #C4B5FD; line-height: 1;
}
.pet-sf-card.purple .pet-form .lock {
  width: 18px; height: 18px; margin: auto; font-size: 10px; line-height: 18px;
  text-align: center; border-radius: 50%;
  background: rgba(255,255,255,.95); color: #7C3AED;
  box-shadow: 0 2px 6px rgba(124,58,237,.25);
}

/* ── 修复：装备槽在窄卡里文字被压成竖排（2026-11-14）── */
.pet-gear-slot .ph { white-space: nowrap; font-size: 10.5px; }
.pet-home-grid .pet-gear-grid { gap: 6px; }
.pet-home-grid .pet-gear-slot { padding: 8px 3px; }
.pet-home-grid .pet-gear-slot .nm { font-size: 10.5px; }
.pet-home-grid .pet-gear-slot img { height: 38px; }
.pet-home-grid .pet-room-slot { padding: 8px 3px; }

/* ── 修复：成长阶段格子的 .lv 被 top+bottom 双定位拉成竖条、遮挡立绘（2026-11-14）
      原 .pet-form .lv 是 top:6px 的绝对定位，这里必须四个方向全部显式覆盖。 ── */
.pet-sf-card.purple .pet-form {
  padding: 0; position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.pet-sf-card.purple .pet-form img {
  width: 100%; height: 100%; object-fit: contain; margin: 0;
}
.pet-sf-card.purple .pet-form .lv {
  position: absolute; top: auto; right: auto; bottom: 3px; left: 3px;
  font-family: inherit; font-size: 9px; font-weight: 800; line-height: 15px;
  background: rgba(124,58,237,.88); color: #fff; border-radius: 6px;
  padding: 0 5px; z-index: 2;
}
.pet-sf-card.purple .pet-form .q {
  position: absolute; top: 50%; left: 50%; right: auto; bottom: auto;
  transform: translate(-50%,-50%);
  font-size: 20px; font-weight: 800; color: #C4B5FD; line-height: 1; z-index: 1;
}
.pet-sf-card.purple .pet-form .lock {
  position: absolute; top: 5px; left: 5px; right: auto; bottom: auto;
  transform: none; margin: 0; width: 18px; height: 18px; line-height: 18px;
  font-size: 10px; text-align: center; border-radius: 50%;
  background: rgba(255,255,255,.95); color: #7C3AED;
  box-shadow: 0 2px 6px rgba(124,58,237,.25); z-index: 3;
}
.pet-sf-card.purple .pet-form .q { font-size: 24px; color: #A78BFA; }
/* 问号加重（46px 格子内 24px 浅紫太弱） */
.pet-sf-card.purple .pet-form .q {
  font-size: 27px; font-weight: 800; color: #8B5CF6; line-height: 1;
  text-shadow: 0 1px 0 #fff;
}
.pet-sf-card.purple .pet-form .lock { width: 16px; height: 16px; line-height: 16px; font-size: 9px; }

/* ============================================================
   改名 / 出战按钮 / 宠物排行榜（2026-11-14）
   ============================================================ */

/* ── 改名（信息条里点铅笔原地编辑）── */
.pet-sf-nick { display: inline-flex; align-items: center; gap: 3px; }
.pet-sf-rename {
  border: none; background: transparent; cursor: pointer; font-size: 12px;
  padding: 1px 5px; border-radius: 6px; opacity: .5;
  transition: opacity .15s, background .15s;
}
.pet-sf-rename:hover { opacity: 1; background: #FFF7EC; }
.pet-sf-nick-input {
  width: 112px; font-size: 14px; font-weight: 800; color: #142B5E;
  border: 1.5px solid #E67E22; border-radius: 8px; padding: 2px 8px; outline: none;
  background: #FFFDF8;
}
.pet-sf-nick-input:focus { box-shadow: 0 0 0 3px rgba(230,126,34,.16); }

/* ── 出战按钮（伙伴卡上）── */
.pet-sf-deploy {
  border: 1px solid #E67E22; background: #FFF7EC; color: #C96A16;
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  transition: background .15s, color .15s;
}
.pet-sf-deploy:hover { background: #E67E22; color: #fff; }
.pet-sf-deploy:disabled { opacity: .5; cursor: not-allowed; }

/* ── 段位徽章（LOL 8 段）── */
.pet-rank-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  color: var(--rc, #8A93A3); background: #F7F8FA; border: 1px solid #E4E7EC;
  box-shadow: inset 3px 0 0 var(--rc, #8A93A3);
}

/* ── 我的段位卡 ── */
.pet-rank-mine {
  background: #fff; border: 1px solid #EDE6D8; border-radius: 16px;
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(124,58,237,.06);
}
.pet-rank-mine.empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mr-tip { font-size: 13px; color: #8A93A3; }
.mr-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mr-badge {
  width: 58px; height: 58px; flex: 0 0 auto; border-radius: 16px;
  display: grid; place-items: center; font-size: 28px;
  background: #fff; border: 2px solid var(--rc, #8A93A3);
  box-shadow: 0 6px 18px rgba(20,43,94,.12);
}
.mr-info b { display: block; font-size: 17px; font-weight: 800; color: #142B5E; }
.mr-info .mr-rank { font-size: 13px; font-weight: 800; margin-left: 6px; }
.mr-info small { display: block; font-size: 11.5px; color: #8A93A3; margin-top: 2px; }
.mr-pets { display: flex; gap: 10px; flex-wrap: wrap; }
.mr-pet {
  display: grid; justify-items: center; gap: 2px; min-width: 108px;
  padding: 9px 10px; border-radius: 13px; background: #F9FAFB; border: 1.5px solid #F0F0F0;
}
.mr-pet.on { background: linear-gradient(135deg,#F5F3FF,#EEF2FF); border-color: #C4B5FD; }
.mr-pet img { width: 42px; height: 42px; object-fit: contain; }
.mr-pet .nm { font-size: 12.5px; font-weight: 800; color: #142B5E; }
.mr-pet small { font-size: 10.5px; color: #8A93A3; }
.mr-pet .pet-rank-badge { margin-top: 3px; }

/* ── 榜单 ── */
.pet-rank-list { display: grid; gap: 8px; }
.pet-rank-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #EDE6D8; border-radius: 14px;
  padding: 9px 13px; box-shadow: 0 2px 8px rgba(124,58,237,.05);
}
.pet-rank-row.mine { border-color: #F3D9B0; background: linear-gradient(90deg,#FFFBF2,#fff); }
.pet-rank-row .no {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 8px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
  background: #F1F3F7; color: #8A93A3;
}
.pet-rank-row .no.n1 { background: linear-gradient(135deg,#FFD770,#E8A317); color: #fff; }
.pet-rank-row .no.n2 { background: linear-gradient(135deg,#E6EBF2,#B9C2CE); color: #fff; }
.pet-rank-row .no.n3 { background: linear-gradient(135deg,#E7B98A,#C9843F); color: #fff; }
.pet-rank-row .pic {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg,#F5F3FF,#EEF2FF); border: 1px solid #E9E5FF;
  display: grid; place-items: center;
}
.pet-rank-row .pic img { width: 100%; height: 100%; object-fit: contain; }
.pet-rank-row .tx { flex: 1; min-width: 0; }
.pet-rank-row .tx b {
  display: block; font-size: 13.5px; font-weight: 800; color: #142B5E;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pet-rank-row .tx small { font-size: 11px; color: #8A93A3; }
.pet-rank-row .tx .on-tag { color: #E67E22; font-style: normal; font-weight: 700; }
.pet-rank-row .wl { font-size: 11px; color: #8A93A3; white-space: nowrap; }
.pet-rank-row .rating {
  font-size: 13px; font-weight: 800; color: #142B5E;
  min-width: 44px; text-align: right;
}
.pet-rank-row .cnt {
  font-size: 12.5px; font-weight: 800; color: #E67E22;
  background: #FFF7EC; border: 1px solid #F5D9AE; border-radius: 999px; padding: 2px 11px;
}

@media (max-width: 760px) {
  .pet-rank-row .wl { display: none; }
  .pet-rank-row .tx small { font-size: 10px; }
}
