/* ==========================================================================
 * 学习宠物 · 页面样式（全部 pet- 前缀，避免与 app.css 通用类冲突）
 * 风格：明亮、圆润、有画面感，符合中小学生审美且不喧宾夺主
 * ========================================================================== */
.petp {
  --pet-ink: #24304a;
  --pet-ink2: #5b6b8c;
  --pet-ink3: #93a1bd;
  --pet-card: #fff;
  --pet-line: #eaeefb;
  --pet-brand: #5b6ef5;
  --pet-brand2: #22c1a4;
  --pet-gold: #f7b32b;
  --pet-pink: #ff7ba8;
  --pet-r: 18px;
  background:
    radial-gradient(circle at 8% -6%, rgba(91, 110, 245, .16), transparent 42%),
    radial-gradient(circle at 92% 4%, rgba(255, 190, 120, .22), transparent 40%),
    radial-gradient(circle at 50% 108%, rgba(34, 193, 164, .16), transparent 45%),
    #f3f6fd;
  background-attachment: fixed;
}
.petp .pet-wrap { max-width: 1120px; margin: 0 auto; padding: 16px 14px 46px; }

/* ---------------- 顶栏小组件 ---------------- */
.petp .pet-chip {
  font-size: 13px; font-weight: 700; color: #241a05;
  background: linear-gradient(135deg, #ffe08a, #ffb43d);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(247, 179, 43, .35);
}
.petp .pet-chip b { font-size: 15px; }

/* ---------------- 页签 ---------------- */
.petp .pet-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; }
.petp .pet-tabs::-webkit-scrollbar { display: none; }
.petp .pet-tab {
  border: 1px solid var(--pet-line); background: #fff; color: var(--pet-ink2);
  border-radius: 999px; padding: 8px 18px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: .16s;
}
.petp .pet-tab:hover { border-color: #c7ceff; }
.petp .pet-tab.on {
  background: linear-gradient(135deg, var(--pet-brand), #7b8cff 45%, var(--pet-brand2));
  color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(91, 110, 245, .28);
}
.petp .pet-view { display: none; }
.petp .pet-view.on { display: block; animation: petFade .28s ease; }
@keyframes petFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 卡片 ---------------- */
.petp .pet-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.petp .pet-side { display: grid; gap: 14px; }
.petp .pet-card {
  background: var(--pet-card); border: 1px solid var(--pet-line); border-radius: var(--pet-r);
  padding: 14px 15px; box-shadow: 0 6px 22px rgba(36, 48, 74, .06);
}
.petp .pet-card + .pet-card { margin-top: 0; }
.petp .pet-hd {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 15.5px; font-weight: 800; color: var(--pet-ink); margin-bottom: 10px;
}
.petp .pet-sub { font-size: 12px; font-weight: 600; color: var(--pet-ink3); }
.petp .pet-dim { font-size: 12.5px; color: var(--pet-ink3); line-height: 1.6; }

/* ---------------- 宠物舞台 ---------------- */
.petp .pet-stage {
  position: relative; border-radius: 20px; overflow: hidden; min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #eaf6ff 0%, #f7fbff 60%, #eefaf4 100%);
  border: 1px solid #e6eefc; cursor: pointer;
}
.petp .pet-stage.small { min-height: 240px; }
.petp .pet-stage:active { transform: scale(.995); }
.petp .pet-art { width: 100%; max-width: 340px; display: block; }
.petp .pet-art svg { width: 100%; height: auto; display: block; }
.petp .pet-bubble {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%) scale(.6);
  max-width: 76%; background: #fff; color: var(--pet-ink); font-size: 13px; font-weight: 600;
  border-radius: 14px; padding: 8px 12px; box-shadow: 0 6px 18px rgba(36, 48, 74, .14);
  opacity: 0; pointer-events: none; transition: all .26s cubic-bezier(.2, 1.3, .5, 1); line-height: 1.5;
}
.petp .pet-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px;
  background: #fff; transform: translateX(-50%) rotate(45deg);
}
.petp .pet-bubble.on { opacity: 1; transform: translateX(-50%) scale(1); }
.petp .pet-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* 宠物动画 */
.petp .pet-bob { animation: petBob 3.2s ease-in-out infinite; transform-origin: center bottom; }
@keyframes petBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.petp .pet-wob { animation: petWob 2.6s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes petWob { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
.petp .pet-float { animation: petFloat 4.2s ease-in-out infinite; }
@keyframes petFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(-1.5deg); } }
.petp .pet-blink { animation: petBlink 4.6s infinite; transform-origin: center; }
@keyframes petBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
.petp .pet-hop { animation: petHop .62s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes petHop { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-26px) scale(1.06); } 60% { transform: translateY(0) scale(.96); } 100% { transform: translateY(0) scale(1); } }
.petp .pet-think { animation: petThink .9s ease; }
@keyframes petThink { 0% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 60% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
.petp .pet-spin { animation: petSpin 1s ease; }
@keyframes petSpin { to { transform: rotate(360deg); } }
.petp .pet-twinkle { animation: petTw 2.4s ease-in-out infinite; }
@keyframes petTw { 0%, 100% { opacity: .35; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.12); } }
.petp .pet-ring { animation: petRing 6s linear infinite; transform-origin: center; }
@keyframes petRing { to { transform: rotate(360deg); } }
.petp .pet-puff { animation: petPuff 3.4s ease-in-out infinite; }
@keyframes petPuff { 0%, 100% { opacity: .25; transform: translateY(4px) scale(.9); } 50% { opacity: .75; transform: translateY(-6px) scale(1.05); } }

/* 喂养飞星 + 气泡粒子 */
.petp .pet-fly {
  position: absolute; font-size: 22px; pointer-events: none; z-index: 5;
  transition: transform .85s cubic-bezier(.4, .1, .3, 1), opacity .85s; opacity: 1;
}
.petp .pet-part {
  position: absolute; bottom: 30%; font-size: 20px; pointer-events: none;
  animation: petPart 1.5s ease-out forwards; opacity: 0;
}
@keyframes petPart {
  0% { opacity: 0; transform: translateY(10px) scale(.6); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.25); }
}

/* ---------------- 宠物信息条 ---------------- */
.petp .pet-nameRow { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.petp .pet-name { font-size: 19px; font-weight: 800; color: var(--pet-ink); }
.petp .pet-btn.tiny {
  border: 1px solid var(--pet-line); background: #fff; color: var(--pet-ink2);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.petp .pet-btn.tiny:hover { border-color: #c7ceff; color: var(--pet-brand); }
.petp .pet-titleBadge {
  margin-left: auto; font-size: 12px; font-weight: 800; color: #6b3f00;
  background: linear-gradient(135deg, #ffe9b0, #ffcf6b);
  border-radius: 999px; padding: 3px 12px; box-shadow: 0 3px 10px rgba(247, 179, 43, .3);
}
.petp .pet-moodRow { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--pet-ink2); font-weight: 600; }
.petp .pet-moodRow b { color: var(--pet-ink); font-size: 14px; }
.petp .pet-vitbar { height: 8px; border-radius: 999px; background: #eef1fa; overflow: hidden; margin-top: 6px; }
.petp .pet-vitbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d399, #fbbf24); transition: width .6s ease; }
.petp .pet-tip {
  margin-top: 10px; font-size: 12.5px; color: #3d5a80; background: #f4f8ff;
  border: 1px dashed #d7e2f7; border-radius: 12px; padding: 8px 11px; line-height: 1.6;
}

/* ---------------- 成长进度 ---------------- */
.petp .pet-bar { height: 14px; border-radius: 999px; background: #eef1fa; overflow: hidden; }
.petp .pet-bar i {
  display: block; height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, #6ee7b7, #5b6ef5 60%, #a78bfa);
  transition: width .8s cubic-bezier(.2, .9, .3, 1);
  box-shadow: inset 0 -2px 6px rgba(255, 255, 255, .5);
}
.petp .pet-barTxt { display: flex; justify-content: space-between; font-size: 12px; color: var(--pet-ink3); margin-top: 4px; font-weight: 600; }
.petp .pet-next { margin-top: 10px; display: grid; gap: 6px; }
.petp .pet-cond {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--pet-ink2);
  background: #f7f9ff; border: 1px solid var(--pet-line); border-radius: 11px; padding: 6px 10px;
}
.petp .pet-cond .dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; background: #cbd5e1; flex: 0 0 auto; }
.petp .pet-cond.done { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.petp .pet-cond.done .dot { background: #22c55e; }
.petp .pet-cond b { color: inherit; font-weight: 800; }

/* ---------------- 喂养 ---------------- */
.petp .pet-feedRow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.petp .pet-feedInfo { font-size: 13px; font-weight: 700; color: var(--pet-ink); line-height: 1.7; }
.petp .pet-feedInfo b { font-size: 17px; color: var(--pet-brand); }
.petp .pet-btn {
  border: 0; cursor: pointer; border-radius: 14px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #6b7cff, #5b6ef5 50%, #22c1a4); padding: 10px 18px; font-size: 15px;
  box-shadow: 0 8px 20px rgba(91, 110, 245, .3); transition: .16s; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; line-height: 1.4;
}
.petp .pet-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.petp .pet-btn:active { transform: translateY(0); }
.petp .pet-btn.big { padding: 13px 22px; font-size: 16px; }
.petp .pet-btn.ghost { background: #fff; color: var(--pet-brand); border: 1px solid #d9e0ff; box-shadow: none; }
.petp .pet-btn[disabled], .petp .pet-btn.off { background: #eef1f7; color: #9aa6bd; box-shadow: none; cursor: not-allowed; border: 1px solid #e6eaf3; }
.petp .pet-rule { margin-top: 10px; font-size: 12px; color: var(--pet-ink3); line-height: 1.7; }

/* ---------------- 修炼场卡 ---------------- */
.petp .pet-pk { background: linear-gradient(135deg, #f7f5ff, #eef4ff 55%, #f2fffb); }
.petp .pet-pkRow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.petp .pet-pkItem {
  background: #fff; border: 1px solid var(--pet-line); border-radius: 14px; padding: 8px 4px; text-align: center;
}
.petp .pet-pkItem span { display: block; font-size: 11.5px; color: var(--pet-ink3); font-weight: 700; }
.petp .pet-pkItem b { display: block; font-size: 19px; color: var(--pet-brand); }

/* ---------------- 价值观小卡 ---------------- */
.petp .pet-values { margin-top: 14px; }
.petp .pet-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.petp .pet-list li { font-size: 13px; color: var(--pet-ink2); line-height: 1.7; }
.petp .pet-list b { color: #1f3a68; }

/* ---------------- 装扮页 ---------------- */
.petp .pet-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.petp .pet-cat {
  border: 1px solid var(--pet-line); background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--pet-ink2); cursor: pointer; transition: .15s;
}
.petp .pet-cat.on { background: linear-gradient(135deg, var(--pet-brand), var(--pet-brand2)); color: #fff; border-color: transparent; }
.petp .pet-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.petp .pet-item {
  border: 1px solid var(--pet-line); border-radius: 14px; padding: 10px; background: #fff;
  display: flex; flex-direction: column; gap: 6px; transition: .16s;
}
.petp .pet-item:hover { box-shadow: 0 6px 16px rgba(36, 48, 74, .1); transform: translateY(-1px); }
.petp .pet-item.on { border-color: #b7c0ff; box-shadow: 0 0 0 2px rgba(91, 110, 245, .18); }
.petp .pet-item.lock { background: #fbfcff; }
.petp .pet-itemTop { display: flex; align-items: center; gap: 8px; }
.petp .pet-itemIcon { width: 42px; height: 42px; border-radius: 12px; background: #f4f7ff; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.petp .pet-itemIcon svg { width: 34px; height: 34px; }
.petp .pet-itemName { font-size: 13.5px; font-weight: 800; color: var(--pet-ink); }
.petp .pet-itemRare { font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 7px; display: inline-block; margin-top: 2px; }
.petp .r-普通 { background: #eef2f7; color: #64748b; }
.petp .r-稀有 { background: #eef2ff; color: #4338ca; }
.petp .r-限定 { background: #fff1e6; color: #b45309; }
.petp .r-成就 { background: #ecfdf5; color: #047857; }
.petp .r-限时 { background: #fdf2f8; color: #be185d; }
.petp .pet-itemHow { font-size: 11.5px; color: var(--pet-ink3); line-height: 1.6; min-height: 34px; }
.petp .pet-itemAct { display: flex; gap: 6px; }
.petp .pet-mini {
  border: 0; border-radius: 10px; padding: 5px 10px; font-size: 12px; font-weight: 800; cursor: pointer;
  background: linear-gradient(135deg, #6b7cff, #5b6ef5); color: #fff;
}
.petp .pet-mini.gray { background: #eef1f7; color: #7c8aa5; }
.petp .pet-mini[disabled] { background: #eef1f7; color: #adb7c9; cursor: not-allowed; }

.petp .pet-avatars { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.petp .pet-avaBox { text-align: center; font-size: 11.5px; color: var(--pet-ink3); font-weight: 700; }
.petp .pet-ava { width: 96px; height: 96px; position: relative; }
.petp .pet-ava svg { width: 100%; height: 100%; display: block; }
.petp .pet-equipList { display: grid; gap: 5px; flex: 1; min-width: 200px; }
.petp .pet-equipRow { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--pet-ink2); }
.petp .pet-equipRow b { color: var(--pet-ink); font-weight: 800; }
.petp .pet-equipRow span.k { color: var(--pet-ink3); min-width: 64px; }

/* ---------------- 相册 / 成就 ---------------- */
.petp .pet-achv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.petp .pet-achvItem {
  border: 1px solid var(--pet-line); border-radius: 14px; padding: 10px; background: #fff;
  display: flex; gap: 9px; align-items: center;
}
.petp .pet-achvItem.off { filter: grayscale(1); opacity: .55; }
.petp .pet-achvIco { font-size: 24px; line-height: 1; }
.petp .pet-achvName { font-size: 13px; font-weight: 800; color: var(--pet-ink); }
.petp .pet-achvDesc { font-size: 11.5px; color: var(--pet-ink3); line-height: 1.5; }
.petp .pet-album { display: grid; gap: 8px; max-height: 460px; overflow: auto; padding-right: 4px; }
.petp .pet-albumRow {
  display: flex; gap: 10px; align-items: flex-start; border-left: 3px solid #d7e2f7;
  padding: 4px 0 4px 10px; position: relative;
}
.petp .pet-albumRow.evolve { border-left-color: #a78bfa; }
.petp .pet-albumRow.dress { border-left-color: #fbbf24; }
.petp .pet-albumRow.achv { border-left-color: #34d399; }
.petp .pet-albumRow.pk { border-left-color: #60a5fa; }
.petp .pet-albumIco { font-size: 18px; }
.petp .pet-albumTxt { font-size: 13px; color: var(--pet-ink); line-height: 1.6; }
.petp .pet-albumAt { font-size: 11px; color: var(--pet-ink3); }

/* ---------------- 弹窗 ---------------- */
.petp .pet-mask {
  position: fixed; inset: 0; background: rgba(20, 27, 45, .55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 18px;
}
.petp .pet-mask.on { display: flex; animation: petFade .2s ease; }
.petp .pet-modal {
  background: #fff; border-radius: 22px; padding: 22px 20px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 24px 60px rgba(20, 27, 45, .32); animation: petPop .34s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes petPop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.petp .pet-modal h3 { font-size: 19px; font-weight: 800; color: var(--pet-ink); margin-bottom: 6px; }
.petp .pet-modal p { margin: 6px 0 0; font-size: 13.5px; color: var(--pet-ink2); line-height: 1.7; }
.petp .pet-modal .pet-modalIco { font-size: 46px; line-height: 1; margin-bottom: 6px; display: block; animation: petBob 2.4s ease-in-out infinite; }
.petp .pet-modal input {
  width: 100%; border: 1px solid var(--pet-line); border-radius: 12px; padding: 10px 12px; font-size: 15px; margin-top: 10px;
}
.petp .pet-modalBtns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 880px) {
  .petp .pet-grid { grid-template-columns: 1fr; }
  .petp .pet-stage { min-height: 260px; }
}
@media (max-width: 520px) {
  .petp .pet-wrap { padding: 12px 10px 40px; }
  .petp .pet-card { padding: 12px 12px; border-radius: 16px; }
  .petp .pet-items { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .petp .pet-pkRow { grid-template-columns: repeat(2, 1fr); }
  .petp .pet-feedRow { flex-direction: column; align-items: stretch; }
  .petp .pet-btn.big { width: 100%; justify-content: center; }
}
