@charset "UTF-8";
/* ==========================================================================
   论坛萌宠 (pet_garden) · 前台 + 后台样式
   配色硬规则：仅使用站点主题 CSS 变量，不写死色值 → 自动跟随 Clara 暖米 / trae 深色两套皮肤
   ========================================================================== */

/* ---------- 通用零件 ---------- */
.pg-emoji { font-size: 26px; line-height: 1; }

.pg-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 2px;
  background: var(--soft);
  color: var(--tx-2);
}
.pg-badge-lv { background: var(--ac-soft); color: var(--ac-2); }

.pg-bar {
  position: relative;
  height: 10px;
  background: var(--soft);
  border: 1px solid var(--bd);
  overflow: hidden;
}
.pg-bar-mini { height: 6px; }
.pg-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ac);
  transition: width .55s cubic-bezier(.2, .7, .3, 1);
}
.pg-bar-exp { background: linear-gradient(90deg, var(--ac), var(--ac-2)); }
.pg-bar-sat { background: var(--ok); }
.pg-bar-warn { background: var(--warn); }

.pg-empty { color: var(--tx-3); font-size: 13px; padding: 8px 0; }

/* ---------- 页面骨架 ---------- */
.pg-page { display: block; max-width: 1020px; margin: 0 auto; }
.pg-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pg-hero-text h1 { font-size: 20px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.pg-hero-text p { margin: 0; color: var(--tx-2); font-size: 13px; line-height: 1.7; }

.pg-nologin { text-align: center; padding: 40px 20px; }
.pg-nologin p { color: var(--tx-2); margin-bottom: 16px; }

/* ---------- 领养 ---------- */
.pg-adopt-form { padding: 4px 0 0; }
.pg-species-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.pg-species-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1px solid var(--bd);
  background: var(--card);
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}
.pg-species-card:hover { border-color: var(--ac); transform: translateY(-2px); }
.pg-species-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.pg-species-card:has(input:checked) { border-color: var(--ac); background: var(--ac-soft); }
.pg-species-figure { height: 92px; display: flex; align-items: flex-end; justify-content: center; }
.pg-species-figure img { max-height: 92px; max-width: 100%; object-fit: contain; }
.pg-species-card b { font-size: 14px; }
.pg-species-card small { color: var(--tx-3); font-size: 12px; line-height: 1.6; }
.pg-name-field { max-width: 420px; }
.pg-adopt-btn { margin-top: 4px; }

/* ---------- 主界面两栏 ---------- */
.pg-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start; /* 两栏各按内容高度收缩，避免短卡片被拉伸留大片空白 */
}

/* ---------- 宠物卡 ---------- */
.pg-pet-card { position: relative; overflow: hidden; }
.pg-link-btn {
  background: none;
  border: 0;
  color: var(--tx-3);
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
}
.pg-link-btn:hover { color: var(--ac); }

.pg-stage {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 240px;
  padding: 12px 0 4px;
}
.pg-figure { position: relative; z-index: 2; animation: pg-float 3.6s ease-in-out infinite; }
.pg-figure img,
.pg-figure > .pg-emoji {
  display: block;
  max-height: 230px;
  max-width: 100%;
  object-fit: contain;
  transform-origin: 50% 88%;
  animation: pg-blink 5.4s ease-in-out infinite;
}
.pg-emoji-lg { font-size: 96px; }

.pg-figure.pg-expr-happy { animation: pg-jump .9s ease-out both, pg-float 3.8s ease-in-out .9s infinite; }
.pg-figure.pg-expr-sad { animation: pg-sway 3.2s ease-in-out infinite; }
.pg-figure.pg-expr-hungry { animation: pg-shake 1.5s ease-in-out infinite; }
.pg-figure.pg-expr-sick { animation: pg-float 5.2s ease-in-out infinite; }
.pg-figure.pg-expr-sick img { animation: pg-dim 3.4s ease-in-out infinite; }

.pg-glow {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 260px;
  height: 260px;
  transform: translate(-50%, 22%);
  background: radial-gradient(circle, var(--ac-soft) 0%, transparent 68%);
  opacity: .9;
  pointer-events: none;
  z-index: 1;
}
.pg-evolve-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 160px;
  margin: -80px 0 0 -80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ac) 0%, transparent 62%);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.pg-evolve-flash.is-on { animation: pg-flash 1s ease-out 1; }

.pg-state { text-align: center; margin: 4px 0 16px; color: var(--tx-2); font-size: 13px; }
.pg-state b { color: var(--tx); margin-right: 6px; }

.pg-meters { display: flex; flex-direction: column; gap: 14px; }
.pg-meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tx-2);
  margin-bottom: 6px;
}
.pg-meter-head > span { display: inline-flex; align-items: center; gap: 4px; }
.pg-meter-hint { margin: 6px 0 0; font-size: 11px; color: var(--tx-3); }

/* 操作区：同一行控件必须等高。
   原先用 align-items:center，只对齐中线、不管高度，而三个控件的内边距各不相同
   （能量框 6/12、喂食 .btn 9/22、手动投喂 .btn-sm 6/14）→ 实测本征高度
   46.7 / 39.6 / 32.2px，并排必然高低错落、「可用能量」那块最明显。
   改为 align-items:stretch：同一 flex 行自动取该行最高者，全部拉齐；
   两个按钮再用 flex-grow 铺满该行（喂食 2、手动投喂 1），右端不再参差。
   实测（check_layout.py）：四种宽度下三个控件均为 39.59px。 */
.pg-actions {
  /* 控件统一高度 = .btn 的高度：padding 9+9 + 行高 1.4×14 + 边框 2 = 39.6px。
     横排时 align-items:stretch 已自动拉齐，这个值只在竖排（≤480px 断点）下起作用 ——
     那时能量框是纯文字、本征仅 34.7px，比按钮矮近 5px，单看就是「矮一截」。
     能量框与按钮共用同一变量，将来改 .btn 尺寸只需改这一处。 */
  --pg-ctl-h: 39.6px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pg-energy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  min-height: var(--pg-ctl-h);
  background: var(--soft);
  border: 1px solid var(--bd);
}
/* 数值与文字竖排居中。去掉撑高的 line-height（原来 b 是 1.1、small 继承 1.6 的 11px），
   让能量框的本征高度贴近 .btn 的 ≈40px，再由 stretch 补齐 ——
   这样它单独占一行时也不会突然变矮。 */
.pg-energy > div { display: flex; flex-direction: column; justify-content: center; }
.pg-energy b { font-size: 17px; line-height: 1.15; color: var(--ac-2); }
.pg-energy small { color: var(--tx-3); font-size: 11px; line-height: 1.2; }
.pg-energy-icon { color: var(--ac); display: inline-flex; }
.pg-action-hint { margin: 12px 0 0; font-size: 11px; color: var(--tx-3); line-height: 1.8; }
.pg-manual-wait { color: var(--tx-3); margin-left: 4px; }

/* ---------- 养成页侧栏（能量来源 + 最近动态） ---------- */
.pg-side { display: flex; flex-direction: column; gap: 20px; }
.pg-side-block + .pg-side-block { padding-top: 18px; border-top: 1px dashed var(--bd-2); }
.pg-side-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
}
.pg-side-tip {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
  font-size: 11px;
  line-height: 1.7;
  color: var(--tx-3);
}
.pg-side-tip .ic { flex: 0 0 auto; margin-top: 2px; }

/* 能量来源：图标 + 名称 + 约束 + 数值徽标 */
.pg-source-list { list-style: none; margin: 0; padding: 0; }
.pg-source-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bd);
  font-size: 13px;
}
.pg-source-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.pg-source-ico {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ac-soft);
  color: var(--ac-2);
}
.pg-source-ico .ic { display: block; }
.pg-source-name { flex: 0 0 auto; font-weight: 600; color: var(--tx); }
.pg-source-meta {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 11px;
  color: var(--tx-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-source-val {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 1px 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ok);
  background: var(--ok-soft);
}

/* 最近动态：竖向时间轴 */
.pg-log-list { list-style: none; margin: 0; padding: 0; }
.pg-log-list li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 13px 15px;
  font-size: 12.5px;
}
.pg-log-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 7px;
  bottom: -1px;
  width: 1px;
  background: var(--bd);
}
.pg-log-list li:last-child { padding-bottom: 0; }
.pg-log-list li:last-child::before { display: none; }
.pg-log-dot {
  position: absolute;
  left: 1px;
  top: 6px;
  width: 7px;
  height: 7px;
  background: var(--tx-3);
  box-shadow: 0 0 0 2px var(--card);
}
.pg-log-dot.is-up { background: var(--ok); }
.pg-log-dot.is-down { background: var(--err); }
.pg-log-dot.is-feed { background: var(--ac); }
.pg-log-dot.is-energy { background: var(--warn); }
.pg-log-note { flex: 1; min-width: 0; color: var(--tx-2); line-height: 1.6; }
.pg-log-tail { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 6px; }
.pg-log-tail time { font-size: 11px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.pg-log-amt { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-log-amt.is-up { color: var(--ok); }
.pg-log-amt.is-down { color: var(--err); }

/* 养成页按钮微调（配色仍由站点 .btn / .btn-ghost 决定，两套皮肤各自正确）
   grow 用来铺满所在行：宽处三个控件排成一行时，喂食 grow 2 拿更多空间，
   保证主操作比次操作（手动投喂）更宽，层级不倒挂；
   窄处自动换行后，喂食与能量框合占第一行、手动投喂单独铺满第二行。 */
.pg-feed-btn { font-weight: 700; flex: 2 1 auto; }
.pg-manual-btn { flex: 1 1 auto; }
/* 与能量框共用高度（见 .pg-actions 的 --pg-ctl-h），保证竖排时三者等高 */
.pg-actions .btn { min-height: var(--pg-ctl-h); }
.pg-manual-btn .pg-manual-wait { color: var(--tx-3); font-size: 11px; }
.pg-adopt { padding-top: 4px; }

/* 侧栏 / 榜单 */
.pg-rank-list { list-style: none; margin: 0; padding: 0; }
.pg-rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd);
}
.pg-rank-list li:last-child { border-bottom: 0; }
.pg-rank-no {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--soft);
  color: var(--tx-3);
}
.pg-rank-no-1 { background: var(--ac); color: #fff; }
.pg-rank-no-2 { background: var(--ac-soft); color: var(--ac-2); }
.pg-rank-no-3 { background: var(--ac-soft); color: var(--ac-2); }
:root[data-theme] .pg-rank-no-1, body.theme-trae .pg-rank-no-1 { color: #0A0C0A; }
.pg-rank-pet { flex: 0 0 auto; width: 34px; height: 34px; display: flex; align-items: flex-end; justify-content: center; }
.pg-rank-pet img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pg-rank-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pg-rank-main b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-rank-main small { color: var(--tx-3); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-side-card .pg-side-entry { font-size: 12px; color: var(--tx-3); }
.pg-side-card .pg-side-entry:hover { color: var(--ac); }
.pg-side-foot { margin: 10px 0 0; font-size: 12px; }
.pg-rank-card { margin-top: 4px; }
.pg-rank-table .pg-rank-pet { width: 64px; height: 52px; }
/* 侧栏紧凑变体：条目更密、形象更小 */
.pg-rank-list-compact li { padding: 6px 0; gap: 8px; }
.pg-rank-list-compact .pg-rank-pet { width: 30px; height: 30px; }
.pg-rank-list-compact .pg-rank-main b { font-size: 12.5px; }
.pg-rank-list-compact .pg-rank-main small { font-size: 10.5px; }

/* ---------- 用户主页 / 用户中心 ---------- */
.pg-panel { margin-top: 16px; }
/* 用户主页「萌宠」页签下的档案卡。这个类除样式外还兼作功能标记：
   plugin.php 的 layout_head 会注入
   #profile-tabs>*:not(.tab-bar):not(.pg-panel-profile){display:none}
   把核心因 tab 白名单归一而多渲染的面板隐藏掉，靠它把本卡片排除在外 —— 改名要两处同改。
   样式上：卡片是 .tab-bar 的直接兄弟，间距已由 .tab-bar 的 margin-bottom:18px 提供，
   这里抵消 .pg-panel 自带的 16px，否则比核心面板（.thread-list 等）多出一截。 */
.pg-panel-profile { margin-top: 0; }
.pg-panel-body { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pg-panel-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.pg-panel-name { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 15px; }
.pg-meter { min-width: 0; }
.pg-stage-sm { min-height: 150px; }
.pg-stage-sm .pg-figure img { max-height: 140px; }
.pg-stage-sm .pg-glow { width: 170px; height: 170px; }
.pg-uc-row { display: flex; align-items: center; gap: 12px; }
.pg-stage-xs { min-height: 60px; padding: 0; }
.pg-stage-xs .pg-figure img { max-height: 56px; }
.pg-uc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-uc-block { margin-bottom: 16px; }

/* ---------- 楼层徽章 ---------- */
.pg-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 0 5px 0 1px;
  border: 1px solid var(--bd);
  background: var(--soft);
  vertical-align: middle;
  text-decoration: none;
  line-height: 1;
}
.pg-badge-chip:hover { border-color: var(--ac); }
.pg-badge-figure { width: 24px; height: 24px; display: flex; align-items: flex-end; justify-content: center; }
.pg-badge-figure img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pg-badge-figure .pg-emoji { font-size: 15px; }
.pg-badge-text { font-size: 10px; font-weight: 700; color: var(--tx-2); }
.pg-badge-chip.is-hungry .pg-badge-text,
.pg-badge-chip.is-sick .pg-badge-text { color: var(--warn); }

/* ---------- 后台 ----------
   站点 admin.css 已提供 .filter-form / .filter-total / .filter-bar / .ta-r /
   .tab-bar / .grid3 / .switch-label / .row-inline，一律复用，不重复造。
   这里只补站点没有、而萌宠后台确实需要的三处。 */
.pg-admin-form { display: flex; flex-direction: column; gap: 16px; }
/* 站点 .card 自带 margin-bottom:16px，与 flex gap 叠加会出现 32px 空档 */
.pg-admin-form .card { margin-bottom: 0; }
.pg-admin-submit { display: flex; justify-content: flex-end; }
.pg-group-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0; }
.pg-group-check { font-weight: 400; }

/* 站点 .filter-bar 没有 flex-wrap，萌宠流水细分到 10 个类型，窄屏会溢出卡片 */
.pg-filter-bar { flex-wrap: wrap; row-gap: 4px; }

/* 操作列：站点后台普遍是 4 个操作，挤一行会撑爆列宽并挤扁其他列。
   做成「补经验」独占一行 + 三个按钮一行，列宽 190px 即可容纳。 */
.pg-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pg-act-row { display: flex; align-items: center; gap: 4px; }
.pg-act .inline-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.pg-act input[type=number] { width: 64px; padding: 5px 8px; font-size: 12.5px; }

/* ---------- 动画 ---------- */
@keyframes pg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pg-blink {
  0%, 95%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(.93); }
}
@keyframes pg-jump {
  0% { transform: translateY(0) scale(1); }
  28% { transform: translateY(-28px) scale(1.06); }
  52% { transform: translateY(0) scale(.95); }
  72% { transform: translateY(-12px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes pg-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-5px) rotate(-1deg); }
  75% { transform: translateX(5px) rotate(1deg); }
}
@keyframes pg-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
@keyframes pg-dim {
  0%, 100% { filter: saturate(.78) brightness(.97); }
  50% { filter: saturate(.58) brightness(.9); }
}
@keyframes pg-flash {
  0% { opacity: 0; transform: scale(.55); }
  38% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.7); }
}

@media (prefers-reduced-motion: reduce) {
  .pg-figure, .pg-figure img, .pg-figure > .pg-emoji, .pg-evolve-flash.is-on { animation: none !important; }
}

/* ---------- 改名弹窗 ----------
   骨架完全复用站点 .modal-overlay / .modal-box / .modal-head / .modal-body / .modal-foot，
   颜色取自主题变量（--tx-2 / --bd / --ac），因此浅色 Clara 与深色 trae 皮肤自动一致；
   此处只补插件自己的留白与报价行强调，不新造组件。 */
#pgRenameModal .modal-body .field { margin-bottom: 0; }
#pgRenameModal .modal-body .form-hint { margin-top: 8px; }
#pgRenameModal [data-pg-rename-hint] { color: var(--tx-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .pg-main { grid-template-columns: minmax(0, 1fr); }
  .pg-species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-stage { min-height: 190px; }
  .pg-figure img { max-height: 180px; }
  .pg-glow { width: 200px; height: 200px; }
}
@media (max-width: 480px) {
  .pg-actions { flex-direction: column; align-items: stretch; }
  /* 竖排时主轴变成纵向，必须收回 flex-grow，否则按钮会被纵向拉伸 */
  .pg-actions .btn { flex: 0 0 auto; width: 100%; }
  .pg-energy { justify-content: center; }
}
