/* 主应用：手机单栏 / 平板双栏 / 桌面三栏
   规则：圆角为 0、无渐变、间距落在 8px 网格 */

.app {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M16 0H0v16' fill='none' stroke='%232B2620' stroke-width='1'/%3E%3C/svg%3E");
}

/* ── 顶栏 ── */
.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 24px;
  background: rgba(43, 38, 32, .9);
  border-bottom: 2px solid var(--mc-ink);
}
.app-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  background: var(--mc-slot);
  object-fit: cover;
}
.app-head-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.app-head-id strong {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-head-id span { font-size: 12px; color: rgba(239, 232, 220, .5); }

.app-head-right { display: flex; align-items: center; gap: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-light);
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.chip-icon { display: flex; color: var(--accent-light); }
.chip-coin b {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0;
}
.chip-checkin { cursor: pointer; }
.chip-checkin.is-done { color: var(--accent-light); border-color: var(--accent-dark); }
.chip-admin { color: var(--accent-light); border-color: var(--accent-dark); }

/* 退出：纯文本次要操作，不与面板抢边框 */
#logoutBtn {
  padding: 4px 0;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  color: rgba(239, 232, 220, .55);
  background: transparent;
  border: none;
  box-shadow: none;
}
#logoutBtn:hover { color: var(--text-light); filter: none; }
#logoutBtn:active { transform: none; box-shadow: none; }

/* ── 主体网格：12 列，左 5 / 中 4 / 右 3 ── */
.app-main {
  flex: 1;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(12, 1fr);
  padding: var(--gap);
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.stage { grid-column: span 12; }
.stats { grid-column: span 12; }
.side { grid-column: span 12; }

@media (min-width: 768px) {
  .stage { grid-column: span 7; }
  .stats { grid-column: span 5; }
  .side { grid-column: span 12; }
}

/* ── 宠物舞台 ── */
.stage { padding: 16px; }
.stage-scene {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 4;
  max-height: 56vh;
  background-color: #93b0c0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' preserveAspectRatio='none'%3E%3Crect y='32' width='64' height='32' fill='%23719463'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18);
  overflow: hidden;
}
/* 极淡暗色遮罩，只压背景层，让画面融入深色底而不影响宠物与名牌 */
.stage-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(27, 23, 18, .12);
  pointer-events: none;
}
.stage-pet, .stage-name, .stage-level { z-index: 1; }
.stage-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.stage-canvas canvas { display: block; width: 100%; height: 100%; }
.stage-pet {
  width: 62%;
  max-height: 76%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .18));
  animation: stage-breathe 2.4s ease-in-out infinite;
}
@keyframes stage-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}
.stage-name {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-light);
  background: rgba(43, 38, 32, .82);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  white-space: nowrap;
}
.stage-level {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #4d453a;
  background: rgba(232, 226, 214, .9);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  white-space: nowrap;
}
.stage-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #4d453a;
}
.stage-clips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.stage-clip {
  min-width: 48px;
  padding: 8px;
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  background: var(--mc-light);
  color: var(--mc-ink);
  font-family: var(--font-pixel);
  font-size: 12px;
  cursor: pointer;
}
.stage-clip:hover { border-color: var(--accent); }
.stage-clip.is-active { background: var(--mc-ink); color: var(--text-light); }
.stage-clip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 状态环：方块拼成的像素环 ── */
.stats { display: flex; min-width: 0; }
.stats-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ring-wrap {
  position: relative;
  display: block;
  width: 120px;
  height: 120px;
  max-width: 100%;
}
.ring { display: block; width: 120px; height: 120px; position: relative; z-index: 0; }
.ring-num {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -54%);
  display: block;
  font-family: var(--font-pixel);
  pointer-events: none;
}
.ring-num b {
  display: block;
  font-size: calc(var(--ring-size, 120px) * .25);
  font-weight: 700;
  line-height: 1;
  color: #2c241e;
}
.ring-num i {
  position: absolute;
  left: 100%;
  bottom: 0;
  margin-left: 2px;
  font-size: calc(var(--ring-size, 120px) * .108);
  font-style: normal;
  color: #5c5449;
}
.stat-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  color: #4d453a;
}
.stat.is-low .ring-num b { color: #5e574c; }

/* ── 喂养按钮 ── */
.feed-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mc-btn-feed {
  height: 56px;
  padding: 0 8px;
  gap: 4px;
  font-size: 15px;
  letter-spacing: 0;
}
.mc-btn-feed span { display: inline-flex; align-items: center; }

/* ── 成长进度 ── */
.growth-panel {
  padding-top: 16px;
  border-top: 2px solid rgba(43, 38, 32, .18);
}
.growth-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.growth-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #3d362e;
}
.growth-value {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #5c5449;
}
.growth-track {
  height: 16px;
  background: rgba(43, 38, 32, .16);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .18);
  overflow: hidden;
}
.growth-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-dark);
  transition: width .35s steps(8, end);
}
.growth-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: #5c5449;
}
.growth-foot b { color: #3d362e; font-weight: 700; }

/* ── 分区小标题 ── */
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #3d362e;
}
.panel-meta {
  font-size: 12px;
  color: #5c5449;
}

/* ── 背包速览 ── */
.bag-panel {
  padding-top: 16px;
  border-top: 2px solid rgba(43, 38, 32, .18);
}
.bag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: #3d362e;
  background: var(--mc-light);
  border: 2px solid rgba(43, 38, 32, .22);
  border-radius: 0;
}
.bag-chip .bag-icon { display: flex; color: #5c5449; }
.bag-chip b { font-weight: 700; color: #2c241e; }
.bag-empty {
  font-size: 12px;
  color: #6a6157;
}

/* ── 每日签到卡 ── */
.checkin-card {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid rgba(43, 38, 32, .18);
}
.checkin-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.checkin-days { font-size: 13px; color: #3d362e; }
.checkin-days b { font-size: 16px; color: #2c241e; }
.checkin-btn {
  padding: 8px 16px;
  font-size: 13px;
}
.checkin-btn.is-done {
  background: var(--mc-btn);
  color: var(--text-light);
  box-shadow:
    inset 3px 3px 0 rgba(255, 255, 255, .42),
    inset -3px -3px 0 rgba(0, 0, 0, .3),
    0 4px 0 rgba(0, 0, 0, .28);
}

/* ── 今日运势 ── */
.fortune-card {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid rgba(43, 38, 32, .18);
}
.fortune-level {
  display: block;
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--accent-dark);
}
.fortune-card .fortune-text {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #3d362e;
}

/* ── 功能九宫格 ── */
.side {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .nav-grid { grid-template-columns: repeat(6, 1fr); }
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text);
  background: var(--mc-btn);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .4), inset -2px -2px 0 rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: transform .06s steps(2, end);
}
.nav-item:active { transform: translate(2px, 2px); }
.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2c241e;
}

/* 弹出的提示浮层 */
.float-hint {
  position: absolute;
  z-index: 5;
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-light);
  background: rgba(43, 38, 32, .9);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  pointer-events: none;
  animation: float-up 1.1s ease-out forwards;
}
@keyframes float-up {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-42px); }
}

/* ── 模块浮层 ── */
body.module-open { overflow: hidden; }

.module {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 12, 9, .68);
  animation: module-fade .16s steps(3, end);
}
@keyframes module-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.module-panel {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  background: var(--mc-panel);
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--mc-dark);
  border-bottom: 2px solid var(--mc-ink);
}
.module-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 17px;
  color: var(--text-light);
  letter-spacing: 1px;
}
.module-icon { display: flex; color: var(--text-light); }
.module-close { flex: none; display: inline-flex; align-items: center; }

.module-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  color: var(--text);
  font-size: 14px;
}

/* ── 模块通用排版 ── */
.module-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.module-note {
  margin: 8px 0;
  font-size: 12px;
  color: #5c5449;
}
.module-sub {
  margin: 16px 0 8px;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: #4d453a;
  border-bottom: 2px solid rgba(43, 38, 32, .18);
  padding-bottom: 8px;
}
.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.module-actions .mc-btn { display: inline-flex; align-items: center; gap: 8px; }
.module-big {
  font-family: var(--font-pixel);
  font-size: 22px;
  text-align: center;
  color: #4d453a;
  margin: 16px 0 8px;
}

.mc-btn-small {
  flex: none;
  padding: 8px 16px;
  font-size: 13px;
}

/* ── 进度条 ── */
.bar-row {
  display: grid;
  grid-template-columns: 64px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.bar-label { font-size: 12px; color: #5c5449; }
.bar-track {
  height: 16px;
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .35);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .35s steps(8, end);
}
.bar-num {
  font-family: var(--font-pixel);
  font-size: 13px;
  text-align: right;
  color: #4d453a;
}

/* ── 商店 / 背包列表 ── */
.shop-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--mc-light);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .5), inset -2px -2px 0 rgba(0, 0, 0, .16);
}
.shop-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mc-light);
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-info strong { font-family: var(--font-pixel); font-size: 14px; color: #3d362e; }
.shop-info span { font-size: 12px; color: #6a6157; }

/* ── 社交动态 ── */
.post-box { display: flex; gap: 8px; margin-bottom: 16px; }
.post-box .mc-btn { flex: none; }
.post-list { display: flex; flex-direction: column; gap: 8px; }
.post-item {
  padding: 8px 16px;
  background: var(--mc-light);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.post-head strong { font-family: var(--font-pixel); font-size: 13px; color: #3d362e; }
.post-head span { font-size: 11px; color: var(--muted); }
.post-text { font-size: 14px; line-height: 1.55; word-break: break-word; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #6a6157;
  background: var(--mc-btn);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  cursor: pointer;
}
.like-btn.is-liked { color: var(--danger); }

/* ── 附近宠物 ── */
.nearby-list { display: flex; flex-direction: column; gap: 8px; }
.nearby-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--mc-light);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.nearby-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.nearby-item strong { display: block; font-family: var(--font-pixel); font-size: 14px; color: #3d362e; }
.nearby-item span { font-size: 12px; color: #6a6157; }

/* ── 个人中心 ── */
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.profile-name { display: block; font-family: var(--font-pixel); font-size: 17px; color: #3d362e; }
.profile-head span { font-size: 12px; color: var(--muted); }

.module-body .stat-row { padding: 16px 8px; }
.module-body .stat-label { margin-top: 0; }
.stat-num { font-family: var(--font-pixel); font-size: 20px; color: #3d362e; }

/* ── 成就 ── */
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: rgba(232, 226, 214, .55);
  border: 2px solid rgba(43, 38, 32, .22);
  border-radius: 0;
}
.ach-item.is-done { background: var(--mc-light); border-color: var(--mc-ink); }
.ach-mark { display: flex; color: #9c9284; }
.ach-item.is-done .ach-mark { color: var(--accent); }
.ach-item strong { display: block; font-family: var(--font-pixel); font-size: 13px; color: #3d362e; }
.ach-item span { font-size: 12px; color: #6a6157; }

/* ── 排行榜 ── */
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.rank-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--mc-light);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.rank-item.is-me { background: rgba(255, 138, 76, .22); }
.rank-no {
  font-family: var(--font-pixel);
  font-size: 16px;
  text-align: center;
  color: #6a6157;
}
.rank-item.is-me .rank-no { color: var(--accent-dark); }
.rank-name { font-family: var(--font-pixel); font-size: 14px; color: #3d362e; }
.rank-value { font-size: 12px; color: #6a6157; white-space: nowrap; }

/* ── 外观皮肤 ── */
.skin-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.skin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: #3d362e;
  background: var(--mc-light);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  cursor: pointer;
}
.skin-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}
.skin-item em { font-style: normal; font-size: 11px; color: var(--accent-dark); }
.skin-item.is-current { box-shadow: 0 0 0 2px var(--accent); }
.skin-item.is-locked { filter: grayscale(.85) brightness(.85); cursor: not-allowed; }

/* ── 宠物详情头部 ── */
.pet-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.pet-head-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--mc-slot);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}
.pet-name { font-family: var(--font-pixel); font-size: 18px; color: #3d362e; }
.pet-sub { font-size: 12px; color: #6a6157; margin-top: 4px; }

/* ── 今日运势 ── */
.fortune { text-align: center; padding: 8px 0 4px; }
.fortune-level {
  font-family: var(--font-pixel);
  font-size: 30px;
  color: var(--accent-dark);
}
.fortune-text {
  margin: 16px 0;
  font-size: 15px;
  line-height: 1.6;
  color: #3d362e;
}

/* ═══ 主页背景点阵（黑金 / 玫瑰金）═══ */
.app-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.app > *:not(.app-field) { position: relative; z-index: 1; }

/* ═══ 宠物反馈：气泡 / 动作 / 告警 ═══ */
.pet-bubble {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 3;
  margin: 0;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-light);
  background: rgba(43, 38, 32, .92);
  border: 2px solid var(--mc-ink);
  border-radius: 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
  white-space: nowrap;
  transform: translateX(-50%);
  animation: bubble-in .16s steps(2, end);
}
@keyframes bubble-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.pet-alert {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #d93a3a;
  background: rgba(27, 23, 18, .88);
  border: 2px solid #d93a3a;
  border-radius: 0;
  animation: warn-blink 1s steps(2, end) infinite;
}
@keyframes warn-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* 动作反馈：位移与形变都是整像素，配合 steps 保持硬边 */
.stage-pet.is-act-food { animation: pet-feed .4s steps(3, end) 3; }
.stage-pet.is-act-clean { animation: pet-clean .4s steps(3, end) 3; }
.stage-pet.is-act-play { animation: pet-play .4s steps(3, end) 3; }
@keyframes pet-feed {
  0%, 100% { transform: translateY(0) scale(1); }
  33% { transform: translateY(0) scale(1.08, .9); }
  66% { transform: translateY(-4px) scale(.94, 1.06); }
}
@keyframes pet-clean {
  0%, 100% { transform: translateX(0); }
  33% { transform: translateX(-4px); }
  66% { transform: translateX(4px); }
}
@keyframes pet-play {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.stage-trait {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #6a6157;
}

/* 掉落提示：中上方浮起的像素文字 */
.loot-pop {
  position: fixed;
  top: 24%;
  left: 50%;
  z-index: 70;
  margin: 0;
  padding: 8px 16px;
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #ffeccb;
  background: rgba(43, 38, 32, .94);
  border: 2px solid #d4af37;
  border-radius: 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  white-space: nowrap;
  pointer-events: none;
  animation: loot-float 1.4s steps(6, end) forwards;
}
@keyframes loot-float {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -32px); }
}

/* ═══ 预警：数值低于 20% 时环与数字转红并闪烁 ═══ */
.stat.is-warn .ring-num b,
.stat.is-warn .ring-num i { color: #d93a3a; }
.stat.is-warn { animation: warn-blink 1s steps(2, end) infinite; }

/* ═══ 按下反馈：阴影消失并向右下位移 ═══ */
.mc-btn-feed:active,
.mc-btn-primary:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* ═══ 九宫格红点：可领取奖励时右上角 4px 红方块 ═══ */
.nav-item { position: relative; }
.nav-item.has-dot::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #d93a3a;
  border: 2px solid var(--mc-ink);
  border-radius: 0;
}

/* 背包面板头部的工具区 */
.bag-tools { display: inline-flex; align-items: center; gap: 8px; }
.bag-view { padding: 4px 8px; font-size: 12px; }

@media (max-width: 480px) {
  .module { padding: 16px; }
  .module-body { padding: 16px; }
  .post-box { flex-direction: column; }
  .rank-item { grid-template-columns: 32px 1fr; }
  .rank-value { grid-column: 2; }
}

/* ── 桌面三栏：左 5 / 中 4 / 右 3，高度按内容对齐 ── */
@media (min-width: 1200px) {
  .stage { grid-column: span 5; }
  .stats { grid-column: span 4; }
  .side { grid-column: span 3; }

  .app-main { align-content: start; }
  .stage { display: flex; flex-direction: column; }
  .stage-scene { flex: 1; min-height: 360px; aspect-ratio: auto; max-height: none; }
  .nav-grid { grid-template-columns: repeat(3, 1fr); }
}
