/* ============================================
   桌宠系统 — 控制台 & 管理后台样式
   ============================================ */

/* 当前宠物展示区 */
.pet-showcase { display: flex; gap: 24px; align-items: center; padding: 24px; background: linear-gradient(135deg, #f0f4ff, #faf5ff); border-radius: 14px; margin-bottom: 20px; }
.pet-preview { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 64px; border-radius: 50%; background: white; box-shadow: 0 4px 16px rgba(79,70,229,0.15); flex-shrink: 0; }
.pet-info { flex: 1; }
.pet-info h3 { font-size: 1.15rem; margin-bottom: 4px; }
.pet-info .pet-name { color: var(--primary); font-weight: 600; }
.pet-info .pet-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 6px; }

/* 皮肤墙 */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.skin-card { background: var(--card-bg); border: 2px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.skin-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(79,70,229,0.12); }
.skin-card.equipped { border-color: var(--primary); background: #eef2ff; }
.skin-card.equipped::after { content: '✓ 当前'; position: absolute; top: 8px; right: 8px; background: var(--primary); color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.skin-card.locked { opacity: 0.55; cursor: not-allowed; filter: grayscale(1); }
.skin-card.locked:hover { border-color: var(--border); box-shadow: none; }
.skin-emoji { font-size: 42px; margin-bottom: 8px; display: block; }
.skin-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.skin-condition { font-size: 0.75rem; color: var(--text-light); }
.skin-progress { margin-top: 8px; height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.skin-progress-bar { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.3s; }
.skin-progress-text { font-size: 0.7rem; color: var(--text-light); margin-top: 3px; }

/* 数据统计小卡片 */
.pet-stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.pet-stat-item { background: var(--card-bg); border-radius: 10px; padding: 16px; text-align: center; box-shadow: var(--shadow); }
.pet-stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.pet-stat-label { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* ========== 管理后台桌宠管理 ========== */
.pet-admin-section { margin-top: 20px; }
.pet-skin-form { background: #f8f9fa; border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.pet-skin-form .form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 8px; }
@media (max-width: 768px) {
  .pet-showcase { flex-direction: column; text-align: center; }
  .skin-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .pet-skin-form .form-row { grid-template-columns: 1fr; }
  .pet-stats-row { grid-template-columns: 1fr 1fr; }
}

/* ========== embed.js 桌宠样式（注入到第三方页面） ========== */
#ah-pet-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
#ah-pet-container .ah-pet-inner {
  width: 80px; height: 80px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
#ah-pet-container .ah-pet-inner:active { transform: scale(0.9); }
#ah-pet-container .ah-pet-inner.ah-pet-wave { animation: ahPulse 0.4s ease-in-out 2; }
#ah-pet-container .ah-pet-inner.ah-pet-happy { animation: ahBounce 0.6s ease; }
#ah-pet-container .ah-pet-inner.ah-pet-sleep { opacity: 0.6; }
#ah-pet-tooltip {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  background: rgba(0,0,0,0.82); color: white; padding: 8px 16px;
  border-radius: 20px; font-size: 13px; white-space: nowrap;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#ah-pet-tooltip.ah-show { opacity: 1; transform: translateY(0); }
#ah-pet-tooltip::after {
  content: ''; position: absolute; top: 100%; right: 28px;
  border: 6px solid transparent; border-top-color: rgba(0,0,0,0.82);
}

/* Emoji 浮动动画 */
@keyframes ahFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes ahPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1) rotate(5deg); }
}
@keyframes ahBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes ahSway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-8deg); }
}

/* 移动端适配 */
@media (max-width: 640px) {
  #ah-pet-container .ah-pet-inner { width: 56px; height: 56px; }
  #ah-pet-container { bottom: 12px; right: 12px; }
}
