:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --ink: #15231e;
  --muted: #65736c;
  --line: #dce5dd;
  --green: #2f8f73;
  --green-dark: #17644f;
  --mint: #dff4ea;
  --gold: #f4a62a;
  --red: #d75b52;
  --blue: #4787d6;
  --card: #ffffff;
  --shadow: 0 12px 34px rgba(31, 53, 44, .10);
  --theme: #2f8f73;
  --theme-2: #5bbf91;
  --theme-soft: #e5f6ed;
  --theme-warm: #fff2cf;
}

* { box-sizing: border-box; }
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--theme) 42%, rgba(255,255,255,.75)) rgba(255,255,255,.22);
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255,255,255,.20);
}
*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.48);
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 52%, #ffffff), rgba(255,255,255,.72));
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 68%, #ffffff), rgba(255,255,255,.86));
}
*::-webkit-scrollbar-corner { background: transparent; }
[class*="scroll"],
[class*="track"],
[class*="wall"],
[class*="grid"],
[class*="wrap"] {
  -webkit-overflow-scrolling: touch;
}
html, body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.72)),
    url("/pic/背景.webp") center top / min(100vw, 520px) auto fixed repeat-y;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
.app {
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 8px 10px calc(76px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.52));
}
.theme-boy { --theme: #327fd8; --theme-2: #38bad0; --theme-soft: #e5f4ff; --theme-warm: #e9fff7; --green: #327fd8; --green-dark: #205c9f; --mint: #e5f4ff; }
.theme-girl { --theme: #d95f9f; --theme-2: #a56be8; --theme-soft: #fff0f7; --theme-warm: #f6eeff; --green: #d95f9f; --green-dark: #9b3d73; --mint: #fff0f7; }
.theme-neutral { --theme: #2f8f73; --theme-2: #5bbf91; --theme-soft: #e5f6ed; --theme-warm: #fff2cf; }
.screen { display: none; }
.screen.active { display: block; }

.auth {
  min-height: 100vh;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px 8px 28px;
}
.auth::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 16%, rgba(255,255,255,.76), rgba(255,255,255,0) 32%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.62));
  pointer-events: none;
}
.auth-brand {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding-top: 6px;
}
/* 登录页 logo 右上角入口：详细介绍 / 使用教程 */
.auth-brand-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.brand-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--theme) 28%, transparent);
  background: rgba(255,255,255,.78);
  color: var(--green-dark, #17644f);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(31, 53, 44, .08);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.brand-action-link:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 12%, white), color-mix(in srgb, var(--theme-2) 16%, white));
  box-shadow: 0 6px 14px rgba(31, 53, 44, .12);
  transform: translateY(-1px);
}
.brand-action-link:active { transform: translateY(0) scale(.97); }
@media (max-width: 480px) {
  .brand-action-link { padding: 4px 10px; font-size: 11.5px; }
}
.auth-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--theme), var(--theme-2));
  color: white;
  font-size: 26px;
  font-weight: 900;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--theme) 28%, transparent);
}
.auth-logo-img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--theme) 24%, transparent);
}
.auth-brand h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: 0;
}
.auth-brand p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 58%, var(--theme));
  font-size: 14px;
  font-weight: 750;
}
.panel {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 53, 44, .08), inset 0 1px 0 rgba(255,255,255,.58);
  padding: 12px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  justify-self: center;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.84);
  border-color: rgba(255,255,255,.95);
  box-shadow: 0 18px 46px rgba(31, 53, 44, .14), inset 0 1px 0 rgba(255,255,255,.86);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.tab-btn, .ghost-btn, .primary-btn, .icon-btn { min-height: 44px; border-radius: 8px; }
.tab-btn { background: #edf4ef; color: var(--muted); font-weight: 700; }
.tab-btn.active { background: var(--green); color: white; }
.auth-card .tabs {
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--theme-soft) 58%, white);
}
.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.role-tab {
  min-height: 50px;
  display: grid;
  align-content: center;
  padding: 9px 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  border: 1px solid color-mix(in srgb, var(--theme) 14%, rgba(255,255,255,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}
.role-tab b {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}
.role-tab span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 750;
}
.role-tab.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 92%, #fff), var(--theme-2));
  border-color: rgba(255,255,255,.88);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--theme) 26%, transparent);
}
.role-tab.active b,
.role-tab.active span {
  color: white;
}
.auth-card .tab-btn {
  min-height: 40px;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
}
.auth-card .tab-btn.active {
  background: white;
  color: var(--theme);
  box-shadow: 0 8px 18px rgba(31, 53, 44, .10);
}
.field { display: grid; gap: 6px; margin: 10px 0; }
.field span { color: var(--muted); font-size: 13px; }
.field input, .field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--theme) 15%, var(--line));
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255,255,255,.92);
  outline: none;
}
.auth-card .field {
  gap: 7px;
  margin: 12px 0;
}
.auth-card .field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.auth-card .field input {
  min-height: 48px;
  border-radius: 13px;
  border-color: color-mix(in srgb, var(--theme) 16%, #d9e4de);
  background: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 143, 115, .14); }
.password-eye-field {
  position: relative;
  display: grid;
  align-items: center;
}
.password-eye-field input {
  padding-right: 46px;
}
.password-eye-btn {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--theme) 16%, transparent);
  background: rgba(255,255,255,.84);
  color: var(--muted);
  font-size: 15px;
  box-shadow: 0 6px 14px rgba(31, 53, 44, .08);
}
.password-eye-btn.active {
  color: var(--theme);
  background: color-mix(in srgb, var(--theme-soft) 72%, white);
}
.date-selects {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 6px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--theme) 10%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-soft) 42%, white);
}
.date-selects select {
  min-height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
  border-color: rgba(255,255,255,.88);
  background: white;
}
.form-hint { margin: 6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.primary-btn { width: 100%; background: var(--green); color: white; font-weight: 800; }
.auth-submit {
  min-height: 50px;
  margin-top: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--theme), var(--theme-2));
  box-shadow: 0 14px 26px color-mix(in srgb, var(--theme) 28%, transparent);
}
.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--theme);
}
.auth-switch-btn {
  margin-left: auto;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 12%, white), color-mix(in srgb, var(--theme-2) 16%, white));
  color: var(--green-dark, #17644f);
  border: 1px solid color-mix(in srgb, var(--theme) 22%, transparent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}
.auth-switch-btn:active { transform: scale(.94); }
.auth-switch-link {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--green, #2f8f73);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.ghost-btn { background: #edf4ef; color: var(--green-dark); font-weight: 750; padding: 0 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -8px -10px 8px;
  padding: 5px 8px 3px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border-bottom: 1px solid rgba(255,255,255,.64);
  box-shadow: 0 6px 16px rgba(31, 53, 44, .05);
  transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.topbar.scrolled {
  background: linear-gradient(180deg, #ffffff, #ffffff);
  border-bottom-color: rgba(220, 229, 221, .95);
  box-shadow: 0 8px 20px rgba(31, 53, 44, .12);
}
.kid-strip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 2px 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.kid-pill {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 0;
  width: 46px;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  scroll-snap-align: start;
  box-shadow: none;
}
.kid-pill.active {
  color: var(--green-dark);
  background: transparent;
  box-shadow: none;
}
.kid-pill.active::after {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 3px 8px rgba(47, 143, 115, .25);
}
.kid-name { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.05; text-align: center; }
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.86);
  background: linear-gradient(135deg, #ffffff, #e8f6ed);
  overflow: hidden;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  flex: 0 0 36px;
  box-shadow: 0 7px 16px rgba(31, 53, 44, .10);
}
.kid-pill.active .avatar {
  border-color: color-mix(in srgb, var(--theme) 62%, white);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--theme) 26%, transparent), inset 0 0 0 2px rgba(255,255,255,.85);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.kid-audit-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.96);
  background: linear-gradient(135deg, #ff6b79, #e13257);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(225, 50, 87, .28);
}
.pet-list-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pet-list-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-list-image.emoji { font-size: 24px; }
.pet-list-levels {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}
.pet-mini-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-mini-image.emoji { font-size: 20px; }
.pet-book {
  display: grid;
  gap: 12px;
  max-height: 792px;
  overflow-y: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-book-series {
  display: grid;
  gap: 8px;
}
.pet-book-series h4 {
  margin: 0;
  color: var(--green-dark);
  font-size: 14px;
}
.pet-book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pet-book-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 8px 18px rgba(39, 47, 61, .06);
}
.pet-book-card > b {
  display: block;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 14px;
  text-align: center;
}
.pet-level-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.pet-level-view {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 8px;
  background: rgba(255,255,255,.26);
}
.pet-book-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-book-image.emoji { font-size: 32px; }
.pet-level-view em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
/* ===== 公告滚动条 ===== */
.announcement-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff7e6, #fffbea);
  border: 1px solid #ffe3a3;
  box-shadow: 0 2px 6px rgba(232, 175, 53, .12);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  transition: max-height .3s ease, opacity .3s ease, padding .3s ease, margin .3s ease, border-width .3s ease;
}
.announcement-bar.show {
  max-height: 36px;
  opacity: 1;
  padding-top: 4px;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-width: 1px;
}
.announce-icon { flex: 0 0 auto; font-size: 13px; line-height: 1; }
.announce-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  white-space: nowrap;
}
.announce-text {
  display: inline-block;
  padding-right: 40px;
  font-size: 11.5px;
  font-weight: 600;
  color: #8a5a00;
  line-height: 1.4;
  animation: announce-scroll 18s linear infinite;
  flex-shrink: 0;
}
@keyframes announce-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.announce-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(138, 90, 0, .12);
  color: #8a5a00;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.announce-close:active { background: rgba(138, 90, 0, .25); }
@media (prefers-reduced-motion: reduce) {
  .announce-text { animation: none; padding-right: 12px; }
  .announce-track { overflow-x: auto; }
}
.kid-strip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 2px 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.kid-pill {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 0;
  width: 46px;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  scroll-snap-align: start;
  box-shadow: none;
}
.kid-pill.active {
  color: var(--green-dark);
  background: transparent;
  box-shadow: none;
}
.kid-pill.active::after {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 3px 8px rgba(47, 143, 115, .25);
}
.kid-name { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.05; text-align: center; }
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.86);
  background: linear-gradient(135deg, #ffffff, #e8f6ed);
  overflow: hidden;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  flex: 0 0 36px;
  box-shadow: 0 7px 16px rgba(31, 53, 44, .10);
}
.kid-pill.active .avatar {
  border-color: color-mix(in srgb, var(--theme) 62%, white);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--theme) 26%, transparent), inset 0 0 0 2px rgba(255,255,255,.85);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.kid-audit-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.96);
  background: linear-gradient(135deg, #ff6b79, #e13257);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(225, 50, 87, .28);
}
.pet-list-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pet-list-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-list-image.emoji { font-size: 24px; }
.pet-list-levels {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}
.pet-mini-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-mini-image.emoji { font-size: 20px; }
.pet-book {
  display: grid;
  gap: 12px;
  max-height: 792px;
  overflow-y: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-book-series {
  display: grid;
  gap: 8px;
}
.pet-book-series h4 {
  margin: 0;
  color: var(--green-dark);
  font-size: 14px;
}
.pet-book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pet-book-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 8px 18px rgba(39, 47, 61, .06);
}
.pet-book-card > b {
  display: block;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 14px;
  text-align: center;
}
.pet-level-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.pet-level-view {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 8px;
  background: rgba(255,255,255,.26);
}
.pet-book-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-book-image.emoji { font-size: 32px; }
.pet-level-view em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

/* ===== 宠物图鉴解锁/锁定状态 ===== */
.pet-book-card {
  position: relative;
}
.pet-book-card.pet-book-locked {
  opacity: 0.9;
}
.pet-book-image-locked {
  filter: grayscale(100%) brightness(0.75) contrast(0.9);
  -webkit-filter: grayscale(100%) brightness(0.75) contrast(0.9);
  opacity: 0.82;
}
.pet-level-view-locked {
  cursor: pointer;
}

/* 已召唤神兽印章（缩小版） */
.pet-book-stamp {
  position: absolute;
  top: 30px;
  right: -10px;
  transform: rotate(12deg);
  padding: 2px 14px;
  font-size: 10px;
  font-weight: 800;
  color: #d32f2f;
  border: 1.5px solid #d32f2f;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.5px;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(211, 47, 47, 0.15);
  opacity: 0.88;
  user-select: none;
}
.pet-book-unlocked {
  border-color: rgba(211, 47, 47, 0.28);
  background: rgba(255, 245, 245, 0.32);
}
.add-kid-pill {
  width: 46px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
}
.add-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(47, 143, 115, .42);
  background: rgba(255,255,255,.74);
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 7px 16px rgba(31, 53, 44, .07);
}

.hero-card {
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.10) 0%, color-mix(in srgb, var(--theme-soft) 8%, transparent) 58%, rgba(255,255,255,.04) 100%);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--theme) 9%, transparent), inset 0 1px 0 rgba(255,255,255,.60);
}
.growth-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(172px, 56%) minmax(104px, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 236px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.10) 0%, color-mix(in srgb, var(--theme-soft) 8%, transparent) 56%, rgba(255,255,255,.04) 100%);
  border-top: 1px solid rgba(255,255,255,.96);
}
.growth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.52), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 1px, transparent 1px 12px);
  opacity: .55;
}
.growth-card > * { position: relative; z-index: 1; }
.pet-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(142px, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
}
.pet-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  min-width: 50px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 241, 190, .95);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, color-mix(in srgb, var(--theme-soft) 45%, #fff4c9) 42%, color-mix(in srgb, var(--theme) 42%, #f6c84d) 100%);
  color: color-mix(in srgb, var(--theme) 54%, #4a2d05);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(127, 82, 14, .22), inset 0 1px 0 rgba(255,255,255,.62);
}
.change-pet-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(47, 143, 115, .22);
  background: rgba(255,255,255,.82);
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31, 53, 44, .12);
}
.pet-restaurant-btn {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 2;
  width: 72px;
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #743d0f;
  font-size: 12px;
  font-weight: 950;
  box-shadow: none;
}
.pet-restaurant-btn img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 7px 10px rgba(118, 62, 19, .20));
}
.pet-restaurant-btn b {
  white-space: nowrap;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 5px 12px rgba(118, 62, 19, .10);
}
.pet-restaurant-compact {
  width: 58px;
  min-height: 64px;
  font-size: 10px;
}
.pet-restaurant-compact img {
  width: 44px;
  height: 44px;
}
.growth-info {
  display: grid;
  align-content: center;
  min-width: 0;
}
.eyebrow { display: inline-flex; margin-bottom: 8px; color: var(--green-dark); font-weight: 850; font-size: 12px; }
.child-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.growth-info h2 { margin: 0; font-size: 22px; line-height: 1.14; overflow-wrap: anywhere; }
.child-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}
.growth-info p { margin: 6px 0 10px; color: var(--muted); line-height: 1.35; font-size: 12px; overflow-wrap: anywhere; }
.profile-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(47, 143, 115, .18);
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 20px rgba(31, 53, 44, .10);
}
.profile-avatar .avatar {
  width: 59px;
  height: 59px;
  font-size: 25px;
  background: #edf8f1;
}
.readonly-avatar {
  pointer-events: none;
}
.child-home-card .mini-actions,
.child-home-card [data-edit-child],
.child-home-card [data-delete-child] {
  display: none;
}
.pet-stage { position: relative; display: grid; place-items: center; min-height: 142px; align-self: stretch; }
.egg-stage {
  isolation: isolate;
}
.egg-stage::before {
  content: none;
}
.egg-stage::after {
  content: none;
}
.egg-stage .pet-face {
  position: relative;
  transform-origin: center bottom;
  background: transparent;
  filter: drop-shadow(0 22px 18px rgba(72, 96, 86, .18));
  animation: eggFloat 2.8s ease-in-out infinite;
}
.egg-stage .pet-face::before,
.egg-stage .pet-face::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 198, 83, .9);
  box-shadow:
    30px -16px 0 rgba(47, 143, 115, .48),
    -26px 16px 0 rgba(244, 188, 66, .48),
    38px 20px 0 rgba(255, 255, 255, .82);
  animation: sparkleDrift 2.8s ease-in-out infinite;
}
.egg-stage .pet-face::before {
  top: 18%;
  left: 2%;
}
.egg-stage .pet-face::after {
  right: 4%;
  bottom: 30%;
  animation-delay: .9s;
}
@keyframes hatchGlow {
  0%, 100% { transform: scale(.94); opacity: .72; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes eggFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg) scale(1); }
  45% { transform: translateY(-7px) rotate(1.5deg) scale(1.035); }
  70% { transform: translateY(-3px) rotate(-.6deg) scale(1.012); }
}
@keyframes sparkleDrift {
  0%, 100% { opacity: .45; transform: translateY(0) scale(.86); }
  50% { opacity: 1; transform: translateY(-8px) scale(1.08); }
}
.pet-face {
  position: relative;
  width: 100%;
  min-width: 118px;
  max-width: 208px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: transparent;
  font-size: clamp(104px, 35vw, 158px);
  box-shadow: none;
  animation: petBreath 2.6s ease-in-out infinite;
}
.pet-image {
  width: 122%;
  height: 122%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.pet-image.emoji {
  display: grid;
  place-items: center;
  font-size: inherit;
  line-height: 1;
}
.egg-stage .pet-image {
  width: 104%;
  height: 104%;
}
.pet-caption {
  min-height: 20px;
  margin-top: -4px;
  text-align: center;
  color: #244d42;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes petBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.045); }
}
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.growth-card .metrics { grid-template-columns: 1fr; margin-top: 0; gap: 9px; }
.metric { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.90); border-radius: 8px; padding: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.66), 0 8px 18px rgba(31,53,44,.05); }
.growth-card .metric {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}
.metric b { display: block; font-size: 22px; margin-bottom: 3px; }
.metric span { color: var(--muted); font-size: 12px; }
.growth-card .metric b { margin: 0; font-size: 21px; order: 2; }
.growth-card .metric span { order: 1; font-weight: 750; }
.metric.score b { color: var(--green-dark); }
.metric.coin b { color: #ad6906; }
.metric.growth b { color: var(--blue); }
.medal-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--theme) 12%, rgba(196, 122, 24, .18));
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), color-mix(in srgb, var(--theme-warm) 6%, transparent));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  text-align: left;
}
.medal-title { color: color-mix(in srgb, var(--theme) 46%, #7c5210); font-size: 12px; font-weight: 900; text-align: center; }
.medal-icons { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.medal-mark {
  position: relative;
  min-width: 21px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-style: normal;
  filter: drop-shadow(0 5px 7px rgba(74, 52, 13, .16));
}
.medal-mark::before {
  content: "";
  position: absolute;
  top: 0;
  width: 21px;
  height: 23px;
  border-radius: 7px 7px 10px 10px;
  clip-path: polygon(50% 0, 92% 13%, 92% 58%, 50% 100%, 8% 58%, 8% 13%);
  border: 1px solid rgba(255,255,255,.70);
  background: var(--medal-fill);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.72),
    inset 0 -5px 8px rgba(49, 31, 6, .16);
  z-index: 1;
}
.medal-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.95) 0 18%, transparent 19%),
    var(--core-fill);
  z-index: 2;
  box-shadow: inset 0 -2px 3px rgba(50, 28, 5, .18);
}
.medal-mark {
  --medal-fill: linear-gradient(135deg, #f8fbff, #bcc7d2 48%, #7f8b96);
  --core-fill: linear-gradient(135deg, #ffffff, #9faeba);
}
.medal-mark span { display: none; }
.medal-level-1 { --medal-fill: linear-gradient(135deg, #ffffff 0%, #cfd8df 44%, #7c8994 100%); --core-fill: linear-gradient(135deg, #f9fcff, #a7b5c0); }
.medal-level-2 { --medal-fill: linear-gradient(135deg, #fff7ce 0%, #e5aa28 48%, #9e6209 100%); --core-fill: linear-gradient(135deg, #fff8c8, #d58c13); }
.medal-level-3 { --medal-fill: linear-gradient(135deg, #fff1cf 0%, #b87df0 42%, #5930a7 72%, #d79d2a 100%); --core-fill: linear-gradient(135deg, #fff0c2, #7b48d6); }
.medal-empty { --medal-fill: linear-gradient(135deg, #f3f5f3, #d7dfda); --core-fill: linear-gradient(135deg, #ffffff, #c0cac4); opacity: .72; }
.no-medal {
  color: #9aa39d;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}
.progress { margin-top: 14px; display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.growth-card .progress { margin-top: 0; }
.pet-progress {
  padding: 0 2px;
}
.bar {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), color-mix(in srgb, var(--theme-soft) 72%, #e2ece6));
  border: 1px solid rgba(47, 143, 115, .14);
  box-shadow: inset 0 2px 5px rgba(34, 70, 55, .08);
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--theme) 0%, var(--theme-2) 58%, #f4bc42 100%);
  border-radius: inherit;
  transition: width .3s ease;
}
.bar b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #18362d;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.pet-action {
  width: 100%;
  min-height: 36px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: white;
  box-shadow: 0 9px 20px rgba(31, 53, 44, .12);
}
.pet-action.adopt {
  background: linear-gradient(135deg, var(--theme), var(--theme-2));
}
.pet-action.summon {
  background: linear-gradient(135deg, #5f3fb8, #df9b35);
}
.pet-action.readonly-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 72%, white), color-mix(in srgb, var(--theme-2) 70%, white));
}
.child-restaurant-section {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 232, 168, .42), transparent 34%),
    rgba(255,255,255,.16);
  box-shadow: 0 12px 28px rgba(31, 53, 44, .10), inset 0 1px 0 rgba(255,255,255,.52);
}
.child-food-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 334px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.child-food-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.74);
  background: rgba(255,255,255,.58);
  box-shadow: 0 8px 18px rgba(143, 86, 33, .10), inset 0 1px 0 rgba(255,255,255,.78);
}
.child-food-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 11px;
  background: #fff3d8;
}
.child-food-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.child-food-card b {
  color: #5c3515;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.child-food-meta {
  display: grid;
  gap: 3px;
}
.child-food-meta span,
.child-food-meta em {
  min-height: 17px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(255, 246, 226, .84);
  color: #8d5c24;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}
.child-food-meta em {
  background: rgba(255, 233, 247, .86);
  color: #b64f93;
}
.child-feed-btn {
  min-height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8f6e, #f44f8d);
  color: white;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 7px 14px rgba(218, 80, 91, .18);
}
.pet-file-card {
  display: block;
  padding: 18px;
  min-height: 340px;
}
.pet-panel-large {
  min-height: 300px;
}
.pet-panel-large .pet-stage {
  min-height: 230px;
}
.pet-panel-large .pet-face {
  max-width: 292px;
  font-size: clamp(150px, 48vw, 236px);
}
.pet-panel-large .pet-caption {
  font-size: 16px;
}

.section { margin-top: 9px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.section-title h3 { margin: 0; font-size: 16px; }
.section-title .shop-balance { margin-left: 8px; }
.review-alert-btn {
  position: relative;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--theme);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(31, 53, 44, .10);
}
.review-alert-btn.has-review {
  background: linear-gradient(135deg, #ff7f7a, #f0a431);
  color: white;
}
.review-alert-btn b {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #d75b52;
  font-size: 11px;
}
.task-review-sheet { max-height: 76vh; }
.task-review-list { max-height: 56vh; overflow-y: auto; }
.rules-header {
  display: grid;
  grid-template-columns: 82px 1fr 82px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rules-header h3 {
  margin: 0;
  text-align: center;
  font-size: 18px;
}
.back-home-btn {
  min-height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #e3f4ea);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(47, 143, 115, .18);
  box-shadow: 0 6px 14px rgba(31, 53, 44, .08);
}
.small { color: var(--muted); font-size: 13px; }
.rules-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05)),
    linear-gradient(135deg, color-mix(in srgb, var(--theme-soft) 6%, transparent), transparent);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 12px 10px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.58);
}
.rule-scroll {
  display: grid;
  gap: 10px;
}
.rule-group + .rule-group { padding-top: 10px; border-top: 1px dashed var(--line); }
.group-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.group-title b { font-size: 15px; }
.group-title span { color: var(--muted); font-size: 12px; }
.rule-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 5);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 2px 7px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.rule-btn {
  min-height: 68px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 20px 1fr 16px;
  place-items: center;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.92);
  color: var(--ink);
  text-align: center;
  padding: 6px 4px 5px;
  min-width: 0;
  scroll-snap-align: start;
  box-shadow:
    0 7px 16px rgba(31, 53, 44, .09),
    inset 0 1px 0 rgba(255,255,255,.68);
  transition: transform .16s ease, box-shadow .16s ease;
}
.rule-btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 4px 10px rgba(31, 53, 44, .08), inset 0 1px 0 rgba(255,255,255,.86);
}
.rule-btn strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(45, 54, 49, .10));
}
.rule-btn span {
  width: 100%;
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.08;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rule-btn em {
  min-width: 30px;
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-style: normal;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}
.rule-btn.plus {
  border-color: rgba(180, 223, 204, .72);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(244,255,249,.06));
}
.rule-btn.minus {
  border-color: rgba(240, 196, 191, .76);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,243,241,.07));
}
.theme-boy .rule-btn.plus { border-color: rgba(183, 221, 255, .82); background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(241,249,255,.07)); }
.theme-girl .rule-btn.plus { border-color: rgba(245, 191, 217, .82); background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,245,251,.07)); }
.rule-btn.plus em { color: var(--green-dark); }
.rule-btn.minus em { color: var(--red); }
.empty-text { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.list { display: grid; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.90);
  border-radius: 8px;
  padding: 9px;
}
.item-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-main > div { min-width: 0; }
.item-main b { display: block; overflow-wrap: anywhere; }
.item-main span:not(.avatar):not(.task-inline-actions) { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.shop-section {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(31, 53, 44, .08), inset 0 1px 0 rgba(255,255,255,.58);
}
.compact-title-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.shop-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 486px;
  overflow-y: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.gift-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 7px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.56), rgba(255,255,255,.36)),
    color-mix(in srgb, var(--theme-soft) 16%, transparent);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow:
    0 9px 20px rgba(31, 53, 44, .10),
    inset 0 1px 0 rgba(255,255,255,.76);
}
.gift-image-box {
  width: 100%;
  aspect-ratio: 8 / 5;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  line-height: 0;
  background: rgba(255,255,255,.54);
  border: 1px solid rgba(220, 229, 224, .82);
  box-shadow: inset 0 1px 8px rgba(31, 53, 44, .05);
}
.gift-image-box.readonly {
  cursor: default;
}
.gift-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gift-placeholder {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 24px;
  background: rgba(255,255,255,.72);
}
.gift-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}
.gift-name-row b {
  min-width: 0;
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gift-edit-chip {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 72%, #f36aa6));
  box-shadow: 0 6px 12px color-mix(in srgb, var(--theme) 20%, transparent);
}
.gift-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  min-height: 20px;
}
.gift-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.gift-meta strong {
  color: var(--theme);
  font-size: 12px;
  line-height: 1;
}
.gift-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gift-actions button {
  min-height: 27px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 7px 14px rgba(31, 53, 44, .10);
}
.gift-actions button:disabled {
  cursor: not-allowed;
  background: linear-gradient(135deg, #c7cfca, #aeb7b2);
  color: rgba(255,255,255,.82);
  box-shadow: none;
  opacity: .82;
}
.gift-exchange {
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 62%, #ff7ab8));
}
.gift-delete {
  background: linear-gradient(135deg, #ff7a7a, #f35f65);
}
.gift-edit-sheet .form-hint {
  margin: 0 0 10px;
}
.gift-form-image-box {
  width: 100%;
  aspect-ratio: 8 / 5;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--theme) 42%, rgba(255,255,255,.8));
  background: rgba(255,255,255,.36);
  margin-bottom: 10px;
}
.gift-form-image-box .gift-image {
  position: absolute;
  inset: 0;
}
.gift-form-image-box em {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
  color: var(--theme);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(31, 53, 44, .08);
}
.gift-image-action-sheet .row {
  margin-top: 10px;
}
.gift-action-preview {
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.86);
}
.gift-action-preview .gift-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.exchange-item {
  align-items: center;
}
.exchange-section {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(31, 53, 44, .07), inset 0 1px 0 rgba(255,255,255,.52);
}
.exchange-list {
  max-height: 296px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.exchange-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.exchange-actions .mini-btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}
.task-mode-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 6px;
  margin-right: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme) 14%, rgba(255,255,255,.72));
  color: var(--theme);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}
.task-blocked-btn {
  color: var(--muted);
  background: rgba(230, 235, 232, .82);
  border-color: rgba(205, 215, 210, .86);
}

.task-info {
  min-width: 0;
}
.task-stage-progress {
  width: min(220px, 100%);
  margin-top: 7px;
  display: grid;
  gap: 5px;
}
.task-stage-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  line-height: 1.2;
}
.task-stage-progress-top strong {
  color: var(--green-dark);
  font-weight: 900;
}
.task-stage-progress-top em {
  flex: 0 0 auto;
  color: rgba(73, 96, 84, .72);
  font-style: normal;
  font-weight: 800;
}
.task-stage-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 143, 115, .14);
}
.task-stage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ab7, #39b98f);
}
.task-done {
  opacity: .82;
}
.task-done .avatar {
  background: linear-gradient(135deg, #eaf8ee, #d9f0e4);
  color: var(--green);
}
.task-create-card,
.task-board {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.50);
  box-shadow: 0 8px 18px rgba(31, 53, 44, .07), inset 0 1px 0 rgba(255,255,255,.55);
}
.task-create-card {
  padding: 8px 10px;
}
.task-create-card .section-title {
  margin-bottom: 3px;
}
.task-create-card .field {
  gap: 3px;
  margin: 5px 0;
}
.task-create-card .field span {
  font-size: 11px;
}
.task-create-card .field input {
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}
.pending-board {
  background: color-mix(in srgb, var(--theme) 12%, rgba(255,255,255,.50));
}
.done-board {
  background: rgba(239, 248, 241, .50);
}
.task-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.task-form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.task-form-actions .primary-btn {
  min-height: 34px;
}
.task-form-hint {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
}
.task-form-actions.two {
  grid-template-columns: 1fr 1fr;
}
.task-scroll {
  max-height: 338px;
  overflow-y: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.task-list .item {
  min-height: 58px;
  background: rgba(255,255,255,.42);
}
.task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.task-title-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  vertical-align: middle;
  flex: 0 0 auto;
  color: inherit;
  font-size: inherit;
  margin-top: 0;
}
.task-icon-btn {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: rgba(47, 143, 115, .10);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}
.task-icon-btn.danger {
  background: rgba(215, 91, 82, .10);
  color: var(--red);
}
.task-check-btn {
  min-height: 30px;
  padding: 0 10px;
  font-weight: 900;
  color: white;
  background: var(--green);
}
.list-actions, .mini-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.mini-actions {
  margin-top: 6px;
}
.child-name-actions {
  min-width: 0;
}
.mini-btn {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.mini-btn.edit {
  background: #edf6f1;
  color: var(--green-dark);
  border: 1px solid rgba(47, 143, 115, .14);
}
.mini-btn.delete {
  background: #fff0ee;
  color: var(--red);
  border: 1px solid rgba(215, 91, 82, .16);
}
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 30px; border-radius: 999px; padding: 0 10px; background: #eef4f0; color: var(--green-dark); font-weight: 850; }
.danger { color: var(--red); }
.gain { color: var(--green-dark); }
.gold { color: #b56b00; }
.logs-panel {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 9px;
}
.compact-log {
  max-height: 142px;
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.log-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 42px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid #edf2ee;
  font-size: 12px;
}
.log-line:last-child { border-bottom: 0; }
.log-reason { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-time { color: var(--muted); font-size: 12px; text-align: right; }
.log-line b { text-align: right; font-size: 14px; }

.view { display: none; }
.view.active { display: block; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(520px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  background: #ffffff;
  box-shadow: 0 -12px 34px rgba(31, 53, 44, .10), inset 0 1px 0 rgba(255,255,255,.58);
  border-top: 1px solid rgba(255,255,255,.94);
}
.bottom-nav.child-bottom-nav {
  grid-template-columns: 58px 58px 58px 58px 1fr 54px;
  column-gap: 6px;
  padding-left: 8px;
  padding-right: 8px;
}
.child-bottom-nav .child-logout-btn {
  grid-column: 6;
  justify-self: end;
  color: var(--red);
  background: rgba(255, 238, 236, .82);
}
.child-bottom-nav .nav-btn:nth-child(1) { grid-column: 1; }
.child-bottom-nav .nav-btn:nth-child(2) { grid-column: 2; }
.child-bottom-nav .nav-btn:nth-child(3) { grid-column: 3; }
.child-bottom-nav .nav-btn:nth-child(4) { grid-column: 4; }
.nav-btn { min-height: 44px; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; gap: 1px; font-size: 10px; font-weight: 750; position: relative; }
.nav-icon-wrap { position: relative; display: inline-grid; place-items: center; }
.nav-btn b { font-size: 18px; line-height: 1; }
.nav-btn.active { color: var(--green-dark); background: linear-gradient(135deg, var(--theme-soft), #ffffff); font-weight: 900; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme) 16%, transparent), 0 8px 18px color-mix(in srgb, var(--theme) 10%, transparent); }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: linear-gradient(135deg, #ff6b79, #e13257);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(225, 50, 87, .28);
  z-index: 2;
}
.mine-card {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.90);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), color-mix(in srgb, var(--theme-soft) 7%, transparent), color-mix(in srgb, var(--theme-warm) 5%, transparent));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.58);
}
.mine-top-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 2;
}
.mine-sub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mine-sub-actions-row {
  flex: 0 0 100%;
  justify-content: flex-end;
  margin-top: 2px;
  padding-left: 78px;
  padding-right: 2px;
}
.mine-sub-actions .cs-chip {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.mine-sub-actions .cs-chip span {
  font-size: 13px;
}
.cs-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(47, 143, 115, .28);
  background: linear-gradient(135deg, #f0f8ff, #d4ecff 45%, #6bb6ff);
  color: #1a4d80;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(58, 130, 214, .16), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
}
.cs-chip span {
  font-size: 15px;
  line-height: 1;
}
.cs-chip:active { transform: scale(.96); }
.tutorial-chip {
  border-color: rgba(126, 87, 194, .28);
  background: linear-gradient(135deg, #f5f0ff, #e0d4ff 45%, #b79ce8);
  color: #4a2d80;
  box-shadow: 0 8px 18px rgba(126, 87, 194, .16), inset 0 1px 0 rgba(255,255,255,.72);
}
.logout-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(215, 91, 82, .30);
  background: linear-gradient(135deg, #fff7f5, #ffd9d4 45%, #f46f63);
  color: #8d231b;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(215, 91, 82, .18), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
}
.logout-chip span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1;
}
.mine-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--green);
  color: white;
  font-size: 25px;
  font-weight: 900;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(47, 143, 115, .20);
}
.mine-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mine-card h3 { margin: 0; font-size: 20px; }
.mine-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.expire-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.renew-inline-btn {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7dc, #f3bd46);
  color: #704707;
  border: 1px solid rgba(196, 122, 24, .20);
  font-size: 12px;
  font-weight: 900;
}
.renew-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7dc, #f3bd46);
  color: #704707;
  border: 1px solid rgba(196, 122, 24, .20);
  font-weight: 900;
  box-shadow: 0 9px 20px rgba(196, 122, 24, .12);
}
.logout-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: #fff0ee;
  color: var(--red);
  border: 1px solid rgba(215, 91, 82, .18);
  font-weight: 900;
}

.growth-thresholds-panel { margin-top: 10px; }
.growth-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.threshold-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.threshold-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.threshold-item span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.threshold-item input {
  width: 100%;
  text-align: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.7);
  font-size: 15px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.threshold-item input::-webkit-outer-spin-button,
.threshold-item input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.threshold-item.locked input {
  background: #f0f0f0;
  color: #aaa;
  border-color: #ddd;
}
.threshold-item.locked em {
  font-size: 10px;
  color: #bbb;
  font-style: normal;
}
.threshold-actions {
  display: flex;
  gap: 8px;
}
.threshold-actions .primary-btn { flex: 1; }
.threshold-actions .ghost-btn { white-space: nowrap; }

@media (max-width: 380px) {
  .threshold-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .threshold-item input { font-size: 13px; min-height: 34px; }
}

/* ===== 宠物状态特效（饥饿/生病） ===== */
.pet-status-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 11px 4px 5px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 10px 22px rgba(35, 31, 24, .14), inset 0 1px 0 rgba(255,255,255,.78);
  animation: statusBadgePulse 2.2s ease-in-out infinite;
}
.pet-status-badge strong {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  color: #fff;
}
.pet-status-badge span {
  font-size: 12px;
  line-height: 1;
}
.pet-status-badge.pet-hungry {
  background: linear-gradient(135deg, #fff9e8, #ffe2ad);
  color: #9c4a00;
  border: 1.5px solid rgba(238, 133, 22, .46);
}
.pet-status-badge.pet-hungry strong { background: linear-gradient(135deg, #ff9f1c, #e65f00); }
.pet-status-badge.pet-sick {
  background: linear-gradient(135deg, #ecfbff, #d8f0ff);
  color: #116074;
  border: 1.5px solid rgba(33, 143, 168, .44);
  border-radius: 8px;
}
.pet-status-badge.pet-sick strong { background: linear-gradient(135deg, #25b8c8, #117a93); }
@keyframes statusBadgePulse {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  50% { opacity: .92; transform: translateX(-50%) translateY(-2px) scale(1.035); }
}

/* 饥饿状态特效 */
.pet-stage.pet-hungry::before,
.pet-stage.pet-sick::before {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 1;
}
.pet-stage.pet-hungry .pet-face,
.pet-stage.pet-sick .pet-face {
  z-index: 2;
}
.pet-stage.pet-hungry .pet-image {
  filter: saturate(.82) brightness(.98) sepia(.08) drop-shadow(0 16px 12px rgba(190, 101, 18, .12));
  animation: hungryDip 2.7s ease-in-out infinite;
}
.pet-stage.pet-hungry .pet-status-overlay {
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: min(76%, 170px);
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(232, 121, 20, .22), rgba(232, 121, 20, 0) 68%);
  animation: hungryShadow 2.7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.pet-stage.pet-hungry::before {
  right: 12%;
  bottom: 17%;
  width: 46px;
  height: 31px;
  border: 3px solid rgba(245, 145, 28, .78);
  border-top-color: transparent;
  border-radius: 0 0 42px 42px;
  box-shadow: inset 0 -9px 0 rgba(255, 190, 73, .34), 0 8px 16px rgba(189, 94, 19, .12);
  animation: hungryBowl 2.7s ease-in-out infinite;
}
.pet-stage.pet-hungry::after {
  content: '...';
  position: absolute;
  right: 14%;
  top: 26%;
  color: #d06b08;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  z-index: 3;
  animation: hungryDots 1.6s ease-in-out infinite;
}
@keyframes hungryDip {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(6px) rotate(-1.2deg) scale(.965); }
  70% { transform: translateY(2px) rotate(1deg) scale(.99); }
}
@keyframes hungryShadow {
  0%, 100% { opacity: .34; transform: translateX(-50%) scaleX(.92); }
  45% { opacity: .72; transform: translateX(-50%) scaleX(1.08); }
}
@keyframes hungryBowl {
  0%, 100% { transform: translateY(0) rotate(-3deg); opacity: .72; }
  50% { transform: translateY(-5px) rotate(4deg); opacity: 1; }
}
@keyframes hungryDots {
  0%, 100% { opacity: .25; transform: translateY(4px); }
  45% { opacity: 1; transform: translateY(-3px); }
}

/* 生病状态特效 */
.pet-stage.pet-sick .pet-image {
  filter: saturate(.62) brightness(.9) hue-rotate(145deg) drop-shadow(0 16px 16px rgba(29, 122, 146, .16));
  animation: sickSway 3.4s ease-in-out infinite;
}
.pet-stage.pet-sick .pet-status-overlay {
  position: absolute;
  inset: 9% 5% 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(52, 192, 205, .18), transparent 19%),
    radial-gradient(circle at 72% 40%, rgba(117, 217, 226, .18), transparent 16%),
    radial-gradient(circle, transparent 47%, rgba(42, 160, 179, .22) 100%);
  animation: sickPulse 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.pet-stage.pet-sick::before {
  left: 15%;
  top: 21%;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    linear-gradient(#fff, #fff) center / 7px 22px no-repeat,
    linear-gradient(#fff, #fff) center / 22px 7px no-repeat,
    linear-gradient(135deg, #2cc5d3, #137c94);
  box-shadow: 0 10px 18px rgba(20, 122, 147, .18);
  animation: medicalFloat 2.6s ease-in-out infinite;
}
.pet-stage.pet-sick::after {
  content: '';
  position: absolute;
  top: 25%;
  right: 14%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(32, 152, 172, .65);
  box-shadow:
    14px 10px 0 rgba(32, 152, 172, .38),
    -9px 19px 0 rgba(32, 152, 172, .28);
  animation: sickBubbles 2.8s ease-in-out infinite;
  z-index: 3;
}
@keyframes sickSway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(2px) rotate(-3deg); }
  50% { transform: translateY(5px) rotate(1deg); }
  75% { transform: translateY(1px) rotate(2.5deg); }
}
@keyframes sickPulse {
  0%, 100% { opacity: .32; transform: scale(.96); }
  50% { opacity: .78; transform: scale(1.04); }
}
@keyframes medicalFloat {
  0%, 100% { opacity: .7; transform: translateY(0) rotate(-7deg); }
  50% { opacity: 1; transform: translateY(-7px) rotate(5deg); }
}
@keyframes sickBubbles {
  0%, 100% { opacity: .24; transform: translateY(8px) scale(.88); }
  45% { opacity: .95; transform: translateY(-7px) scale(1.08); }
}

/* ===== 宠物状态设置面板 ===== */
.pet-status-panel { margin-top: 10px; }
.status-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.status-setting-group {
  border-radius: 12px;
  padding: 12px;
  border: 1.5px solid rgba(255,255,255,.6);
}
.status-setting-group.hungry-group {
  background: linear-gradient(135deg, rgba(255, 243, 224, .6), rgba(255, 224, 178, .4));
}
.status-setting-group.sick-group {
  background: linear-gradient(135deg, rgba(232, 245, 233, .6), rgba(200, 230, 201, .4));
}
.status-setting-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}
.status-setting-row {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}
.status-setting-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.status-setting-row label > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.status-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-input-wrap input {
  flex: 1;
  width: 100%;
  text-align: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.7);
  font-size: 15px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.status-input-wrap input::-webkit-outer-spin-button,
.status-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.status-input-wrap em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.status-setting-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ===== 宠物升级/满级全屏特效 ===== */
.pet-effect-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
  animation: effectFadeIn .3s ease-out;
}
.pet-effect-overlay.fading {
  animation: effectFadeOut .6s ease-in forwards;
}
@keyframes effectFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes effectFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 升级特效 */
.pet-effect-overlay.levelup {
  background: radial-gradient(circle at center, rgba(255, 215, 0, .15) 0%, rgba(255, 215, 0, .05) 40%, transparent 70%);
}
.pet-effect-levelup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.levelup-burst {
  width: 200px;
  height: 200px;
  position: relative;
}
.levelup-burst::before,
.levelup-burst::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, .6) 0%, transparent 60%);
  animation: burstExpand 1.5s ease-out infinite;
}
.levelup-burst::after {
  animation-delay: .5s;
  background: radial-gradient(circle, rgba(255, 193, 7, .4) 0%, transparent 60%);
}
@keyframes burstExpand {
  0% { transform: scale(.3); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}
.levelup-text {
  font-size: 28px;
  font-weight: 900;
  color: #f57f17;
  text-shadow: 0 2px 8px rgba(255, 215, 0, .6), 0 0 20px rgba(255, 215, 0, .4);
  animation: textBounce .6s ease-out;
}
@keyframes textBounce {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* 满级特效 */
.pet-effect-overlay.maxlevel {
  background: radial-gradient(circle at center, rgba(255, 215, 0, .25) 0%, rgba(255, 152, 0, .1) 30%, rgba(0,0,0,.3) 70%);
}
.pet-effect-maxlevel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.maxlevel-burst {
  width: 300px;
  height: 300px;
  position: relative;
}
.maxlevel-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,215,0,.5), rgba(255,152,0,.3), rgba(255,215,0,.5), rgba(255,193,7,.3), rgba(255,215,0,.5));
  animation: maxlevelSpin 3s linear infinite;
  filter: blur(20px);
}
.maxlevel-burst::after {
  content: '👑';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  animation: maxlevelCrown 1s ease-out;
  text-shadow: 0 0 30px rgba(255, 215, 0, .8);
}
@keyframes maxlevelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes maxlevelCrown {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.maxlevel-text {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(255, 215, 0, .8), 0 0 30px rgba(255, 152, 0, .6);
  animation: textBounce .8s ease-out;
}
.maxlevel-subtext {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  animation: textBounce 1s ease-out .2s backwards;
}

/* ===== 忘记密码 ===== */
.forgot-password-link {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--green, #2f8f73);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== 购买兑换码链接 ===== */
.purchase-link-row {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.renew-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-soft, #e5f6ed) 72%, white);
  color: var(--green-dark, #17644f);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.purchase-link-btn {
  background: none;
  border: none;
  color: var(--green, #2f8f73);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 2px;
}
.forgot-password-sheet {
  max-width: 380px;
}
.forgot-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.forgot-username-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(47, 143, 115, .08);
  margin-bottom: 12px;
  font-size: 14px;
}
.forgot-username-box b {
  color: var(--green, #2f8f73);
  font-size: 16px;
}
.customer-service-btn {
  margin-top: 12px;
  width: 100%;
}

/* ===== 客服二维码弹窗 ===== */
.customer-service-sheet {
  max-width: 340px;
  text-align: center;
}
.qr-code-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.qr-code-img {
  max-width: 260px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.qr-code-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 40px 0;
}
.qr-code-tip {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100vw, 520px);
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 20, 15, .80);
  padding: 16px;
}
.modal.active { display: flex; }
.modal.center-modal {
  align-items: center;
}
.sheet {
  width: min(420px, 100%);
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.88)),
    linear-gradient(135deg, color-mix(in srgb, var(--theme-soft) 42%, #fff), #fff);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(9, 24, 18, .22), inset 0 1px 0 rgba(255,255,255,.58);
  animation: popIn .16s ease-out;
}
.sheet h3 { margin: 0 0 10px; color: var(--ink); }
.sheet .field span,
.sheet .form-hint,
.sheet .small,
.sheet p {
  color: #34413b;
}
.sheet input,
.sheet select {
  background: rgba(255,255,255,.94);
  color: var(--ink);
  border-color: rgba(91, 113, 104, .24);
}
.center-modal .sheet {
  width: min(420px, 100%);
  animation: popIn .16s ease-out;
}
.confirm-sheet p {
  margin: 4px 0 16px;
  color: #2f3d37;
  line-height: 1.6;
  font-weight: 650;
}
.delete-password-field {
  margin: -4px 0 14px;
}
.danger-primary {
  background: var(--red);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; }
.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf4ef;
  color: #30443b;
  font-size: 22px;
}
.pet-picker-grid {
  display: grid;
  gap: 12px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-series-group {
  display: grid;
  gap: 8px;
}
.pet-series-group h4 {
  margin: 0;
  color: var(--green-dark);
  font-size: 13px;
}
.pet-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.pet-choice {
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 24px rgba(72, 98, 88, .16), inset 0 1px 0 rgba(255,255,255,.9);
}
.pet-choice:active {
  transform: translateY(1px) scale(.99);
}
.pet-choice span { font-size: 44px; line-height: 1; }
.pet-choice-image {
  width: 78px;
  height: 72px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  margin: 0 auto;
}
.pet-choice-image.emoji {
  font-size: 44px;
}
.pet-choice b {
  max-width: 100%;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.18;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pet-choice {
  position: relative;
}
.pet-choice-adopted {
  border-color: rgba(211, 47, 47, .34);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,246,248,.82));
}
.pet-adopted-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border: 1px solid rgba(211, 47, 47, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #d32f2f;
  font-size: 10px;
  line-height: 1.15;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(211, 47, 47, .12);
  pointer-events: none;
}
.pet-restaurant-sheet {
  max-width: 480px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 239, 183, .92), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(255, 183, 132, .62), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 244, .92), rgba(255, 239, 220, .84));
  border: 1px solid rgba(255, 230, 180, .92);
  box-shadow: 0 24px 52px rgba(130, 80, 34, .22), inset 0 1px 0 rgba(255,255,255,.88);
}
.restaurant-head {
  align-items: flex-start;
}
.restaurant-head h3 {
  color: #6d3b12;
  font-size: 20px;
}
.restaurant-head p {
  margin: 4px 0 0;
  color: #9a6a3d;
  font-size: 12px;
  font-weight: 800;
}
.restaurant-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: #8d5c24;
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 218, 154, .70);
}
.restaurant-balance b {
  color: #c77013;
  font-size: 18px;
}
.shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 10px 2px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #ffe8b8);
  color: #8d5c24;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 100, .6), 0 1px 2px rgba(0,0,0,.04);
  white-space: nowrap;
}
.shop-balance b {
  color: #c77013;
  font-size: 16px;
}
.pet-food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-food-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 24px rgba(143, 86, 33, .14), inset 0 1px 0 rgba(255,255,255,.92);
}
.food-image-wrap {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7dc, #ffe5c6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.70);
}
.food-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.food-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.food-info b {
  color: #5c3515;
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.food-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.food-meta-line span,
.food-meta-line em {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 246, 226, .84);
  color: #9b6b3c;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}
.food-meta-line em {
  background: rgba(255, 233, 247, .86);
  color: #b64f93;
}
.feed-btn {
  min-height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8f6e, #f44f8d);
  color: white;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 9px 18px rgba(218, 80, 91, .22), inset 0 1px 0 rgba(255,255,255,.45);
}
.medal-wall-sheet {
  max-height: 78vh;
  overflow: hidden;
}
.medal-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
  max-height: calc(78vh - 76px);
  overflow-y: auto;
  padding: 8px 4px 14px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* 勋章卡片 */
.medal-card {
  position: relative;
  min-height: 180px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 22px 8px 12px;
  border: none;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,1), transparent 50%),
    linear-gradient(165deg, #f4f9f3 0%, #fffdf5 50%, #fdf3dc 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 8px 20px rgba(40, 80, 50, .07),
    0 2px 6px rgba(180, 130, 10, .06);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.medal-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 14px 28px rgba(40, 80, 50, .1),
    0 4px 10px rgba(180, 130, 10, .08);
}
.medal-card:active { transform: scale(.97); }

/* 缎带 */
.medal-card .medal-ribbon {
  position: absolute;
  top: -4px;
  width: 30px;
  height: 64px;
  clip-path: polygon(50% 0, 100% 12%, 100% 88%, 50% 100%, 0 88%, 0 12%);
  background: linear-gradient(180deg, #3a9d6e, #1c6652);
  filter: drop-shadow(0 4px 6px rgba(20, 60, 40, .15));
  z-index: 0;
}
.medal-card .medal-ribbon-l { left: calc(50% - 36px); transform: rotate(-16deg); }
.medal-card .medal-ribbon-r { right: calc(50% - 36px); transform: rotate(16deg); }

/* 累计数量 */
.medal-card .medal-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  min-width: 32px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #f5c542, #c88a0e);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(200, 138, 14, .3);
}

/* 奖章环 */
.medal-ring {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-top: 8px;
  z-index: 1;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow:
    0 10px 20px rgba(180, 120, 5, .16),
    inset 0 -3px 0 rgba(0,0,0,.06),
    inset 0 2px 0 rgba(255,255,255,.5);
}
.medal-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #1c6652;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.medal-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, #fff8d8 50%, #f5c542 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
}
.medal-core {
  position: relative;
  z-index: 2;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #fffaee 60%, #fff3d0 100%);
  box-shadow: 0 4px 8px rgba(100, 60, 5, .1);
}
.medal-core span {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 38px;
  filter: drop-shadow(0 4px 6px rgba(80, 58, 17, .12));
}
.medal-pet-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.medal-pet-image.emoji { font-size: 34px; }

/* 星星装饰 */
.medal-star {
  position: absolute;
  z-index: 3;
  width: 11px;
  height: 11px;
  background: #fff8d8;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 1px 2px rgba(180,120,5,.3));
}
.medal-star.s1 { top: 0; left: 50%; transform: translateX(-50%) scale(1); }
.medal-star.s2 { top: 22%; right: -4px; transform: scale(.7); opacity: .85; }
.medal-star.s3 { bottom: 14%; right: 2px; transform: scale(.65); opacity: .8; }
.medal-star.s4 { bottom: 14%; left: 2px; transform: scale(.65); opacity: .8; }

/* 名字 + 日期 */
.medal-card b {
  max-width: 100%;
  color: #1c6652;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .5px;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.medal-card em {
  color: #b87b08;
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
}

/* ===== 勋章详情大图 ===== */
.medal-detail-sheet {
  width: min(420px, calc(100vw - 24px));
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.85), transparent 55%),
    linear-gradient(180deg, #f4f9f3, #fffdf5 50%, #fff);
  border-radius: 20px;
  padding: 18px 16px 16px;
}
.medal-detail-stage {
  position: relative;
  padding: 30px 0 20px;
  margin: 6px 0 14px;
  display: grid;
  justify-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, #fff, transparent 55%),
    linear-gradient(165deg, #f4f9f3 0%, #fffdf5 55%, #fdf3dc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}

/* 详情缎带 */
.medal-detail-ribbon {
  position: absolute;
  top: 0;
  width: 46px;
  height: 150px;
  clip-path: polygon(50% 0, 100% 10%, 100% 94%, 50% 100%, 0 94%, 0 10%);
  background: linear-gradient(180deg, #3a9d6e, #1c6652);
  filter: drop-shadow(0 6px 10px rgba(20, 60, 40, .12));
  z-index: 0;
}
.medal-detail-ribbon.medal-ribbon-l { left: calc(50% - 100px); transform: rotate(-14deg); }
.medal-detail-ribbon.medal-ribbon-r { right: calc(50% - 100px); transform: rotate(14deg); }

/* 详情大奖章环 */
.medal-detail-ring {
  position: relative;
  width: 230px;
  height: 230px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  z-index: 1;
  margin-top: 14px;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow:
    0 18px 36px rgba(180, 120, 5, .2),
    inset 0 -4px 0 rgba(0,0,0,.06),
    inset 0 3px 0 rgba(255,255,255,.45);
}
.medal-detail-ring::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #1c6652;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}
.medal-detail-ring::after {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, #fff8d8 45%, #f5c542 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.92);
}
.medal-detail-core {
  position: relative;
  z-index: 2;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #fffaee 55%, #fff3d0 100%);
  box-shadow: 0 8px 16px rgba(100, 60, 5, .12);
}
.medal-detail-image {
  width: 142px;
  height: 142px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 8px 12px rgba(80, 58, 17, .15));
}
.medal-detail-image.emoji { font-size: 88px; }

/* 详情星星 */
.medal-detail-ring .medal-star {
  width: 20px;
  height: 20px;
  background: #fff8d8;
  filter: drop-shadow(0 1px 2px rgba(180,120,5,.3));
}
.medal-detail-ring .medal-star.s1 { top: -6px; left: 50%; transform: translateX(-50%) scale(1.1); }
.medal-detail-ring .medal-star.s2 { top: 20%; right: -10px; transform: scale(.95); opacity: .9; }
.medal-detail-ring .medal-star.s3 { bottom: 16%; right: 4px; transform: scale(.8); opacity: .85; }
.medal-detail-ring .medal-star.s4 { bottom: 16%; left: 4px; transform: scale(.8); opacity: .85; }
.medal-detail-ring .medal-star.s5 { top: 36%; left: -10px; transform: scale(.85); opacity: .8; }
.medal-detail-ring .medal-star.s6 { top: 36%; right: -10px; transform: scale(.85); opacity: .8; }

.medal-detail-label {
  margin-top: 14px;
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: rgba(28, 102, 82, .08);
  color: #1c6652;
  border: 1px solid rgba(28, 102, 82, .2);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.medal-detail-info {
  padding: 4px 10px 12px;
  text-align: center;
}
.medal-detail-info h4 {
  margin: 6px 0 8px;
  font-size: 24px;
  font-weight: 950;
  color: #1c6652;
  letter-spacing: 1px;
}
.medal-detail-info p {
  margin: 4px 0;
  font-size: 13px;
  color: #b87b08;
}
.medal-detail-info b { color: #1c6652; }

/* ===== 勋章预览舞台：透明背景（让勋章本体直接呈现，便于裁剪成实体） ===== */
.medal-detail-stage {
  position: relative;
  padding: 30px 0 20px;
  margin: 6px 0 14px;
  display: grid;
  justify-items: center;
  border-radius: 16px;
  /* 棋盘格透明效果：方便用户预览透明区域效果 */
  background-image:
    linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.04) 75%),
    linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.04) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

/* ===== 蔷薇女孩风格（与金翠同构：圆形+缎带，配色改为玫瑰金+薰衣草紫） ===== */
.rose-stage .medal-detail-ribbon.rose-ribbon {
  background: linear-gradient(180deg, #b9a9d8 0%, #7b69ad 100%);
}
.rose-stage .medal-detail-ribbon.rose-ribbon::after {
  background: linear-gradient(180deg, rgba(123,105,173,.85), rgba(123,105,173,.4));
}
/* 外圈：玫瑰金渐变 */
.rose-stage .medal-detail-ring.rose-ring {
  background: conic-gradient(from 35deg, #fff3f0, #eeb7b0, #8e4b52, #fff3f0, #eeb7b0, #8e4b52, #fff3f0);
  box-shadow:
    0 18px 36px rgba(142, 75, 82, .18),
    inset 0 -4px 0 rgba(0,0,0,.05),
    inset 0 3px 0 rgba(255,255,255,.45);
}
/* 中层圈：薰衣草紫 */
.rose-stage .medal-detail-ring.rose-ring::before {
  background: #7b69ad;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.22);
}
/* 核心：樱花粉渐变 */
.rose-stage .medal-detail-ring.rose-ring::after {
  background: radial-gradient(circle at 30% 25%, #fff, #fff3f0 45%, #f8cfd3 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.92);
}
.rose-stage .medal-detail-core.rose-core {
  background: radial-gradient(circle at 35% 28%, #fff, #fff5f2 55%, #fce3e6 100%);
  box-shadow: 0 8px 16px rgba(142, 75, 82, .10);
}

/* 蔷薇版小花装饰（替换金翠版的五角星） */
.rose-stage .medal-detail-ring .medal-flower {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 3;
  /* 5瓣花：用径向渐变+多层伪元素模拟 */
}
.rose-stage .medal-detail-ring .medal-flower::before,
.rose-stage .medal-detail-ring .medal-flower::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 85% 38%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 72% 85%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 28% 85%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 15% 38%, #c9757a 0 28%, transparent 30%);
}
.rose-stage .medal-detail-ring .medal-flower::after {
  inset: 5px;
  background: #fff3f0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #c9757a;
}
.rose-stage .medal-detail-ring .medal-flower.mf1 { top: -8px; left: 50%; transform: translateX(-50%) scale(1.1); }
.rose-stage .medal-detail-ring .medal-flower.mf2 { top: 18%; right: -12px; }
.rose-stage .medal-detail-ring .medal-flower.mf3 { bottom: 18%; right: -6px; transform: scale(.85); }
.rose-stage .medal-detail-ring .medal-flower.mf4 { bottom: 18%; left: -6px; transform: scale(.85); }
.rose-stage .medal-detail-ring .medal-flower.mf5 { top: 32%; left: -14px; transform: scale(.9); }

/* 蔷薇版标签 */
.rose-stage .rose-label {
  background: rgba(217, 142, 160, .10);
  color: #c9757a;
  border: 1px solid rgba(201, 117, 122, .3);
}

/* ===== 底部预览图切换 ===== */
.medal-design-previews {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 10px 0 6px;
}
.medal-preview-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 2px solid rgba(0,0,0,.06);
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.medal-preview-thumb:hover { transform: translateY(-2px); border-color: rgba(0,0,0,.12); }
.medal-preview-thumb.active {
  border-color: var(--green-dark, #1c6652);
  background: rgba(28, 102, 82, .06);
  box-shadow: 0 4px 12px rgba(28, 102, 82, .1);
}
.medal-preview-thumb em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}
.medal-preview-thumb.active em { color: #1c6652; }

/* 迷你预览图 */
.thumb-mini {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: relative;
}
.thumb-classic .thumb-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow: 0 2px 6px rgba(180, 120, 5, .2), inset 0 0 0 3px #1c6652, inset 0 0 0 5px #fff8d8;
}
/* 蔷薇版迷你预览：同款圆环造型+玫瑰金+薰衣草紫 */
.thumb-rose .thumb-ring-rose {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #fff3f0, #eeb7b0, #8e4b52, #fff3f0, #eeb7b0, #8e4b52, #fff3f0);
  box-shadow: 0 2px 6px rgba(142, 75, 82, .2), inset 0 0 0 3px #7b69ad, inset 0 0 0 5px #fff3f0;
}

.medal-detail-actions { margin-top: 8px; gap: 10px !important; justify-content: center; }
.medal-detail-actions .primary-btn {
  background: linear-gradient(135deg, #1c6652, #2f8f73);
  color: white;
  box-shadow: 0 10px 20px rgba(28, 102, 82, .22);
}
.image-preview-sheet {
  width: min(360px, calc(100vw - 28px));
}
.image-preview-body {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.22);
}
.preview-large-image {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 18px 18px rgba(44, 54, 48, .16));
}
.preview-large-image.emoji { font-size: 150px; }
/* ===== 公告滚动条 ===== */
.announcement-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff7e6, #fffbea);
  border: 1px solid #ffe3a3;
  box-shadow: 0 2px 6px rgba(232, 175, 53, .12);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  transition: max-height .3s ease, opacity .3s ease, padding .3s ease, margin .3s ease, border-width .3s ease;
}
.announcement-bar.show {
  max-height: 36px;
  opacity: 1;
  padding-top: 4px;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-width: 1px;
}
.announce-icon { flex: 0 0 auto; font-size: 13px; line-height: 1; }
.announce-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  white-space: nowrap;
}
.announce-text {
  display: inline-block;
  padding-right: 40px;
  font-size: 11.5px;
  font-weight: 600;
  color: #8a5a00;
  line-height: 1.4;
  animation: announce-scroll 18s linear infinite;
  flex-shrink: 0;
}
@keyframes announce-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.announce-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(138, 90, 0, .12);
  color: #8a5a00;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.announce-close:active { background: rgba(138, 90, 0, .25); }
@media (prefers-reduced-motion: reduce) {
  .announce-text { animation: none; padding-right: 12px; }
  .announce-track { overflow-x: auto; }
}
.kid-strip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 0 2px 4px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.kid-pill {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 0;
  width: 46px;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  scroll-snap-align: start;
  box-shadow: none;
}
.kid-pill.active {
  color: var(--green-dark);
  background: transparent;
  box-shadow: none;
}
.kid-pill.active::after {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 3px 8px rgba(47, 143, 115, .25);
}
.kid-name { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.05; text-align: center; }
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  align-items: center;
  justify-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.86);
  background: linear-gradient(135deg, #ffffff, #e8f6ed);
  overflow: hidden;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  flex: 0 0 36px;
  box-shadow: 0 7px 16px rgba(31, 53, 44, .10);
}
.kid-pill.active .avatar {
  border-color: color-mix(in srgb, var(--theme) 62%, white);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--theme) 26%, transparent), inset 0 0 0 2px rgba(255,255,255,.85);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}
.kid-audit-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.96);
  background: linear-gradient(135deg, #ff6b79, #e13257);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(225, 50, 87, .28);
}
.pet-list-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
}
.pet-list-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-list-image.emoji { font-size: 24px; }
.pet-list-levels {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}
.pet-mini-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-mini-image.emoji { font-size: 20px; }
.pet-book {
  display: grid;
  gap: 12px;
  max-height: 792px;
  overflow-y: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-book-series {
  display: grid;
  gap: 8px;
}
.pet-book-series h4 {
  margin: 0;
  color: var(--green-dark);
  font-size: 14px;
}
.pet-book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pet-book-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  box-shadow: 0 8px 18px rgba(39, 47, 61, .06);
}
.pet-book-card > b {
  display: block;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 14px;
  text-align: center;
}
.pet-level-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.pet-level-view {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 8px;
  background: rgba(255,255,255,.26);
}
.pet-book-image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.pet-book-image.emoji { font-size: 32px; }
.pet-level-view em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

/* ===== 宠物图鉴解锁/锁定状态 ===== */
.pet-book-card {
  position: relative;
}
.pet-book-card.pet-book-locked {
  opacity: 0.9;
}
.pet-book-image-locked {
  filter: grayscale(100%) brightness(0.75) contrast(0.9);
  -webkit-filter: grayscale(100%) brightness(0.75) contrast(0.9);
  opacity: 0.82;
}
.pet-level-view-locked {
  cursor: pointer;
}

/* 已召唤神兽印章（缩小版） */
.pet-book-stamp {
  position: absolute;
  top: 30px;
  right: -10px;
  transform: rotate(12deg);
  padding: 2px 14px;
  font-size: 10px;
  font-weight: 800;
  color: #d32f2f;
  border: 1.5px solid #d32f2f;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.5px;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(211, 47, 47, 0.15);
  opacity: 0.88;
  user-select: none;
}
.pet-book-unlocked {
  border-color: rgba(211, 47, 47, 0.28);
  background: rgba(255, 245, 245, 0.32);
}
.add-kid-pill {
  width: 46px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
}
.add-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(47, 143, 115, .42);
  background: rgba(255,255,255,.74);
  color: var(--green);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 7px 16px rgba(31, 53, 44, .07);
}

.hero-card {
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.10) 0%, color-mix(in srgb, var(--theme-soft) 8%, transparent) 58%, rgba(255,255,255,.04) 100%);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--theme) 9%, transparent), inset 0 1px 0 rgba(255,255,255,.60);
}
.growth-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(172px, 56%) minmax(104px, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 236px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.10) 0%, color-mix(in srgb, var(--theme-soft) 8%, transparent) 56%, rgba(255,255,255,.04) 100%);
  border-top: 1px solid rgba(255,255,255,.96);
}
.growth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,.52), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 1px, transparent 1px 12px);
  opacity: .55;
}
.growth-card > * { position: relative; z-index: 1; }
.pet-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(142px, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
}
.pet-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  min-width: 50px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 241, 190, .95);
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff 0%, color-mix(in srgb, var(--theme-soft) 45%, #fff4c9) 42%, color-mix(in srgb, var(--theme) 42%, #f6c84d) 100%);
  color: color-mix(in srgb, var(--theme) 54%, #4a2d05);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(127, 82, 14, .22), inset 0 1px 0 rgba(255,255,255,.62);
}
.change-pet-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(47, 143, 115, .22);
  background: rgba(255,255,255,.82);
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(31, 53, 44, .12);
}
.pet-restaurant-btn {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 2;
  width: 72px;
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #743d0f;
  font-size: 12px;
  font-weight: 950;
  box-shadow: none;
}
.pet-restaurant-btn img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 7px 10px rgba(118, 62, 19, .20));
}
.pet-restaurant-btn b {
  white-space: nowrap;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 5px 12px rgba(118, 62, 19, .10);
}
.pet-restaurant-compact {
  width: 58px;
  min-height: 64px;
  font-size: 10px;
}
.pet-restaurant-compact img {
  width: 44px;
  height: 44px;
}
.growth-info {
  display: grid;
  align-content: center;
  min-width: 0;
}
.eyebrow { display: inline-flex; margin-bottom: 8px; color: var(--green-dark); font-weight: 850; font-size: 12px; }
.child-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.growth-info h2 { margin: 0; font-size: 22px; line-height: 1.14; overflow-wrap: anywhere; }
.child-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
}
.growth-info p { margin: 6px 0 10px; color: var(--muted); line-height: 1.35; font-size: 12px; overflow-wrap: anywhere; }
.profile-avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid rgba(47, 143, 115, .18);
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 20px rgba(31, 53, 44, .10);
}
.profile-avatar .avatar {
  width: 59px;
  height: 59px;
  font-size: 25px;
  background: #edf8f1;
}
.readonly-avatar {
  pointer-events: none;
}
.child-home-card .mini-actions,
.child-home-card [data-edit-child],
.child-home-card [data-delete-child] {
  display: none;
}
.pet-stage { position: relative; display: grid; place-items: center; min-height: 142px; align-self: stretch; }
.egg-stage {
  isolation: isolate;
}
.egg-stage::before {
  content: none;
}
.egg-stage::after {
  content: none;
}
.egg-stage .pet-face {
  position: relative;
  transform-origin: center bottom;
  background: transparent;
  filter: drop-shadow(0 22px 18px rgba(72, 96, 86, .18));
  animation: eggFloat 2.8s ease-in-out infinite;
}
.egg-stage .pet-face::before,
.egg-stage .pet-face::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 198, 83, .9);
  box-shadow:
    30px -16px 0 rgba(47, 143, 115, .48),
    -26px 16px 0 rgba(244, 188, 66, .48),
    38px 20px 0 rgba(255, 255, 255, .82);
  animation: sparkleDrift 2.8s ease-in-out infinite;
}
.egg-stage .pet-face::before {
  top: 18%;
  left: 2%;
}
.egg-stage .pet-face::after {
  right: 4%;
  bottom: 30%;
  animation-delay: .9s;
}
@keyframes hatchGlow {
  0%, 100% { transform: scale(.94); opacity: .72; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes eggFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg) scale(1); }
  45% { transform: translateY(-7px) rotate(1.5deg) scale(1.035); }
  70% { transform: translateY(-3px) rotate(-.6deg) scale(1.012); }
}
@keyframes sparkleDrift {
  0%, 100% { opacity: .45; transform: translateY(0) scale(.86); }
  50% { opacity: 1; transform: translateY(-8px) scale(1.08); }
}
.pet-face {
  position: relative;
  width: 100%;
  min-width: 118px;
  max-width: 208px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: transparent;
  font-size: clamp(104px, 35vw, 158px);
  box-shadow: none;
  animation: petBreath 2.6s ease-in-out infinite;
  /* 给图片底部留出空间，避免 122% 放大的图片溢出盖住下方名称 */
  padding-bottom: 11%;
  padding-top: 11%;
}
.pet-image {
  width: 122%;
  height: 122%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.pet-image.emoji {
  display: grid;
  place-items: center;
  font-size: inherit;
  line-height: 1;
}
.egg-stage .pet-image {
  width: 104%;
  height: 104%;
}
.pet-caption {
  min-height: 20px;
  margin-top: 10px;
  text-align: center;
  color: #244d42;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes petBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.045); }
}
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }
.growth-card .metrics { grid-template-columns: 1fr; margin-top: 0; gap: 9px; }
.metric { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.90); border-radius: 8px; padding: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,.66), 0 8px 18px rgba(31,53,44,.05); }
.growth-card .metric {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}
.metric b { display: block; font-size: 22px; margin-bottom: 3px; }
.metric span { color: var(--muted); font-size: 12px; }
.growth-card .metric b { margin: 0; font-size: 21px; order: 2; }
.growth-card .metric span { order: 1; font-weight: 750; }
.metric.score b { color: var(--green-dark); }
.metric.coin b { color: #ad6906; }
.metric.growth b { color: var(--blue); }
.medal-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--theme) 12%, rgba(196, 122, 24, .18));
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), color-mix(in srgb, var(--theme-warm) 6%, transparent));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  text-align: left;
}
.medal-title { color: color-mix(in srgb, var(--theme) 46%, #7c5210); font-size: 12px; font-weight: 900; text-align: center; }
.medal-icons { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.medal-mark {
  position: relative;
  min-width: 21px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-style: normal;
  filter: drop-shadow(0 5px 7px rgba(74, 52, 13, .16));
}
.medal-mark::before {
  content: "";
  position: absolute;
  top: 0;
  width: 21px;
  height: 23px;
  border-radius: 7px 7px 10px 10px;
  clip-path: polygon(50% 0, 92% 13%, 92% 58%, 50% 100%, 8% 58%, 8% 13%);
  border: 1px solid rgba(255,255,255,.70);
  background: var(--medal-fill);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.72),
    inset 0 -5px 8px rgba(49, 31, 6, .16);
  z-index: 1;
}
.medal-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.95) 0 18%, transparent 19%),
    var(--core-fill);
  z-index: 2;
  box-shadow: inset 0 -2px 3px rgba(50, 28, 5, .18);
}
.medal-mark {
  --medal-fill: linear-gradient(135deg, #f8fbff, #bcc7d2 48%, #7f8b96);
  --core-fill: linear-gradient(135deg, #ffffff, #9faeba);
}
.medal-mark span { display: none; }
.medal-level-1 { --medal-fill: linear-gradient(135deg, #ffffff 0%, #cfd8df 44%, #7c8994 100%); --core-fill: linear-gradient(135deg, #f9fcff, #a7b5c0); }
.medal-level-2 { --medal-fill: linear-gradient(135deg, #fff7ce 0%, #e5aa28 48%, #9e6209 100%); --core-fill: linear-gradient(135deg, #fff8c8, #d58c13); }
.medal-level-3 { --medal-fill: linear-gradient(135deg, #fff1cf 0%, #b87df0 42%, #5930a7 72%, #d79d2a 100%); --core-fill: linear-gradient(135deg, #fff0c2, #7b48d6); }
.medal-empty { --medal-fill: linear-gradient(135deg, #f3f5f3, #d7dfda); --core-fill: linear-gradient(135deg, #ffffff, #c0cac4); opacity: .72; }
.no-medal {
  color: #9aa39d;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}
.progress { margin-top: 14px; display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.growth-card .progress { margin-top: 0; }
.pet-progress {
  padding: 0 2px;
}
.bar {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), color-mix(in srgb, var(--theme-soft) 72%, #e2ece6));
  border: 1px solid rgba(47, 143, 115, .14);
  box-shadow: inset 0 2px 5px rgba(34, 70, 55, .08);
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--theme) 0%, var(--theme-2) 58%, #f4bc42 100%);
  border-radius: inherit;
  transition: width .3s ease;
}
.bar b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: #18362d;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.pet-action {
  width: 100%;
  min-height: 36px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  color: white;
  box-shadow: 0 9px 20px rgba(31, 53, 44, .12);
}
.pet-action.adopt {
  background: linear-gradient(135deg, var(--theme), var(--theme-2));
}
.pet-action.summon {
  background: linear-gradient(135deg, #5f3fb8, #df9b35);
}
.pet-action.readonly-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--theme) 72%, white), color-mix(in srgb, var(--theme-2) 70%, white));
}
.child-restaurant-section {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 232, 168, .42), transparent 34%),
    rgba(255,255,255,.16);
  box-shadow: 0 12px 28px rgba(31, 53, 44, .10), inset 0 1px 0 rgba(255,255,255,.52);
}
.child-food-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 334px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.child-food-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.74);
  background: rgba(255,255,255,.58);
  box-shadow: 0 8px 18px rgba(143, 86, 33, .10), inset 0 1px 0 rgba(255,255,255,.78);
}
.child-food-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 11px;
  background: #fff3d8;
}
.child-food-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.child-food-card b {
  color: #5c3515;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.child-food-meta {
  display: grid;
  gap: 3px;
}
.child-food-meta span,
.child-food-meta em {
  min-height: 17px;
  display: grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(255, 246, 226, .84);
  color: #8d5c24;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}
.child-food-meta em {
  background: rgba(255, 233, 247, .86);
  color: #b64f93;
}
.child-feed-btn {
  min-height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8f6e, #f44f8d);
  color: white;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 7px 14px rgba(218, 80, 91, .18);
}
.pet-file-card {
  display: block;
  padding: 18px;
  min-height: 340px;
}
.pet-panel-large {
  position: relative;
  min-height: 300px;
  grid-template-rows: minmax(230px, 1fr) auto;
}
.pet-panel-large .pet-stage {
  min-height: 230px;
  padding-top: 32px;
}
.pet-panel-large .pet-face {
  max-width: 292px;
  font-size: clamp(150px, 48vw, 236px);
}
.pet-panel-large .pet-caption {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  min-height: 24px;
  padding: 3px 16px;
  font-size: 16px;
  color: #244d42;
  background: rgba(255, 255, 255, .88);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(31, 53, 44, .10);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
  text-align: center;
}

.section { margin-top: 9px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.section-title h3 { margin: 0; font-size: 16px; }
.section-title .shop-balance { margin-left: 8px; }
.review-alert-btn {
  position: relative;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--theme);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(31, 53, 44, .10);
}
.review-alert-btn.has-review {
  background: linear-gradient(135deg, #ff7f7a, #f0a431);
  color: white;
}
.review-alert-btn b {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #d75b52;
  font-size: 11px;
}
.task-review-sheet { max-height: 76vh; }
.task-review-list { max-height: 56vh; overflow-y: auto; }
.rules-header {
  display: grid;
  grid-template-columns: 82px 1fr 82px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rules-header h3 {
  margin: 0;
  text-align: center;
  font-size: 18px;
}
.back-home-btn {
  min-height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #e3f4ea);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(47, 143, 115, .18);
  box-shadow: 0 6px 14px rgba(31, 53, 44, .08);
}
.small { color: var(--muted); font-size: 13px; }
.rules-panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05)),
    linear-gradient(135deg, color-mix(in srgb, var(--theme-soft) 6%, transparent), transparent);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 12px 10px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.58);
}
.rule-scroll {
  display: grid;
  gap: 10px;
}
.rule-group + .rule-group { padding-top: 10px; border-top: 1px dashed var(--line); }
.group-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.group-title b { font-size: 15px; }
.group-title span { color: var(--muted); font-size: 12px; }
.rule-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 5);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 2px 7px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.rule-btn {
  min-height: 68px;
  border-radius: 8px;
  display: grid;
  grid-template-rows: 20px 1fr 16px;
  place-items: center;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.92);
  color: var(--ink);
  text-align: center;
  padding: 6px 4px 5px;
  min-width: 0;
  scroll-snap-align: start;
  box-shadow:
    0 7px 16px rgba(31, 53, 44, .09),
    inset 0 1px 0 rgba(255,255,255,.68);
  transition: transform .16s ease, box-shadow .16s ease;
}
.rule-btn:active {
  transform: translateY(1px) scale(.98);
  box-shadow: 0 4px 10px rgba(31, 53, 44, .08), inset 0 1px 0 rgba(255,255,255,.86);
}
.rule-btn strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(45, 54, 49, .10));
}
.rule-btn span {
  width: 100%;
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.08;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rule-btn em {
  min-width: 30px;
  min-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-style: normal;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}
.rule-btn.plus {
  border-color: rgba(180, 223, 204, .72);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(244,255,249,.06));
}
.rule-btn.minus {
  border-color: rgba(240, 196, 191, .76);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,243,241,.07));
}
.theme-boy .rule-btn.plus { border-color: rgba(183, 221, 255, .82); background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(241,249,255,.07)); }
.theme-girl .rule-btn.plus { border-color: rgba(245, 191, 217, .82); background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,245,251,.07)); }
.rule-btn.plus em { color: var(--green-dark); }
.rule-btn.minus em { color: var(--red); }
.empty-text { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.list { display: grid; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.90);
  border-radius: 8px;
  padding: 9px;
}
.item-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-main > div { min-width: 0; }
.item-main b { display: block; overflow-wrap: anywhere; }
.item-main span:not(.avatar):not(.task-inline-actions) { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.shop-section {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(31, 53, 44, .08), inset 0 1px 0 rgba(255,255,255,.58);
}
.compact-title-btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.shop-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 486px;
  overflow-y: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.gift-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 7px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.56), rgba(255,255,255,.36)),
    color-mix(in srgb, var(--theme-soft) 16%, transparent);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow:
    0 9px 20px rgba(31, 53, 44, .10),
    inset 0 1px 0 rgba(255,255,255,.76);
}
.gift-image-box {
  width: 100%;
  aspect-ratio: 8 / 5;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  line-height: 0;
  background: rgba(255,255,255,.54);
  border: 1px solid rgba(220, 229, 224, .82);
  box-shadow: inset 0 1px 8px rgba(31, 53, 44, .05);
}
.gift-image-box.readonly {
  cursor: default;
}
.gift-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gift-placeholder {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 24px;
  background: rgba(255,255,255,.72);
}
.gift-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
}
.gift-name-row b {
  min-width: 0;
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gift-edit-chip {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 72%, #f36aa6));
  box-shadow: 0 6px 12px color-mix(in srgb, var(--theme) 20%, transparent);
}
.gift-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  min-height: 20px;
}
.gift-meta span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.gift-meta strong {
  color: var(--theme);
  font-size: 12px;
  line-height: 1;
}
.gift-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gift-actions button {
  min-height: 27px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: 0 7px 14px rgba(31, 53, 44, .10);
}
.gift-actions button:disabled {
  cursor: not-allowed;
  background: linear-gradient(135deg, #c7cfca, #aeb7b2);
  color: rgba(255,255,255,.82);
  box-shadow: none;
  opacity: .82;
}
.gift-exchange {
  background: linear-gradient(135deg, var(--theme), color-mix(in srgb, var(--theme) 62%, #ff7ab8));
}
.gift-delete {
  background: linear-gradient(135deg, #ff7a7a, #f35f65);
}
.gift-edit-sheet .form-hint {
  margin: 0 0 10px;
}
.gift-form-image-box {
  width: 100%;
  aspect-ratio: 8 / 5;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
  border: 1px dashed color-mix(in srgb, var(--theme) 42%, rgba(255,255,255,.8));
  background: rgba(255,255,255,.36);
  margin-bottom: 10px;
}
.gift-form-image-box .gift-image {
  position: absolute;
  inset: 0;
}
.gift-form-image-box em {
  position: absolute;
  right: 8px;
  bottom: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
  color: var(--theme);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(31, 53, 44, .08);
}
.gift-image-action-sheet .row {
  margin-top: 10px;
}
.gift-action-preview {
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.86);
}
.gift-action-preview .gift-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.exchange-item {
  align-items: center;
}
.exchange-section {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(31, 53, 44, .07), inset 0 1px 0 rgba(255,255,255,.52);
}
.exchange-list {
  max-height: 296px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.exchange-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.exchange-actions .mini-btn {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}
.task-mode-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 6px;
  margin-right: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--theme) 14%, rgba(255,255,255,.72));
  color: var(--theme);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}
.task-blocked-btn {
  color: var(--muted);
  background: rgba(230, 235, 232, .82);
  border-color: rgba(205, 215, 210, .86);
}

.task-info {
  min-width: 0;
}
.task-stage-progress {
  width: min(220px, 100%);
  margin-top: 7px;
  display: grid;
  gap: 5px;
}
.task-stage-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  line-height: 1.2;
}
.task-stage-progress-top strong {
  color: var(--green-dark);
  font-weight: 900;
}
.task-stage-progress-top em {
  flex: 0 0 auto;
  color: rgba(73, 96, 84, .72);
  font-style: normal;
  font-weight: 800;
}
.task-stage-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 143, 115, .14);
}
.task-stage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ab7, #39b98f);
}
.task-done {
  opacity: .82;
}
.task-done .avatar {
  background: linear-gradient(135deg, #eaf8ee, #d9f0e4);
  color: var(--green);
}
.task-create-card,
.task-board {
  padding: 10px;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 8px;
  background: rgba(255,255,255,.50);
  box-shadow: 0 8px 18px rgba(31, 53, 44, .07), inset 0 1px 0 rgba(255,255,255,.55);
}
.task-create-card {
  padding: 10px;
}
.task-create-card .section-title {
  margin-bottom: 3px;
}
.task-create-btn {
  width: 100%;
  min-height: 38px;
  font-size: 14px;
  font-weight: 850;
}
.task-create-card .field {
  gap: 3px;
  margin: 5px 0;
}
.task-create-card .field span {
  font-size: 11px;
}
.task-create-card .field input {
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}
.pending-board {
  background: color-mix(in srgb, var(--theme) 12%, rgba(255,255,255,.50));
}
.done-board {
  background: rgba(239, 248, 241, .50);
}
.task-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.task-form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.task-form-actions .primary-btn {
  min-height: 34px;
}
.task-form-hint {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
}
.task-form-actions.two {
  grid-template-columns: 1fr 1fr;
}
.task-scroll {
  max-height: 338px;
  overflow-y: auto;
  padding-right: 3px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.task-list .item {
  min-height: 58px;
  background: rgba(255,255,255,.42);
}
.task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}
.task-title-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  vertical-align: middle;
  flex: 0 0 auto;
  color: inherit;
  font-size: inherit;
  margin-top: 0;
}
.task-icon-btn {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: rgba(47, 143, 115, .10);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}
.task-icon-btn.danger {
  background: rgba(215, 91, 82, .10);
  color: var(--red);
}
.task-check-btn {
  min-height: 30px;
  padding: 0 10px;
  font-weight: 900;
  color: white;
  background: var(--green);
}
.list-actions, .mini-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.mini-actions {
  margin-top: 6px;
}
.child-name-actions {
  min-width: 0;
}
.mini-btn {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.mini-btn.edit {
  background: #edf6f1;
  color: var(--green-dark);
  border: 1px solid rgba(47, 143, 115, .14);
}
.mini-btn.delete {
  background: #fff0ee;
  color: var(--red);
  border: 1px solid rgba(215, 91, 82, .16);
}
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 30px; border-radius: 999px; padding: 0 10px; background: #eef4f0; color: var(--green-dark); font-weight: 850; }
.danger { color: var(--red); }
.gain { color: var(--green-dark); }
.gold { color: #b56b00; }
.logs-panel {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 9px;
}
.compact-log {
  max-height: 142px;
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.log-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(86px, auto) auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid #edf2ee;
  font-size: 12px;
}
.log-line:last-child { border-bottom: 0; }
.log-reason { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-time { color: var(--muted); font-size: 12px; text-align: right; }
.log-delta { text-align: right; font-size: 12px; font-weight: 750; white-space: nowrap; }
.log-revoke-btn {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(218, 80, 91, .35);
  border-radius: 999px;
  background: rgba(255, 240, 238, .8);
  color: var(--red);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.log-revoke-btn:active { background: rgba(218, 80, 91, .18); }
.log-revoke-placeholder { display: inline-block; }
.log-revoked { opacity: .55; }
.log-revoked .log-reason { text-decoration: line-through; }
.log-is-revoke { opacity: .8; }
.log-is-revoke .log-reason { font-style: italic; }
.log-revoked-tag {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(218, 80, 91, .15);
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  text-decoration: none;
}
@media (max-width: 360px) {
  .log-line { grid-template-columns: minmax(0, 1fr) 60px auto; gap: 6px; }
  .log-line .log-time { display: none; }
}

.view { display: none; }
.view.active { display: block; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(520px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  background: #ffffff;
  box-shadow: 0 -12px 34px rgba(31, 53, 44, .10), inset 0 1px 0 rgba(255,255,255,.58);
  border-top: 1px solid rgba(255,255,255,.94);
}
.bottom-nav.child-bottom-nav {
  grid-template-columns: 58px 58px 58px 58px 1fr 54px;
  column-gap: 6px;
  padding-left: 8px;
  padding-right: 8px;
}
.child-bottom-nav .child-logout-btn {
  grid-column: 6;
  justify-self: end;
  color: var(--red);
  background: rgba(255, 238, 236, .82);
}
.child-bottom-nav .nav-btn:nth-child(1) { grid-column: 1; }
.child-bottom-nav .nav-btn:nth-child(2) { grid-column: 2; }
.child-bottom-nav .nav-btn:nth-child(3) { grid-column: 3; }
.child-bottom-nav .nav-btn:nth-child(4) { grid-column: 4; }
.nav-btn { min-height: 44px; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; gap: 1px; font-size: 10px; font-weight: 750; position: relative; }
.nav-icon-wrap { position: relative; display: inline-grid; place-items: center; }
.nav-btn b { font-size: 18px; line-height: 1; }
.nav-btn.active { color: var(--green-dark); background: linear-gradient(135deg, var(--theme-soft), #ffffff); font-weight: 900; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--theme) 16%, transparent), 0 8px 18px color-mix(in srgb, var(--theme) 10%, transparent); }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: linear-gradient(135deg, #ff6b79, #e13257);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(225, 50, 87, .28);
  z-index: 2;
}
.mine-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.90);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.10), color-mix(in srgb, var(--theme-soft) 7%, transparent), color-mix(in srgb, var(--theme-warm) 5%, transparent));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.58);
}
.mine-top-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 2;
}
.mine-info {
  flex: 1;
  min-width: 0;
}
.mine-id-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 13px;
  color: #888;
}
.mine-id-line .copy-id-btn {
  border: 1px solid #d0d0d0;
  background: #f5f5f5;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  line-height: 1.5;
}
.mine-id-line .copy-id-btn:active {
  background: #e8e8e8;
}
.mine-sub-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.mine-sub-actions .cs-chip {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.mine-sub-actions .cs-chip span {
  font-size: 13px;
}
.cs-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(47, 143, 115, .28);
  background: linear-gradient(135deg, #f0f8ff, #d4ecff 45%, #6bb6ff);
  color: #1a4d80;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(58, 130, 214, .16), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
}
.cs-chip span {
  font-size: 15px;
  line-height: 1;
}
.cs-chip:active { transform: scale(.96); }
.tutorial-chip {
  border-color: rgba(126, 87, 194, .28);
  background: linear-gradient(135deg, #f5f0ff, #e0d4ff 45%, #b79ce8);
  color: #4a2d80;
  box-shadow: 0 8px 18px rgba(126, 87, 194, .16), inset 0 1px 0 rgba(255,255,255,.72);
}
.logout-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(215, 91, 82, .30);
  background: linear-gradient(135deg, #fff7f5, #ffd9d4 45%, #f46f63);
  color: #8d231b;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(215, 91, 82, .18), inset 0 1px 0 rgba(255,255,255,.72);
  cursor: pointer;
}
.logout-chip span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  font-size: 14px;
  line-height: 1;
}
.mine-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--green);
  color: white;
  font-size: 25px;
  font-weight: 900;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(47, 143, 115, .20);
}
.mine-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mine-card h3 { margin: 0; font-size: 20px; }
.mine-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.expire-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.renew-inline-btn {
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7dc, #f3bd46);
  color: #704707;
  border: 1px solid rgba(196, 122, 24, .20);
  font-size: 12px;
  font-weight: 900;
}
.renew-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7dc, #f3bd46);
  color: #704707;
  border: 1px solid rgba(196, 122, 24, .20);
  font-weight: 900;
  box-shadow: 0 9px 20px rgba(196, 122, 24, .12);
}
.logout-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  background: #fff0ee;
  color: var(--red);
  border: 1px solid rgba(215, 91, 82, .18);
  font-weight: 900;
}

.growth-thresholds-panel { margin-top: 10px; }
.growth-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.threshold-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.threshold-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.threshold-item span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.threshold-item input {
  width: 100%;
  text-align: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.7);
  font-size: 15px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.threshold-item input::-webkit-outer-spin-button,
.threshold-item input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.threshold-item.locked input {
  background: #f0f0f0;
  color: #aaa;
  border-color: #ddd;
}
.threshold-item.locked em {
  font-size: 10px;
  color: #bbb;
  font-style: normal;
}
.threshold-actions {
  display: flex;
  gap: 8px;
}
.threshold-actions .primary-btn { flex: 1; }
.threshold-actions .ghost-btn { white-space: nowrap; }

@media (max-width: 380px) {
  .threshold-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .threshold-item input { font-size: 13px; min-height: 34px; }
}

/* ===== 宠物状态特效（饥饿/生病） ===== */
.pet-status-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  z-index: 5;
  animation: statusBadgePulse 2s ease-in-out infinite;
}
.pet-status-badge span { font-size: 10px; }
.pet-status-badge.pet-hungry {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  color: #e65100;
  border: 1px solid rgba(230, 81, 0, .3);
}
.pet-status-badge.pet-sick {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, .3);
}
@keyframes statusBadgePulse {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: .8; transform: translateX(-50%) scale(1.05); }
}

/* 饥饿状态特效 */
.pet-stage.pet-hungry .pet-image {
  filter: saturate(.6) brightness(.95);
  animation: hungryShake 3s ease-in-out infinite;
}
.pet-stage.pet-hungry .pet-status-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 50%, rgba(255, 152, 0, .15) 100%);
  animation: hungryPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hungryShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px) rotate(-1deg); }
  40% { transform: translateX(2px) rotate(1deg); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}
@keyframes hungryPulse {
  0%, 100% { opacity: .3; }
  50% { opacity: .7; }
}

/* 生病状态特效 */
.pet-stage.pet-sick .pet-image {
  filter: hue-rotate(70deg) saturate(.7) brightness(.9);
  animation: sickSway 4s ease-in-out infinite;
}
.pet-stage.pet-sick .pet-status-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 40%, rgba(76, 175, 80, .2) 100%);
  animation: sickPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
.pet-stage.pet-sick::after {
  content: '🤢';
  position: absolute;
  top: 10%;
  right: 15%;
  font-size: 20px;
  animation: sickFloat 3s ease-in-out infinite;
  z-index: 4;
}
@keyframes sickSway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}
@keyframes sickPulse {
  0%, 100% { opacity: .2; }
  50% { opacity: .6; }
}
@keyframes sickFloat {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 宠物状态设置面板 ===== */
.pet-status-panel { margin-top: 10px; }
.status-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.status-setting-group {
  border-radius: 12px;
  padding: 12px;
  border: 1.5px solid rgba(255,255,255,.6);
}
.status-setting-group.hungry-group {
  background: linear-gradient(135deg, rgba(255, 243, 224, .6), rgba(255, 224, 178, .4));
}
.status-setting-group.sick-group {
  background: linear-gradient(135deg, rgba(232, 245, 233, .6), rgba(200, 230, 201, .4));
}
.status-setting-title {
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}
.status-setting-row {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}
.status-setting-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.status-setting-row label > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.status-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-input-wrap input {
  flex: 1;
  width: 100%;
  text-align: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.7);
  font-size: 15px;
  font-weight: 800;
  -moz-appearance: textfield;
}
.status-input-wrap input::-webkit-outer-spin-button,
.status-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.status-input-wrap em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.status-setting-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ===== 宠物升级/满级全屏特效 ===== */
.pet-effect-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
  animation: effectFadeIn .3s ease-out;
}
.pet-effect-overlay.fading {
  animation: effectFadeOut .6s ease-in forwards;
}
@keyframes effectFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes effectFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 升级特效 */
.pet-effect-overlay.levelup {
  background: radial-gradient(circle at center, rgba(255, 215, 0, .15) 0%, rgba(255, 215, 0, .05) 40%, transparent 70%);
}
.pet-effect-levelup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.levelup-burst {
  width: 200px;
  height: 200px;
  position: relative;
}
.levelup-burst::before,
.levelup-burst::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, .6) 0%, transparent 60%);
  animation: burstExpand 1.5s ease-out infinite;
}
.levelup-burst::after {
  animation-delay: .5s;
  background: radial-gradient(circle, rgba(255, 193, 7, .4) 0%, transparent 60%);
}
@keyframes burstExpand {
  0% { transform: scale(.3); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}
.levelup-text {
  font-size: 28px;
  font-weight: 900;
  color: #f57f17;
  text-shadow: 0 2px 8px rgba(255, 215, 0, .6), 0 0 20px rgba(255, 215, 0, .4);
  animation: textBounce .6s ease-out;
}
@keyframes textBounce {
  0% { transform: scale(.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* 满级特效 */
.pet-effect-overlay.maxlevel {
  background: radial-gradient(circle at center, rgba(255, 215, 0, .25) 0%, rgba(255, 152, 0, .1) 30%, rgba(0,0,0,.3) 70%);
}
.pet-effect-maxlevel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.maxlevel-burst {
  width: 300px;
  height: 300px;
  position: relative;
}
.maxlevel-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,215,0,.5), rgba(255,152,0,.3), rgba(255,215,0,.5), rgba(255,193,7,.3), rgba(255,215,0,.5));
  animation: maxlevelSpin 3s linear infinite;
  filter: blur(20px);
}
.maxlevel-burst::after {
  content: '👑';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  animation: maxlevelCrown 1s ease-out;
  text-shadow: 0 0 30px rgba(255, 215, 0, .8);
}
@keyframes maxlevelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes maxlevelCrown {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.maxlevel-text {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(255, 215, 0, .8), 0 0 30px rgba(255, 152, 0, .6);
  animation: textBounce .8s ease-out;
}
.maxlevel-subtext {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  animation: textBounce 1s ease-out .2s backwards;
}

/* ===== 忘记密码 ===== */
.forgot-password-link {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--green, #2f8f73);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== 购买兑换码链接 ===== */
.purchase-link-row {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.renew-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--theme-soft, #e5f6ed) 72%, white);
  color: var(--green-dark, #17644f);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.purchase-link-btn {
  background: none;
  border: none;
  color: var(--green, #2f8f73);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 2px;
}
.forgot-password-sheet {
  max-width: 380px;
}
.forgot-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.forgot-username-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(47, 143, 115, .08);
  margin-bottom: 12px;
  font-size: 14px;
}
.forgot-username-box b {
  color: var(--green, #2f8f73);
  font-size: 16px;
}
.customer-service-btn {
  margin-top: 12px;
  width: 100%;
}

/* ===== 客服二维码弹窗 ===== */
.customer-service-sheet {
  max-width: 340px;
  text-align: center;
}
.qr-code-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.qr-code-img {
  max-width: 260px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.qr-code-empty {
  color: var(--muted);
  font-size: 14px;
  padding: 40px 0;
}
.qr-code-tip {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100vw, 520px);
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 20, 15, .80);
  padding: 16px;
}
.modal.active { display: flex; }
.modal.center-modal {
  align-items: center;
}
.sheet {
  width: min(420px, 100%);
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.88)),
    linear-gradient(135deg, color-mix(in srgb, var(--theme-soft) 42%, #fff), #fff);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(9, 24, 18, .22), inset 0 1px 0 rgba(255,255,255,.58);
  animation: popIn .16s ease-out;
}
.sheet h3 { margin: 0 0 10px; color: var(--ink); }
.sheet .field span,
.sheet .form-hint,
.sheet .small,
.sheet p {
  color: #34413b;
}
.sheet input,
.sheet select {
  background: rgba(255,255,255,.94);
  color: var(--ink);
  border-color: rgba(91, 113, 104, .24);
}
.center-modal .sheet {
  width: min(420px, 100%);
  animation: popIn .16s ease-out;
}
.confirm-sheet p {
  margin: 4px 0 16px;
  color: #2f3d37;
  line-height: 1.6;
  font-weight: 650;
}
.delete-password-field {
  margin: -4px 0 14px;
}
.danger-primary {
  background: var(--red);
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; }
.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf4ef;
  color: #30443b;
  font-size: 22px;
}
.pet-picker-grid {
  display: grid;
  gap: 12px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-series-group {
  display: grid;
  gap: 8px;
}
.pet-series-group h4 {
  margin: 0;
  color: var(--green-dark);
  font-size: 13px;
}
.pet-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.pet-choice {
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 24px rgba(72, 98, 88, .16), inset 0 1px 0 rgba(255,255,255,.9);
}
.pet-choice:active {
  transform: translateY(1px) scale(.99);
}
.pet-choice span { font-size: 44px; line-height: 1; }
.pet-choice-image {
  width: 78px;
  height: 72px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  margin: 0 auto;
}
.pet-choice-image.emoji {
  font-size: 44px;
}
.pet-choice b {
  max-width: 100%;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.18;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pet-choice {
  position: relative;
}
.pet-choice-adopted {
  border-color: rgba(211, 47, 47, .34);
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,246,248,.82));
}
.pet-adopted-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border: 1px solid rgba(211, 47, 47, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #d32f2f;
  font-size: 10px;
  line-height: 1.15;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(211, 47, 47, .12);
  pointer-events: none;
}
.pet-restaurant-sheet {
  max-width: 480px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 239, 183, .92), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(255, 183, 132, .62), transparent 28%),
    linear-gradient(180deg, rgba(255, 252, 244, .92), rgba(255, 239, 220, .84));
  border: 1px solid rgba(255, 230, 180, .92);
  box-shadow: 0 24px 52px rgba(130, 80, 34, .22), inset 0 1px 0 rgba(255,255,255,.88);
}
.restaurant-head {
  align-items: flex-start;
}
.restaurant-head h3 {
  color: #6d3b12;
  font-size: 20px;
}
.restaurant-head p {
  margin: 4px 0 0;
  color: #9a6a3d;
  font-size: 12px;
  font-weight: 800;
}
.restaurant-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  margin: 0 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: #8d5c24;
  font-size: 12px;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 218, 154, .70);
}
.restaurant-balance b {
  color: #c77013;
  font-size: 18px;
}
.shop-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 10px 2px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #ffe8b8);
  color: #8d5c24;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 100, .6), 0 1px 2px rgba(0,0,0,.04);
  white-space: nowrap;
}
.shop-balance b {
  color: #c77013;
  font-size: 16px;
}
.pet-food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px 2px 4px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.pet-food-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 24px rgba(143, 86, 33, .14), inset 0 1px 0 rgba(255,255,255,.92);
}
.food-image-wrap {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7dc, #ffe5c6);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.70);
}
.food-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.food-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.food-info b {
  color: #5c3515;
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.food-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}
.food-meta-line span,
.food-meta-line em {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 246, 226, .84);
  color: #9b6b3c;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}
.food-meta-line em {
  background: rgba(255, 233, 247, .86);
  color: #b64f93;
}
.feed-btn {
  min-height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8f6e, #f44f8d);
  color: white;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 9px 18px rgba(218, 80, 91, .22), inset 0 1px 0 rgba(255,255,255,.45);
}
.medal-wall-sheet {
  max-height: 78vh;
  overflow: hidden;
}
.medal-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px 10px;
  max-height: calc(78vh - 76px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 4px 14px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* 勋章卡片 */
.medal-card {
  position: relative;
  min-width: 0;
  min-height: 180px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 22px 6px 12px;
  border: none;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255,255,255,1), transparent 50%),
    linear-gradient(165deg, #f4f9f3 0%, #fffdf5 50%, #fdf3dc 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 8px 20px rgba(40, 80, 50, .07),
    0 2px 6px rgba(180, 130, 10, .06);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.medal-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 14px 28px rgba(40, 80, 50, .1),
    0 4px 10px rgba(180, 130, 10, .08);
}
.medal-card:active { transform: scale(.97); }

/* 缎带 */
.medal-card .medal-ribbon {
  position: absolute;
  top: -4px;
  width: 30px;
  height: 64px;
  clip-path: polygon(50% 0, 100% 12%, 100% 88%, 50% 100%, 0 88%, 0 12%);
  background: linear-gradient(180deg, #3a9d6e, #1c6652);
  filter: drop-shadow(0 4px 6px rgba(20, 60, 40, .15));
  z-index: 0;
}
.medal-card .medal-ribbon-l { left: calc(50% - 36px); transform: rotate(-16deg); }
.medal-card .medal-ribbon-r { right: calc(50% - 36px); transform: rotate(16deg); }

/* 累计数量 */
.medal-card .medal-count {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  min-width: 32px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #f5c542, #c88a0e);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  box-shadow: 0 4px 10px rgba(200, 138, 14, .3);
}

/* 奖章环 */
.medal-ring {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-top: 8px;
  z-index: 1;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow:
    0 10px 20px rgba(180, 120, 5, .16),
    inset 0 -3px 0 rgba(0,0,0,.06),
    inset 0 2px 0 rgba(255,255,255,.5);
}
.medal-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #1c6652;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15);
}
.medal-ring::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, #fff8d8 50%, #f5c542 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.9);
}
.medal-core {
  position: relative;
  z-index: 2;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #fffaee 60%, #fff3d0 100%);
  box-shadow: 0 4px 8px rgba(100, 60, 5, .1);
}
.medal-core span {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 38px;
  filter: drop-shadow(0 4px 6px rgba(80, 58, 17, .12));
}
.medal-pet-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.medal-pet-image.emoji { font-size: 34px; }

/* 窄屏（手机）自适应缩小勋章，确保一行 3 个完整显示 */
@media (max-width: 480px) {
  .medal-wall {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px 6px;
    padding: 8px 2px 14px;
  }
  .medal-card {
    padding: 20px 3px 10px;
    min-height: 158px;
  }
  .medal-card .medal-ribbon { width: 22px; height: 50px; }
  .medal-card .medal-ribbon-l { left: calc(50% - 28px); }
  .medal-card .medal-ribbon-r { right: calc(50% - 28px); }
  .medal-ring { width: 80px; height: 80px; margin-top: 6px; }
  .medal-ring::before { inset: 5px; }
  .medal-ring::after { inset: 8px; }
  .medal-core { width: 56px; height: 56px; }
  .medal-core span { width: 48px; height: 48px; font-size: 30px; }
  .medal-pet-image { width: 46px; height: 46px; }
  .medal-pet-image.emoji { font-size: 26px; }
  .medal-card .medal-count { min-width: 24px; height: 18px; padding: 0 5px; font-size: 10px; top: 8px; right: 5px; }
  /* 手机端：图片保持 122% 不缩小，仅加大底部留白把图片上移、名称下移，避免图片盖住名称（宠物档案页除外，名称已在顶部） */
  .pet-face { padding-top: 8%; padding-bottom: 24%; }
  .pet-caption { margin-top: 14px; }
  .pet-panel-large .pet-face { padding-top: 0; padding-bottom: 14%; }
  .pet-panel-large .pet-caption { margin-top: 0; }
}

/* 星星装饰 */
.medal-star {
  position: absolute;
  z-index: 3;
  width: 11px;
  height: 11px;
  background: #fff8d8;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 1px 2px rgba(180,120,5,.3));
}
.medal-star.s1 { top: 0; left: 50%; transform: translateX(-50%) scale(1); }
.medal-star.s2 { top: 22%; right: -4px; transform: scale(.7); opacity: .85; }
.medal-star.s3 { bottom: 14%; right: 2px; transform: scale(.65); opacity: .8; }
.medal-star.s4 { bottom: 14%; left: 2px; transform: scale(.65); opacity: .8; }

/* 名字 + 日期 */
.medal-card b {
  max-width: 100%;
  color: #1c6652;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .5px;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.medal-card em {
  color: #b87b08;
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
}

/* ===== 勋章详情大图 ===== */
.medal-detail-sheet {
  width: min(420px, calc(100vw - 24px));
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.85), transparent 55%),
    linear-gradient(180deg, #f4f9f3, #fffdf5 50%, #fff);
  border-radius: 20px;
  padding: 18px 16px 16px;
}
.medal-detail-stage {
  position: relative;
  padding: 30px 0 20px;
  margin: 6px 0 14px;
  display: grid;
  justify-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, #fff, transparent 55%),
    linear-gradient(165deg, #f4f9f3 0%, #fffdf5 55%, #fdf3dc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}

/* 详情缎带 */
.medal-detail-ribbon {
  position: absolute;
  top: 0;
  width: 46px;
  height: 150px;
  clip-path: polygon(50% 0, 100% 10%, 100% 94%, 50% 100%, 0 94%, 0 10%);
  background: linear-gradient(180deg, #3a9d6e, #1c6652);
  filter: drop-shadow(0 6px 10px rgba(20, 60, 40, .12));
  z-index: 0;
}
.medal-detail-ribbon.medal-ribbon-l { left: calc(50% - 100px); transform: rotate(-14deg); }
.medal-detail-ribbon.medal-ribbon-r { right: calc(50% - 100px); transform: rotate(14deg); }

/* 详情大奖章环 */
.medal-detail-ring {
  position: relative;
  width: 230px;
  height: 230px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  z-index: 1;
  margin-top: 14px;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow:
    0 18px 36px rgba(180, 120, 5, .2),
    inset 0 -4px 0 rgba(0,0,0,.06),
    inset 0 3px 0 rgba(255,255,255,.45);
}
.medal-detail-ring::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #1c6652;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}
.medal-detail-ring::after {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff, #fff8d8 45%, #f5c542 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.92);
}
.medal-detail-core {
  position: relative;
  z-index: 2;
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #fffaee 55%, #fff3d0 100%);
  box-shadow: 0 8px 16px rgba(100, 60, 5, .12);
}
.medal-detail-image {
  width: 142px;
  height: 142px;
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 8px 12px rgba(80, 58, 17, .15));
}
.medal-detail-image.emoji { font-size: 88px; }

/* 详情星星 */
.medal-detail-ring .medal-star {
  width: 20px;
  height: 20px;
  background: #fff8d8;
  filter: drop-shadow(0 1px 2px rgba(180,120,5,.3));
}
.medal-detail-ring .medal-star.s1 { top: -6px; left: 50%; transform: translateX(-50%) scale(1.1); }
.medal-detail-ring .medal-star.s2 { top: 20%; right: -10px; transform: scale(.95); opacity: .9; }
.medal-detail-ring .medal-star.s3 { bottom: 16%; right: 4px; transform: scale(.8); opacity: .85; }
.medal-detail-ring .medal-star.s4 { bottom: 16%; left: 4px; transform: scale(.8); opacity: .85; }
.medal-detail-ring .medal-star.s5 { top: 36%; left: -10px; transform: scale(.85); opacity: .8; }
.medal-detail-ring .medal-star.s6 { top: 36%; right: -10px; transform: scale(.85); opacity: .8; }

.medal-detail-label {
  margin-top: 14px;
  padding: 7px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: rgba(28, 102, 82, .08);
  color: #1c6652;
  border: 1px solid rgba(28, 102, 82, .2);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.medal-detail-info {
  padding: 4px 10px 12px;
  text-align: center;
}
.medal-detail-info h4 {
  margin: 6px 0 8px;
  font-size: 24px;
  font-weight: 950;
  color: #1c6652;
  letter-spacing: 1px;
}
.medal-detail-info p {
  margin: 4px 0;
  font-size: 13px;
  color: #b87b08;
}
.medal-detail-info b { color: #1c6652; }

/* ===== 勋章预览舞台：透明背景（让勋章本体直接呈现，便于裁剪成实体） ===== */
.medal-detail-stage {
  position: relative;
  padding: 30px 0 20px;
  margin: 6px 0 14px;
  display: grid;
  justify-items: center;
  border-radius: 16px;
  /* 棋盘格透明效果：方便用户预览透明区域效果 */
  background-image:
    linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.04) 75%),
    linear-gradient(45deg, rgba(0,0,0,0.04) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.04) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

/* ===== 蔷薇女孩风格（与金翠同构：圆形+缎带，配色改为玫瑰金+薰衣草紫） ===== */
.rose-stage .medal-detail-ribbon.rose-ribbon {
  background: linear-gradient(180deg, #b9a9d8 0%, #7b69ad 100%);
}
.rose-stage .medal-detail-ribbon.rose-ribbon::after {
  background: linear-gradient(180deg, rgba(123,105,173,.85), rgba(123,105,173,.4));
}
/* 外圈：玫瑰金渐变 */
.rose-stage .medal-detail-ring.rose-ring {
  background: conic-gradient(from 35deg, #fff3f0, #eeb7b0, #8e4b52, #fff3f0, #eeb7b0, #8e4b52, #fff3f0);
  box-shadow:
    0 18px 36px rgba(142, 75, 82, .18),
    inset 0 -4px 0 rgba(0,0,0,.05),
    inset 0 3px 0 rgba(255,255,255,.45);
}
/* 中层圈：薰衣草紫 */
.rose-stage .medal-detail-ring.rose-ring::before {
  background: #7b69ad;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.22);
}
/* 核心：樱花粉渐变 */
.rose-stage .medal-detail-ring.rose-ring::after {
  background: radial-gradient(circle at 30% 25%, #fff, #fff3f0 45%, #f8cfd3 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.92);
}
.rose-stage .medal-detail-core.rose-core {
  background: radial-gradient(circle at 35% 28%, #fff, #fff5f2 55%, #fce3e6 100%);
  box-shadow: 0 8px 16px rgba(142, 75, 82, .10);
}

/* 蔷薇版小花装饰（替换金翠版的五角星） */
.rose-stage .medal-detail-ring .medal-flower {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 3;
  /* 5瓣花：用径向渐变+多层伪元素模拟 */
}
.rose-stage .medal-detail-ring .medal-flower::before,
.rose-stage .medal-detail-ring .medal-flower::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 85% 38%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 72% 85%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 28% 85%, #c9757a 0 28%, transparent 30%),
    radial-gradient(circle at 15% 38%, #c9757a 0 28%, transparent 30%);
}
.rose-stage .medal-detail-ring .medal-flower::after {
  inset: 5px;
  background: #fff3f0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #c9757a;
}
.rose-stage .medal-detail-ring .medal-flower.mf1 { top: -8px; left: 50%; transform: translateX(-50%) scale(1.1); }
.rose-stage .medal-detail-ring .medal-flower.mf2 { top: 18%; right: -12px; }
.rose-stage .medal-detail-ring .medal-flower.mf3 { bottom: 18%; right: -6px; transform: scale(.85); }
.rose-stage .medal-detail-ring .medal-flower.mf4 { bottom: 18%; left: -6px; transform: scale(.85); }
.rose-stage .medal-detail-ring .medal-flower.mf5 { top: 32%; left: -14px; transform: scale(.9); }

/* 蔷薇版标签 */
.rose-stage .rose-label {
  background: rgba(217, 142, 160, .10);
  color: #c9757a;
  border: 1px solid rgba(201, 117, 122, .3);
}

/* ===== 底部预览图切换 ===== */
.medal-design-previews {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 10px 0 6px;
}
.medal-preview-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 2px solid rgba(0,0,0,.06);
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.medal-preview-thumb:hover { transform: translateY(-2px); border-color: rgba(0,0,0,.12); }
.medal-preview-thumb.active {
  border-color: var(--green-dark, #1c6652);
  background: rgba(28, 102, 82, .06);
  box-shadow: 0 4px 12px rgba(28, 102, 82, .1);
}
.medal-preview-thumb em {
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
}
.medal-preview-thumb.active em { color: #1c6652; }

/* 迷你预览图 */
.thumb-mini {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: relative;
}
.thumb-classic .thumb-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #fff8d8, #f5c542, #c88a0e, #fff8d8, #f5c542, #c88a0e, #fff8d8);
  box-shadow: 0 2px 6px rgba(180, 120, 5, .2), inset 0 0 0 3px #1c6652, inset 0 0 0 5px #fff8d8;
}
/* 蔷薇版迷你预览：同款圆环造型+玫瑰金+薰衣草紫 */
.thumb-rose .thumb-ring-rose {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 35deg, #fff3f0, #eeb7b0, #8e4b52, #fff3f0, #eeb7b0, #8e4b52, #fff3f0);
  box-shadow: 0 2px 6px rgba(142, 75, 82, .2), inset 0 0 0 3px #7b69ad, inset 0 0 0 5px #fff3f0;
}

.medal-detail-actions { margin-top: 8px; gap: 10px !important; justify-content: center; }
.medal-detail-actions .primary-btn {
  background: linear-gradient(135deg, #1c6652, #2f8f73);
  color: white;
  box-shadow: 0 10px 20px rgba(28, 102, 82, .22);
}
.image-preview-sheet {
  width: min(360px, calc(100vw - 28px));
}
.image-preview-body {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.22);
}
.preview-large-image {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  object-fit: contain;
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 18px 18px rgba(44, 54, 48, .16));
}
.preview-large-image.emoji { font-size: 150px; }

/* 大图预览黑白效果（组合选择器优先级高，避免被覆盖） */
.preview-large-image.preview-image-locked,
.image-preview-body.locked-preview .preview-large-image {
  filter: grayscale(100%) brightness(0.78) contrast(0.9) drop-shadow(0 18px 18px rgba(44, 54, 48, .12)) !important;
  -webkit-filter: grayscale(100%) brightness(0.78) contrast(0.9) drop-shadow(0 18px 18px rgba(44, 54, 48, .12)) !important;
  opacity: 0.92;
}
.summon-modal {
  align-items: center;
  background: radial-gradient(circle at 50% 38%, rgba(255, 214, 101, .22), rgba(7, 16, 13, .80));
}
.summon-card {
  position: relative;
  width: min(420px, 100%);
  min-height: 440px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(255,255,255,.96), rgba(239,248,239,.96));
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
  overflow: hidden;
}
.summon-burst {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(244, 188, 66, .0), rgba(244,188,66,.58), rgba(47,143,115,.18), rgba(244,188,66,.0));
  animation: spinBurst 4s linear infinite;
}
.summon-pet {
  position: relative;
  z-index: 1;
  font-size: 150px;
  line-height: 1;
  filter: drop-shadow(0 18px 22px rgba(40,60,48,.18));
  animation: petBreath 2.1s ease-in-out infinite;
}
.summon-pet-image {
  width: min(52vw, 240px);
  height: min(52vw, 240px);
  object-fit: contain;
  display: inline-grid;
  place-items: center;
}
.summon-pet-image.emoji {
  font-size: inherit;
}
.summon-card h3, .summon-card p, .summon-card button { position: relative; z-index: 1; }
.summon-card h3 { margin: 0; font-size: 24px; color: var(--green-dark); }
.summon-card p { margin: 0; text-align: center; color: var(--muted); }
@keyframes spinBurst {
  to { transform: rotate(360deg); }
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 50;
  transform: translate(-50%, -50%) scale(.96);
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 17px;
  border-radius: 8px;
  background: rgba(21,35,30,.94);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  text-align: center;
  font-weight: 800;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 360px) {
  .app { padding-inline: 10px; }
  .growth-card { grid-template-columns: minmax(154px, 56%) minmax(94px, 1fr); gap: 9px; }
  .pet-panel { grid-template-rows: minmax(136px, 1fr) auto auto; }
  .pet-stage { min-height: 136px; }
  .pet-face { min-width: 124px; font-size: clamp(92px, 34vw, 132px); }
  .metrics { grid-template-columns: 1fr; }
  .metric { padding: 8px 6px; }
  .growth-card .metric { min-height: 46px; padding: 8px 9px; }
  .growth-card .metric b { font-size: 20px; }
  .child-profile { grid-template-columns: minmax(0, 1fr) 58px; gap: 7px; }
  .growth-info h2 { font-size: 20px; }
  .profile-avatar { width: 58px; height: 58px; }
  .profile-avatar .avatar { width: 50px; height: 50px; }
  .item { align-items: flex-start; }
  .list-actions { flex-direction: column; gap: 5px; }
  .mini-btn { min-height: 26px; padding: 0 8px; }
  .rules-header { grid-template-columns: 76px 1fr 76px; }
  .rule-track { grid-auto-columns: calc((100% - 24px) / 4); }
}


@media (max-width: 520px) {
  .mine-card {
    align-items: flex-start;
    row-gap: 8px;
    padding-top: 16px;
  }
  .mine-sub-actions-row {
    margin-top: 0;
    padding-left: 0;
    justify-content: flex-start;
  }
  .mine-sub-actions-row .cs-chip {
    min-height: 30px;
  }
}

.app.parent-banner-visible {
  padding-bottom: calc(220px + env(safe-area-inset-bottom));
}
.parent-banner-ad {
  position: fixed;
  left: 50%;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(500px, calc(100% - 20px));
  aspect-ratio: 750 / 200;
  transform: translateX(-50%);
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 34px rgba(26, 39, 34, .22);
}
.parent-banner-link {
  display: block;
  width: 100%;
  height: 100%;
}
.parent-banner-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.parent-banner-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.48);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}