/* ── Pixel-First fonts (docs/wiki/design/petown-ui.md §1) ── */
@font-face {
    font-family: 'Zpix';
    src: url('https://cdn.jsdelivr.net/gh/SolidZORO/zpix-pixel-font@3.1.9/website/zpix.woff2') format('woff2');
    font-display: swap;
    font-weight: normal;
    font-style: normal;
}
/* ── Pet Town Design System (PIXEL-FIRST) ── */
body.lp-hide-site-chrome {
    margin: 0;
    min-height: 100vh;
    background: #efe2c2;
    image-rendering: pixelated;
}
:root {
    /* ── 按钮家族 token（统一像素主题）── */
    --btn-border: #4A2F1A;
    --btn-border-w: 3px;
    --btn-shadow-offset: 3px;
    --btn-radius: 6px;
    --btn-press-x: 2px;
    --btn-press-y: 2px;
    --btn-press-shadow: 1px;
    --btn-min-height: 44px;
    --btn-icon-size: 44px;
    --btn-focus-ring: 0 0 0 3px rgba(249, 115, 22, 0.45);
}
.pet-app {
    /* ── PIXEL-FIRST 12 token palette (docs/wiki/design/petown-ui.md §2) ── */
    --p-day: #a9d4ee;
    --p-dusk: #dba07a;
    --p-night: #1d2545;
    --p-paper: #fbf3df;
    --p-paper-soft: #efe2c2;
    --p-ink: #3a2a1c;
    --p-ink-soft: #7a5d3f;
    --p-accent: #e07a3c;
    --p-warm: #f3a86b;
    --p-cool: #5a8b3c;
    --p-ok: #88b04b;
    --p-warn: #c25a3a;

    /* ── Legacy --pet-* aliases (mapped onto new tokens) ── */
    --pet-primary: var(--p-accent);
    --pet-primary-light: var(--p-warm);
    --pet-primary-dark: var(--p-accent);
    --pet-secondary: var(--p-cool);
    --pet-accent: var(--p-cool);
    --pet-bg: var(--p-paper-soft);
    --pet-surface: var(--p-paper);
    --pet-surface-hover: var(--p-paper-soft);
    --pet-text: var(--p-ink);
    --pet-text-secondary: var(--p-ink);
    --pet-text-muted: var(--p-ink-soft);
    --pet-border: var(--p-ink-soft);
    --pet-border-strong: var(--p-ink);
    --pet-shadow-color: transparent;
    --pet-radius: 2px;
    --pet-radius-sm: 2px;
    --pet-radius-xs: 2px;
    --pet-shadow: none;
    --pet-shadow-sm: none;
    --pet-shadow-lg: none;
    --pet-transition: 200ms ease-out;
    --pet-ease-spring: steps(3);
    --pet-ease-press: ease-out;
    --pet-press-ms: 120ms;

    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 16px;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    color: var(--p-ink);
    font-family: 'LXGW WenKai', 'Pixelify Sans', serif;
    font-size: 14px;
    line-height: 1.6;
    image-rendering: pixelated;
}
.pet-app h1, .pet-app h2, .pet-app h3 {
    font-family: 'Zpix', 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    letter-spacing: 0.02em;
}

/* ── Top bar ── */
.pet-topbar {
    max-width: 1120px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.pet-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.pet-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    min-height: var(--btn-min-height);
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: #FFFCF5;
    color: var(--btn-border);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    font-family: 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
    .pet-back:hover { background: #FED7AA; }
}
.pet-back:active {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-back:focus-visible {
    outline: none;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}
.pet-title-group { min-width: 0; }
.pet-title {
    margin: 0;
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--pet-primary-dark);
}
.pet-subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--pet-text-muted);
    font-weight: 500;
}
.pet-actions-top {
    display: flex;
    gap: 8px;
}
.pet-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: var(--btn-icon-size);
    height: var(--btn-icon-size);
    padding: 0 12px;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: #FFFCF5;
    color: var(--btn-border);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
    .pet-icon-btn:hover { background: #FED7AA; }
}
.pet-icon-btn:active:not(:disabled) {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}
.pet-icon-btn.pet-sound-off { background: var(--p-warm); }
.pet-icon-btn.pet-sound-off:hover { background: var(--p-accent); }
.pet-icon-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Shell grid ── */
.pet-shell {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
    grid-template-rows: auto auto auto;
    gap: 16px;
    align-items: stretch;
}
.pet-shell > .pet-scene { grid-column: 1; grid-row: 1; }
.pet-shell > .pet-status { grid-column: 2; grid-row: 1; }
.pet-action-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}
.pet-bottom-row {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Card base ── */
.pet-card {
    background: var(--pet-surface);
    border: 3px solid var(--pet-border);
    border-radius: var(--pet-radius);
    box-shadow: var(--pet-shadow);
    overflow: hidden;
}

/* ── Scene (pixel-art outdoor yard) ── */
.pet-scene {
    position: relative;
    min-height: 480px;
    overflow: hidden;
}
.pet-scene-art-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-image: url('/static/img/petown/petown-yard-cottagecore-calm-desktop-compressed.webp');
    image-rendering: auto;
}
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-sky,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-stars,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-sun,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-moon,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-cloud,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-bird,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-mountains,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-yard-tree,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-shooting-star,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-fence,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-fence-arch,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-bush,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-daisy,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-ground,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-fireflies,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-petals,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-flower,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-tallgrass,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-stones,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-butterfly,
.pet-scene.uses-art-bg .pet-scene-layer--outdoor > .pet-scene-rain,
.pet-scene.uses-art-bg > .pet-scene-rain,
.pet-scene.uses-art-bg > .pet-scene-tint {
    display: none !important;
}
.pet-card.pet-scene.uses-art-bg::after {
    display: none;
}
.pet-scene.uses-art-bg .pet-scene-item,
.pet-scene.uses-art-bg .pet-scene-away-sign,
.pet-scene.uses-art-bg #petownCatCanvas,
.pet-scene.uses-art-bg .pet-cat-touch-bubble,
.pet-scene.uses-art-bg .pet-cat-drag-hint {
    z-index: 12;
}
/* cottagecore 背景图把门/栅栏画在场景 28%–45%、树干在 45%–95%；猫舞台需要覆盖整个院子，
   而不是只覆盖栅栏以下。canvas 上扩到 28% 让 sprite 顶能贴近背景图门下沿。 */
.pet-scene.uses-art-bg #petownCatCanvas {
    top: 28%;
    height: 72%;
}
/* Sky layer */
.pet-scene-sky {
    position: absolute;
    inset: 0;
    bottom: 56%;
    background: linear-gradient(180deg,
        #7EC8E3 0%, #7EC8E3 15%,
        #9DD5E8 15%, #9DD5E8 30%,
        #BDE3C0 30%, #BDE3C0 45%,
        #F5DEB3 45%, #F5DEB3 65%,
        #F0C090 65%, #F0C090 80%,
        #E8B070 80%
    );
}
/* Pixel clouds */
.pet-scene-cloud {
    position: absolute;
    background: rgba(255, 248, 220, 0.85);
    image-rendering: pixelated;
    z-index: 1;
}
.pet-scene-cloud-1 {
    top: 6%; left: 12%;
    width: 72px; height: 16px;
    box-shadow:
        8px -8px 0 rgba(255,248,220,0.85),
        16px -8px 0 rgba(255,248,220,0.85),
        24px -8px 0 rgba(255,248,220,0.85),
        32px -8px 0 rgba(255,248,220,0.85),
        16px -16px 0 rgba(255,248,220,0.85),
        24px -16px 0 rgba(255,248,220,0.85);
    animation: cloud-drift 25s linear infinite;
}
.pet-scene-cloud-2 {
    top: 10%; right: 18%;
    width: 56px; height: 12px;
    box-shadow:
        8px -8px 0 rgba(255,248,220,0.7),
        16px -8px 0 rgba(255,248,220,0.7),
        24px -8px 0 rgba(255,248,220,0.7),
        12px -16px 0 rgba(255,248,220,0.7),
        20px -16px 0 rgba(255,248,220,0.7);
    animation: cloud-drift 35s linear infinite reverse;
}
.pet-scene-cloud-3 {
    top: 3%; left: 55%;
    width: 48px; height: 10px;
    box-shadow:
        6px -6px 0 rgba(255,248,220,0.6),
        12px -6px 0 rgba(255,248,220,0.6),
        18px -6px 0 rgba(255,248,220,0.6);
    animation: cloud-drift 40s linear infinite;
}
@keyframes cloud-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(80px); }
}
/* Sun */
.pet-scene-sun {
    position: absolute;
    top: 8%; right: 10%;
    width: 32px; height: 32px;
    background: #FFF5CC;
    border-radius: 50%;
    box-shadow: 0 0 20px 8px rgba(255,245,200,0.5);
    z-index: 0;
}
/* Fence */
.pet-scene-fence {
    position: absolute;
    top: 28%; left: 0; right: 0;
    height: 16%;
    z-index: 2;
    /* Horizontal rails + vertical planks */
    background:
        linear-gradient(180deg,
            #7B5B3A 0, #7B5B3A 5px, transparent 5px, transparent calc(50% - 2px),
            #7B5B3A calc(50% - 2px), #7B5B3A calc(50% + 2px), transparent calc(50% + 2px),
            transparent calc(100% - 5px), #7B5B3A calc(100% - 5px)
        ),
        repeating-linear-gradient(90deg,
            #C49B5C 0px, #C49B5C 30px,
            #A8844A 30px, #A8844A 34px,
            #D4AA6E 34px, #D4AA6E 64px,
            #B8904E 64px, #B8904E 68px
        );
}
/* === 中央拱门（garden arch with vines）=== */
.pet-scene-fence-arch {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 22%;            /* 比 fence top (28%) 高 6%，拱顶探出围栏 */
    width: 14%;
    max-width: 160px;
    min-width: 80px;
    height: 26%;         /* 大于 fence height (16%)，下沿压到草地 */
    z-index: 3;          /* 在 fence (2) 之前，灌木 (4) 之后 */
    pointer-events: none;
}
/* 木质拱框 */
.pet-scene-fence-arch-frame {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 22%,
            rgba(0, 0, 0, 0.20) 22%,
            rgba(0, 0, 0, 0.20) 24%,
            transparent 24%,
            transparent 76%,
            rgba(0, 0, 0, 0.20) 76%,
            rgba(0, 0, 0, 0.20) 78%
        ),
        linear-gradient(180deg, #6b4a26 0%, #5a3d20 50%, #4a3015 100%);
    border-radius: 50% 50% 4px 4px / 32% 32% 4px 4px;
    box-shadow:
        inset 0 0 0 3px rgba(0, 0, 0, 0.22),
        inset 0 3px 0 rgba(255, 255, 255, 0.10),
        inset 0 -4px 0 rgba(0, 0, 0, 0.28),
        2px 4px 0 rgba(0, 0, 0, 0.18);
}
/* 门内木板 */
.pet-scene-fence-arch-door {
    position: absolute;
    top: 14%;
    bottom: 6%;
    left: 14%;
    right: 14%;
    background:
        repeating-linear-gradient(
            90deg,
            #9a6f3e 0,
            #9a6f3e 7px,
            #7a5530 7px,
            #7a5530 9px
        );
    border-radius: 50% 50% 3px 3px / 28% 28% 3px 3px;
    box-shadow:
        inset 0 -3px 0 rgba(0, 0, 0, 0.28),
        inset 0 2px 0 rgba(255, 255, 255, 0.14),
        inset 2px 0 0 rgba(0, 0, 0, 0.18),
        inset -2px 0 0 rgba(0, 0, 0, 0.18);
}
.pet-scene-fence-arch-door::before {
    /* 门把手 */
    content: '';
    position: absolute;
    top: 50%;
    right: 14%;
    width: 6px;
    height: 6px;
    background: #f5d27a;
    border-radius: 50%;
    box-shadow: inset -1px -1px 0 rgba(0, 0, 0, 0.3), 0 0 2px rgba(245, 210, 122, 0.5);
}
/* 拱顶攀爬植物（vines）— 用 svg 多个小叶簇 */
.pet-scene-fence-arch-vines {
    position: absolute;
    left: -16%;
    right: -16%;
    top: -22%;
    height: 50%;
    pointer-events: none;
}
.pet-scene-fence-arch-vines svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* 时段：夜晚拱门更暗 */
.pet-scene.is-night .pet-scene-fence-arch-frame {
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0, transparent 22%,
            rgba(0, 0, 0, 0.4) 22%, rgba(0, 0, 0, 0.4) 24%,
            transparent 24%, transparent 76%,
            rgba(0, 0, 0, 0.4) 76%, rgba(0, 0, 0, 0.4) 78%
        ),
        linear-gradient(180deg, #2e2010 0%, #1f1408 100%);
}
.pet-scene.is-night .pet-scene-fence-arch-door {
    background: repeating-linear-gradient(90deg,
        #4a3219 0, #4a3219 7px, #382414 7px, #382414 9px);
}

/* Fence post tops (pointed) */
.pet-scene-fence::before {
    content: '';
    position: absolute;
    top: -10px; left: 0; right: 0;
    height: 10px;
    background: repeating-linear-gradient(90deg,
        transparent 0, transparent 10px,
        #C49B5C 10px, #C49B5C 24px,
        transparent 24px, transparent 34px,
        #D4AA6E 34px, #D4AA6E 58px,
        transparent 58px, transparent 68px
    );
}
/* Fence item (picture frame hanging on fence) */
.pet-scene-fence-item {
    position: absolute;
    top: 12%;
    right: 18%;
    width: 52px;
    height: 44px;
    background: linear-gradient(135deg, #C8DFF0 0%, #A4C8E8 40%, #8BB8D8 100%);
    border: 3px solid #7B5B3A;
    box-shadow:
        inset 0 0 0 2px #9B7B5A,
        inset 0 0 0 4px #D4B896,
        2px 3px 6px rgba(0,0,0,0.25);
    z-index: 3;
    cursor: pointer;
    image-rendering: pixelated;
    transition: transform var(--pet-transition);
    position: relative;
}
/* 画框内的小风景 */
.pet-scene-fence-item::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    background:
        linear-gradient(180deg,
            #87CEEB 0%, #87CEEB 45%,
            #5a8b3c 45%, #5a8b3c 65%,
            #4a7a2c 65%, #4a7a2c 100%
        );
    border: 1px solid rgba(0,0,0,0.15);
}
/* 画框顶部挂钩 */
.pet-scene-fence-item .frame-hook {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    border: 2px solid #8B6840;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: transparent;
}
.pet-scene-fence-item:hover { transform: rotate(-3deg) scale(1.08); }
.pet-scene-fence-item::after {
    content: attr(data-label);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--pet-transition);
}
.pet-scene-fence-item:hover::after { opacity: 1; }

/* Ground (grass) */
.pet-scene-ground {
    position: absolute;
    top: 42%; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 18% 30%, rgba(196, 230, 112, 0.34) 0 9%, transparent 21%),
        radial-gradient(circle at 76% 62%, rgba(83, 144, 55, 0.34) 0 10%, transparent 24%),
        linear-gradient(180deg,
            #A6CE63 0%, #91BE52 18%, #81AD49 38%, #72A044 62%, #638F3D 100%
        );
    z-index: 3;
}
/* Grass tufts at top edge */
.pet-scene-ground::before {
    content: '';
    position: absolute;
    top: -8px; left: 0; right: 0; height: 12px;
    background: repeating-linear-gradient(90deg,
        transparent 0, transparent 6px,
        #8FB855 6px, #8FB855 10px,
        transparent 10px, transparent 14px,
        #86AE4D 14px, #86AE4D 16px,
        transparent 16px, transparent 26px,
        #7DA446 26px, #7DA446 32px,
        transparent 32px, transparent 40px
    );
}
.pet-scene-ground::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(104deg,
            transparent 0, transparent 12px,
            rgba(221, 255, 145, 0.18) 12px, rgba(221, 255, 145, 0.18) 14px,
            transparent 14px, transparent 27px,
            rgba(43, 102, 40, 0.16) 27px, rgba(43, 102, 40, 0.16) 30px
        ),
        repeating-linear-gradient(78deg,
            transparent 0, transparent 18px,
            rgba(198, 235, 118, 0.12) 18px, rgba(198, 235, 118, 0.12) 22px,
            transparent 22px, transparent 35px
        );
    opacity: 0.75;
}
/* Sparkle / firefly particles */
.pet-scene-sparkle {
    position: absolute;
    width: 4px; height: 4px;
    background: #FFE87C;
    border-radius: 50%;
    z-index: 4;
    animation: sparkle-float 3s ease-in-out infinite;
    opacity: 0.6;
}
.pet-scene-sparkle:nth-child(2) { animation-delay: 0.8s; animation-duration: 3.5s; }
.pet-scene-sparkle:nth-child(3) { animation-delay: 1.6s; animation-duration: 4s; }
@keyframes sparkle-float {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(-12px); }
}

/* ── Flowers & plants decorations ── */
/* Bush (pixel-art shrub near fence) */
.pet-scene-bush {
    position: absolute;
    z-index: 3;
    image-rendering: pixelated;
}
.pet-scene-bush-body {
    width: 36px; height: 22px;
    background: #5a8b3c;
    border-radius: 6px 6px 2px 2px;
    position: relative;
    box-shadow:
        -6px 1px 0 #4a7a2c,
        6px 1px 0 #4a7a2c,
        0 -5px 0 #6b9e4a,
        -7px -1px 0 #4a7a2c,
        7px -1px 0 #4a7a2c,
        -3px -7px 0 #5e9540,
        3px -7px 0 #5e9540;
}
.pet-scene-bush-body::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 14px; height: 5px;
    background: #5a4a2c;
    border-radius: 0 0 2px 2px;
}
/* Small berry dots on bush */
.pet-scene-bush-berry {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    z-index: 1;
}
.pet-scene-bush-berry-1 { background: #E85D75; top: 4px; left: 10px; }
.pet-scene-bush-berry-2 { background: #F5C542; top: 8px; right: 8px; }
.pet-scene-bush-berry-3 { background: #E85D75; bottom: 6px; left: 20px; }
/* 灌木隐藏 — 参考图里没有小灌木，让大树主导画面 */
.pet-scene-bush { display: none; }

/* === 小白雏菊散落（cottagecore meadow）=== */
.pet-scene-daisy {
    position: absolute;
    width: 7px; height: 7px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
.pet-scene-daisy::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #f5c842;
    border-radius: 50%;
}
.pet-scene-daisy.is-sm { width: 5px; height: 5px; }
.pet-scene-daisy.is-sm::before { inset: 1.5px; }
.pet-scene-daisy.is-lg { width: 9px; height: 9px; }
.pet-scene-daisy.is-lg::before { inset: 2.5px; }
.pet-scene.is-night .pet-scene-daisy { opacity: 0.55; }
.pet-scene-bush-1 { left: 3%; bottom: 9%;  transform: scale(1.5); transform-origin: center bottom; z-index: 4; }
.pet-scene-bush-2 { right: 4%; bottom: 11%; transform: scale(1.35); transform-origin: center bottom; z-index: 4; }
.pet-scene-bush-3 {
    left: 50%; bottom: 7%;
    transform: translateX(-50%) scale(1.2);
    transform-origin: center bottom;
    z-index: 3;
    opacity: 0.9;
}
.pet-scene-bush-2 .pet-scene-bush-body {
    width: 28px; height: 18px;
    background: #4e8035;
    box-shadow:
        -5px 1px 0 #3f6e2a,
        5px 1px 0 #3f6e2a,
        0 -4px 0 #5e9540,
        -6px -1px 0 #3f6e2a,
        6px -1px 0 #3f6e2a,
        -2px -6px 0 #4e8a38,
        2px -6px 0 #4e8a38;
}
.pet-scene-bush-3 .pet-scene-bush-body {
    width: 32px; height: 20px;
    background: #5d9341;
    box-shadow:
        -6px 1px 0 #4d7c33,
        6px 1px 0 #4d7c33,
        0 -5px 0 #71a953,
        -7px -1px 0 #4d7c33,
        7px -1px 0 #4d7c33,
        -3px -7px 0 #649b48,
        3px -7px 0 #649b48;
}

/* Pixel flowers */
.pet-scene-flower {
    position: absolute;
    z-index: 4;
    image-rendering: pixelated;
}
.pet-scene-flower-stem {
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, #5a8b3c, #4a7a2c);
    margin: 0 auto;
}
.pet-scene-flower-head {
    width: 14px; height: 14px;
    position: relative;
    margin: 0 auto;
}
/* Tulip style */
.pet-flower-tulip .pet-scene-flower-head {
    background: #E85D75;
    border-radius: 3px 3px 7px 7px;
    box-shadow:
        -4px -3px 0 #D14D65,
        4px -3px 0 #D14D65,
        0 -5px 0 #F06B83,
        -2px -6px 0 #F06B83,
        2px -6px 0 #F06B83;
}
.pet-flower-tulip-yellow .pet-scene-flower-head {
    background: #F5C542;
    border-radius: 3px 3px 7px 7px;
    box-shadow:
        -4px -3px 0 #E0B030,
        4px -3px 0 #E0B030,
        0 -5px 0 #FFD95A,
        -2px -6px 0 #FFD95A,
        2px -6px 0 #FFD95A;
}
/* Daisy style */
.pet-flower-daisy .pet-scene-flower-head {
    background: #FFE87C;
    border-radius: 50%;
    width: 10px; height: 10px;
    box-shadow:
        0 -6px 0 #fff,
        6px 0 0 #fff,
        0 6px 0 #fff,
        -6px 0 0 #fff,
        4px -4px 0 #f0f0f0,
        -4px -4px 0 #f0f0f0,
        4px 4px 0 #f0f0f0,
        -4px 4px 0 #f0f0f0;
}
.pet-flower-daisy-blue .pet-scene-flower-head {
    background: #FFE87C;
    border-radius: 50%;
    width: 10px; height: 10px;
    box-shadow:
        0 -6px 0 #93C5FD,
        6px 0 0 #93C5FD,
        0 6px 0 #93C5FD,
        -6px 0 0 #93C5FD,
        4px -4px 0 #7DB8F0,
        -4px -4px 0 #7DB8F0,
        4px 4px 0 #7DB8F0,
        -4px 4px 0 #7DB8F0;
}
/* Small purple flower */
.pet-flower-violet .pet-scene-flower-head {
    background: #DDA0DD;
    border-radius: 50%;
    width: 9px; height: 9px;
    box-shadow:
        0 -5px 0 #C084CF,
        5px 0 0 #C084CF,
        0 5px 0 #C084CF,
        -5px 0 0 #C084CF;
}
.pet-flower-violet .pet-scene-flower-stem { height: 12px; }
/* Leaf accents on stems */
.pet-scene-flower-leaf {
    position: absolute;
    width: 7px; height: 4px;
    background: #6b9e4a;
    border-radius: 0 4px 4px 0;
}
.pet-scene-flower-leaf-l {
    left: -5px; top: 7px;
    border-radius: 4px 0 0 4px;
}
.pet-scene-flower-leaf-r {
    right: -5px; top: 10px;
}

/* Tall grass cluster decorations */
.pet-scene-tallgrass {
    position: absolute;
    z-index: 4;
    display: flex;
    gap: 2px;
    align-items: flex-end;
}
.pet-scene-tallgrass-blade {
    width: 3px;
    background: linear-gradient(180deg, #8FB855, #5a8b3c);
    border-radius: 1px 1px 0 0;
    image-rendering: pixelated;
}

/* Gentle sway animation for flowers */
@keyframes flower-sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(2deg); }
    75% { transform: rotate(-2deg); }
}
.pet-scene-flower {
    transform-origin: bottom center;
    animation: flower-sway 4s ease-in-out infinite;
}
.pet-scene-flower:nth-child(2n) { animation-delay: 1s; animation-duration: 4.5s; }
.pet-scene-flower:nth-child(3n) { animation-delay: 2s; animation-duration: 5s; }

/* ── Stepping stones ── */
.pet-scene-stones {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}
.pet-scene-stone {
    position: absolute;
    border: 1px solid rgba(0,0,0,0.18);
    image-rendering: pixelated;
    transform: scale(1.4);
    transform-origin: center bottom;
}
.pet-scene-stone::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(145deg, rgba(255,255,255,0.25), transparent 50%);
    border-radius: inherit;
}
/* Each stone — bigger, lighter for contrast against grass */
.pet-scene-stone-1 {
    width: 28px; height: 22px;
    border-radius: 12px 9px 14px 8px;
    background: linear-gradient(145deg, #DDD4C0, #C4B89C);
    box-shadow: inset 0 -2px 0 #A89880, 1px 2px 3px rgba(0,0,0,0.15);
}
.pet-scene-stone-2 {
    width: 24px; height: 20px;
    border-radius: 8px 13px 9px 12px;
    background: linear-gradient(145deg, #E0D8C4, #C8BCA0);
    box-shadow: inset 0 -2px 0 #A89880, 1px 2px 3px rgba(0,0,0,0.15);
}
.pet-scene-stone-3 {
    width: 30px; height: 21px;
    border-radius: 10px 14px 8px 13px;
    background: linear-gradient(145deg, #D6CCAE, #BEB298);
    box-shadow: inset 0 -2px 0 #A09078, 1px 2px 3px rgba(0,0,0,0.15);
}
.pet-scene-stone-4 {
    width: 26px; height: 19px;
    border-radius: 13px 8px 12px 9px;
    background: linear-gradient(145deg, #DDD4C0, #C4B89C);
    box-shadow: inset 0 -2px 0 #A89880, 1px 2px 3px rgba(0,0,0,0.15);
}
.pet-scene-stone-5 {
    width: 28px; height: 20px;
    border-radius: 9px 12px 13px 10px;
    background: linear-gradient(145deg, #E0D8C4, #C8BCA0);
    box-shadow: inset 0 -2px 0 #A89880, 1px 2px 3px rgba(0,0,0,0.15);
}
/* Shadow under each stone */
.pet-scene-stone::after {
    content: '';
    position: absolute;
    bottom: -3px; left: 8%; right: 8%;
    height: 4px;
    background: rgba(0,0,0,0.12);
    border-radius: 50%;
}

/* ── Butterflies ── */
.pet-scene-butterfly {
    position: absolute;
    z-index: 6;
    image-rendering: pixelated;
    pointer-events: none;
}
.pet-scene-butterfly-body {
    position: relative;
    width: 3px; height: 8px;
    background: #3D2B1F;
    border-radius: 1px;
    margin: 0 auto;
}
/* Antennae */
.pet-scene-butterfly-body::before {
    content: '';
    position: absolute;
    top: -4px; left: -2px;
    width: 7px; height: 4px;
    border-top: 1px solid #3D2B1F;
    border-left: 1px solid #3D2B1F;
    border-right: 1px solid #3D2B1F;
    border-radius: 3px 3px 0 0;
    background: transparent;
}
/* Wings container */
.pet-scene-butterfly-wings {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
}
.pet-scene-butterfly-wing {
    border-radius: 50% 50% 40% 40%;
}
.pet-scene-butterfly-wing-l {
    transform-origin: right center;
    animation: butterfly-flap-l 0.4s ease-in-out infinite;
}
.pet-scene-butterfly-wing-r {
    transform-origin: left center;
    animation: butterfly-flap-r 0.4s ease-in-out infinite;
}
@keyframes butterfly-flap-l {
    0%, 100% { transform: scaleX(1) rotateY(0); }
    50% { transform: scaleX(0.3) rotateY(50deg); }
}
@keyframes butterfly-flap-r {
    0%, 100% { transform: scaleX(1) rotateY(0); }
    50% { transform: scaleX(0.3) rotateY(-50deg); }
}
/* Orange butterfly */
.pet-butterfly-orange .pet-scene-butterfly-wing {
    width: 8px; height: 10px;
    background: radial-gradient(circle at 40% 40%, #FFB347, #E8852D);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15), inset 1px 1px 0 rgba(255,255,255,0.3);
}
.pet-butterfly-orange .pet-scene-butterfly-wing::after {
    content: '';
    position: absolute;
    top: 3px; left: 2px;
    width: 3px; height: 3px;
    background: rgba(0,0,0,0.15);
    border-radius: 50%;
}
/* Blue butterfly */
.pet-butterfly-blue .pet-scene-butterfly-wing {
    width: 7px; height: 9px;
    background: radial-gradient(circle at 40% 40%, #93C5FD, #5B9FE8);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), inset 1px 1px 0 rgba(255,255,255,0.35);
}
.pet-butterfly-blue .pet-scene-butterfly-wing::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 3px; height: 2px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}
/* Flight path animation */
.pet-butterfly-1 {
    animation: butterfly-path-1 12s ease-in-out infinite;
}
.pet-butterfly-2 {
    animation: butterfly-path-2 15s ease-in-out infinite;
}
@keyframes butterfly-path-1 {
    0%   { left: 18%; bottom: 38%; }
    15%  { left: 25%; bottom: 44%; }
    30%  { left: 35%; bottom: 36%; }
    45%  { left: 42%; bottom: 42%; }
    60%  { left: 34%; bottom: 48%; }
    75%  { left: 22%; bottom: 42%; }
    90%  { left: 15%; bottom: 36%; }
    100% { left: 18%; bottom: 38%; }
}
@keyframes butterfly-path-2 {
    0%   { right: 20%; bottom: 34%; }
    12%  { right: 28%; bottom: 40%; }
    25%  { right: 35%; bottom: 32%; }
    40%  { right: 25%; bottom: 28%; }
    55%  { right: 18%; bottom: 36%; }
    70%  { right: 24%; bottom: 44%; }
    85%  { right: 30%; bottom: 38%; }
    100% { right: 20%; bottom: 34%; }
}

/* ── 昼夜光影 · 按本地时间切换 ── */
.pet-scene-moon {
    position: absolute;
    top: 8%; right: 12%;
    width: 28px; height: 28px;
    background: #F5F3E7;
    border-radius: 50%;
    box-shadow:
        -6px 2px 0 0 #0c1b3a,
        0 0 18px 4px rgba(245,243,231,0.35);
    z-index: 1;
    display: none;
}
.pet-scene-stars {
    position: absolute;
    inset: 0;
    bottom: 56%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
}
.pet-scene-stars::before,
.pet-scene-stars::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 22%, #fff 99%, transparent),
        radial-gradient(1px 1px at 28% 10%, #fff 99%, transparent),
        radial-gradient(1px 1px at 45% 30%, #fff 99%, transparent),
        radial-gradient(1px 1px at 62% 14%, #fff 99%, transparent),
        radial-gradient(1px 1px at 78% 25%, #fff 99%, transparent),
        radial-gradient(1px 1px at 88% 8%, #fff 99%, transparent),
        radial-gradient(1px 1px at 20% 38%, #fff 99%, transparent),
        radial-gradient(1px 1px at 55% 45%, #fff 99%, transparent);
    animation: star-twinkle 4s ease-in-out infinite;
}
.pet-scene-stars::after {
    animation-delay: 2s;
    opacity: 0.6;
}
@keyframes star-twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 光照遮罩：盖在整个场景上，按时段叠色 */
.pet-scene-tint {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 8;
    opacity: 0;
    transition: opacity 1.2s ease, background 1.2s ease;
    mix-blend-mode: multiply;
}

/* morning */
.pet-scene.is-morning .pet-scene-sky {
    background: linear-gradient(180deg,
        #FFD89E 0%, #FFD89E 15%,
        #FFC98A 15%, #FFC98A 30%,
        #FFDDB3 30%, #FFDDB3 45%,
        #FFE8CC 45%, #FFE8CC 65%,
        #FFD8B0 65%, #FFD8B0 80%,
        #F5B888 80%
    );
}
.pet-scene.is-morning .pet-scene-sun {
    top: 14%; right: 70%;
    background: #FFE48A;
    box-shadow: 0 0 24px 10px rgba(255,210,120,0.55);
}
.pet-scene.is-morning .pet-scene-tint {
    opacity: 0.18;
    background: rgba(255, 180, 120, 1);
}

/* dusk */
.pet-scene.is-dusk .pet-scene-sky {
    background: linear-gradient(180deg,
        #6B4F8A 0%, #6B4F8A 15%,
        #9B5B8E 15%, #9B5B8E 30%,
        #D67B7B 30%, #D67B7B 45%,
        #E89C6F 45%, #E89C6F 65%,
        #E8B070 65%, #E8B070 80%,
        #D6956A 80%
    );
}
.pet-scene.is-dusk .pet-scene-sun {
    top: 26%; right: 8%;
    background: #FF9966;
    box-shadow: 0 0 30px 14px rgba(255,120,80,0.5);
}
.pet-scene.is-dusk .pet-scene-tint {
    opacity: 0.22;
    background: rgba(180, 100, 140, 1);
}

/* night */
.pet-scene.is-night .pet-scene-sky {
    background: linear-gradient(180deg,
        #0B1A3A 0%, #0B1A3A 30%,
        #142952 30%, #142952 55%,
        #1D3366 55%, #1D3366 80%,
        #2B4580 80%
    );
}
.pet-scene.is-night .pet-scene-sun { display: none; }
.pet-scene.is-night .pet-scene-moon { display: block; }
.pet-scene.is-night .pet-scene-stars { opacity: 0.9; }
.pet-scene.is-night .pet-scene-cloud { opacity: 0.35; }
.pet-scene.is-night .pet-scene-tint {
    opacity: 0.4;
    background: rgba(20, 30, 70, 1);
}
.pet-scene.is-night .pet-scene-ground {
    filter: brightness(0.82) saturate(1.12);
}
.pet-scene.is-night .pet-scene-fence,
.pet-scene.is-night .pet-scene-bush,
.pet-scene.is-night .pet-scene-flower,
.pet-scene.is-night .pet-scene-tallgrass,
.pet-scene.is-night .pet-scene-stones {
    filter: brightness(0.7) saturate(0.85);
}
/* 夜里萤火虫更醒目 */
.pet-scene.is-night .pet-scene-sparkle {
    background: #C8F57F;
    box-shadow: 0 0 6px 2px rgba(200, 245, 127, 0.7);
    opacity: 0.9;
    width: 5px; height: 5px;
}

/* ── 时段小生物 ── */
/* 蝴蝶：仅白天/早晨/黄昏可见 */
.pet-scene-butterfly { opacity: 0; transition: opacity 0.8s ease; }
.pet-scene.is-day .pet-scene-butterfly,
.pet-scene.is-dusk .pet-scene-butterfly { opacity: 1; }
.pet-scene.is-morning .pet-scene-butterfly { opacity: 0.6; }

/* 沙漏型萤火虫仅夜晚 */
.pet-scene.is-morning .pet-scene-sparkle,
.pet-scene.is-day .pet-scene-sparkle,
.pet-scene.is-dusk .pet-scene-sparkle { opacity: 0; }

/* 麻雀：清晨 + 黄昏出现 */
.pet-scene-bird {
    position: absolute;
    z-index: 3;
    width: 14px; height: 10px;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}
.pet-scene-bird-body {
    position: absolute;
    width: 10px; height: 7px;
    left: 2px; top: 2px;
    background: #6B4A2A;
    border-radius: 50% 40% 40% 50%;
    box-shadow: 2px 1px 0 #4A3418;
}
.pet-scene-bird-head {
    position: absolute;
    width: 5px; height: 5px;
    left: 8px; top: 0;
    background: #7A5632;
    border-radius: 50%;
}
.pet-scene-bird-beak {
    position: absolute;
    width: 3px; height: 2px;
    left: 12px; top: 2px;
    background: #E8B440;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.pet-scene-bird-eye {
    position: absolute;
    left: 10px; top: 1px;
    width: 1px; height: 1px;
    background: #111;
}
.pet-scene-bird-1 { top: 22%; left: 14%; animation: bird-hop 2.2s ease-in-out infinite; }
.pet-scene-bird-2 { top: 24%; right: 24%; transform: scaleX(-1); animation: bird-hop 2.6s ease-in-out infinite 0.6s; }
@keyframes bird-hop {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    45% { transform: translateY(-6px); }
    50% { transform: translateY(-4px); }
}
.pet-scene-bird-2 {
    /* 覆盖翻转 + 动画 */
    animation: bird-hop-flip 2.6s ease-in-out infinite 0.6s;
}
@keyframes bird-hop-flip {
    0%, 80%, 100% { transform: scaleX(-1) translateY(0); }
    40% { transform: scaleX(-1) translateY(-4px); }
    45% { transform: scaleX(-1) translateY(-6px); }
    50% { transform: scaleX(-1) translateY(-4px); }
}
.pet-scene.is-morning .pet-scene-bird,
.pet-scene.is-dusk .pet-scene-bird { opacity: 1; }

/* ── 天气效果 ── */
/* cloudy：加一层云雾遮罩，sun 变淡 */
.pet-scene.is-cloudy .pet-scene-sun { opacity: 0.5; filter: blur(2px); }
.pet-scene.is-cloudy .pet-scene-cloud {
    opacity: 1;
    filter: brightness(0.9);
}
.pet-scene.is-cloudy .pet-scene-tint {
    opacity: 0.22;
    background: rgba(120, 130, 150, 1);
}
/* rain：雨滴 + 阴暗 */
.pet-scene.is-rain .pet-scene-sun { opacity: 0.25; filter: blur(3px); }
.pet-scene.is-rain .pet-scene-cloud {
    opacity: 1;
    filter: brightness(0.72);
}
.pet-scene.is-rain .pet-scene-tint {
    opacity: 0.35;
    background: rgba(70, 90, 120, 1);
}
.pet-scene.is-rain .pet-scene-butterfly { opacity: 0 !important; }
.pet-scene-rain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    opacity: 0;
    transition: opacity 0.6s ease;
    overflow: hidden;
}
.pet-scene.is-rain .pet-scene-rain { opacity: 1; }
.pet-scene-raindrop {
    position: absolute;
    width: 1.5px;
    height: 10px;
    background: linear-gradient(180deg, rgba(200,220,255,0) 0%, rgba(200,220,255,0.85) 100%);
    top: -12px;
    animation: raindrop-fall linear infinite;
}
@keyframes raindrop-fall {
    0%   { transform: translateY(0); }
    100% { transform: translateY(600px); }
}

/* ── 状态栏：时段 + 天气徽章 ── */
.pet-ambient-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 4px;
}
.pet-ambient-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: 2px solid var(--pet-border);
    border-radius: var(--pet-radius-xs);
    background: rgba(255, 248, 235, 0.7);
    color: var(--pet-text);
    font: 600 12px/1 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    user-select: none;
}
.pet-ambient-icon { font-size: 14px; line-height: 1; }

/* ── 拖动猫时的提示与抖动 ── */
.pet-cat-drag-hint {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font: 600 12px/1.3 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    padding: 6px 12px;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 12;
}
.pet-cat-drag-hint.is-visible { opacity: 1; }
#petownCatCanvas.is-dragging {
    cursor: grabbing;
    filter: drop-shadow(0 4px 0 rgba(45, 35, 25, 0.24)) brightness(1.05);
}
@keyframes cat-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-3px); }
    30% { transform: translateX(3px); }
    45% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    80% { transform: translateX(-1px); }
}
#petownCatCanvas.is-shake {
    animation: cat-shake 0.6s ease-out;
}

/* ── Ground items (furniture) ── */
.pet-scene-item {
    position: absolute;
    z-index: 5;
    cursor: pointer;
    transition: transform var(--pet-transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.pet-scene-item:hover { transform: scale(1.1) translateY(-2px); }
.pet-scene-item-sprite {
    image-rendering: pixelated;
}
.pet-scene-item-name {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--pet-transition);
}
.pet-scene-item:hover .pet-scene-item-name { opacity: 1; }

/* ── 心情气泡（v1）：跟随猫头顶绝对定位 ── */
.pet-mood-bubble {
    position: absolute;
    width: 44px;
    height: 44px;
    pointer-events: none;
    z-index: 6;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(15, 23, 42, 0.18);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 100%;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.18s ease;
}
.pet-mood-bubble.is-visible {
    transform: scale(1);
    opacity: 1;
}
/* 气泡尾巴（小三角朝下） */
.pet-mood-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    width: 0;
    height: 0;
    margin-left: -5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 1px 0 rgba(15, 23, 42, 0.15));
}
.pet-mood-bubble canvas {
    image-rendering: pixelated;
    width: 40px;
    height: 40px;
}

/* Pixel-art sprites for default items — 使用图片替代 CSS 精灵 */
.pet-sprite-box,
.pet-sprite-bowl {
    width: 56px; height: 56px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: pixelated;
}
.pet-sprite-box {
    background-image: url('/static/img/petown/item_box.png');
}
/* 商店家具真图（cat_tree / hide_house / ceramic_bowl 等），按物件类型做场景比例校准 */
.pet-sprite-custom {
    width: 96px; height: 96px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: auto;
}
.pet-scene.uses-art-bg .pet-sprite-box,
.pet-scene.uses-art-bg .pet-sprite-bowl {
    width: clamp(72px, 4.8vw, 96px);
    height: clamp(72px, 4.8vw, 96px);
}
.pet-scene.uses-art-bg .pet-sprite-custom {
    width: clamp(96px, 5.6vw, 122px);
    height: clamp(96px, 5.6vw, 122px);
}
.pet-scene.uses-art-bg .pet-sprite-item-cat_tree,
.pet-scene.uses-art-bg .pet-sprite-item-cat_tree_deluxe,
.pet-scene.uses-art-bg .pet-sprite-item-hide_house {
    width: clamp(150px, 8vw, 176px);
    height: clamp(150px, 8vw, 176px);
}
.pet-scene.uses-art-bg .pet-sprite-item-water_fountain,
.pet-scene.uses-art-bg .pet-sprite-item-ceramic_bowl,
.pet-scene.uses-art-bg .pet-sprite-item-gold_bowl {
    width: clamp(104px, 6vw, 132px);
    height: clamp(104px, 6vw, 132px);
}
@media (max-width: 768px) {
    .pet-scene.uses-art-bg .pet-sprite-box,
    .pet-scene.uses-art-bg .pet-sprite-bowl {
        width: 72px;
        height: 72px;
    }
    .pet-scene.uses-art-bg .pet-sprite-custom {
        width: 88px;
        height: 88px;
    }
    .pet-scene.uses-art-bg .pet-sprite-item-cat_tree,
    .pet-scene.uses-art-bg .pet-sprite-item-cat_tree_deluxe,
    .pet-scene.uses-art-bg .pet-sprite-item-hide_house {
        width: 108px;
        height: 108px;
    }
}
.pet-sprite-bowl {
    background-image: url('/static/img/petown/item_bowl.png');
}
.pet-sprite-yarn {
    width: 36px; height: 36px;
    background: radial-gradient(circle at 40% 40%, #F87171, #DC2626);
    border-radius: 50%;
    border: 2px solid #B91C1C;
    position: relative;
}
.pet-sprite-yarn::before {
    content: '';
    position: absolute;
    top: 8px; left: 6px;
    width: 14px; height: 6px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    border-bottom: none;
}
.pet-sprite-blanket {
    width: 52px; height: 18px;
    background: repeating-linear-gradient(90deg,
        #FDA4AF 0, #FDA4AF 8px,
        #FDE68A 8px, #FDE68A 16px,
        #93C5FD 16px, #93C5FD 24px
    );
    border: 2px solid #D97706;
    border-radius: 2px;
    transform: rotate(-5deg);
}
.pet-sprite-generic {
    width: 40px; height: 32px;
    background: linear-gradient(135deg, #FED7AA, #FDBA74);
    border: 3px solid var(--pet-border-strong);
    border-radius: 2px;
    display: grid;
    place-items: center;
    font-size: 16px;
}

/* ── Cat pixel sprite canvas ── */
#petownCatCanvas {
    position: absolute;
    top: 42%;
    left: 0;
    width: 100%;
    height: 58%;
    z-index: 6;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    pointer-events: none;
    /* 阴影由 Canvas 在精灵局部绘制，避免整张全屏画布触发 GPU filter 重绘。 */
}

/* ── Expedition away sign ── */
.pet-scene-away-sign {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 18%;
    transform: translateX(-50%);
    z-index: 7;
    text-align: center;
}
.pet-scene-away-sign.visible { display: block; }
.pet-scene-away-sign-pole {
    width: 6px;
    height: 40px;
    background: linear-gradient(180deg, #A0845C, #8B7355);
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 1px 0 0 rgba(0,0,0,0.1);
}
.pet-scene-away-sign-board {
    background: linear-gradient(135deg, #DEB887, #D2A76A);
    border: 3px solid #A0845C;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #5D4037;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
}
.pet-scene-away-sign-board::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1px dashed rgba(139,115,85,0.3);
    border-radius: 5px;
    pointer-events: none;
}
.pet-scene-away-sign-nails {
    position: absolute;
    top: -2px; left: 8px; right: 8px;
    display: flex;
    justify-content: space-between;
}
.pet-scene-away-sign-nail {
    width: 6px; height: 6px;
    background: radial-gradient(circle, #C0C0C0, #808080);
    border-radius: 50%;
    box-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* ── Profile avatar (sidebar) ── */
.pet-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
/* 可点击的宠物头像条：整行变为进入「宠物详情」的入口 */
.pet-profile-header--clickable {
    width: 100%;
    padding: 8px;
    margin: -8px -8px 6px -8px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--pet-radius-sm, 14px);
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.pet-profile-header--clickable:hover {
    background: var(--pet-surface-hover);
    border-color: var(--pet-border);
}
.pet-profile-header--clickable:active { transform: scale(0.98); }
.pet-profile-header--clickable:focus-visible {
    outline: none;
    border-color: var(--pet-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}
.pet-profile-header--clickable .pet-badges { margin-bottom: 0; }
.pet-profile-chevron {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--pet-text-muted);
    border-radius: 50%;
    flex-shrink: 0;
    transition: color .18s ease, transform .18s ease, background .18s ease;
}
.pet-profile-header--clickable:hover .pet-profile-chevron {
    color: var(--pet-primary);
    background: rgba(249, 115, 22, 0.08);
    transform: translateX(2px);
}

/* 领养表单：性别选择卡片（与 .pet-tile 选中状态语言一致） */
.pet-gender-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.pet-gender-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    border: 2.5px solid var(--pet-border);
    border-radius: var(--pet-radius-sm, 14px);
    background: var(--pet-surface);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
    user-select: none;
}
.pet-gender-tile:hover { background: var(--pet-surface-hover); }
.pet-gender-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pet-gender-tile .pet-gender-symbol {
    font-size: 26px;
    line-height: 1;
    font-weight: 700;
}
.pet-gender-tile .pet-gender-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pet-text-secondary);
}
.pet-gender-tile--male .pet-gender-symbol { color: #3b82f6; }
.pet-gender-tile--female .pet-gender-symbol { color: #ec4899; }
.pet-gender-tile:has(input:checked) {
    border-color: var(--pet-primary);
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.15);
}

/* 宠物详情弹窗 —— 档案本风格 */
.pet-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 2px;
}

/* Hero：品种肖像 + 图鉴简介 */
.pet-detail-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 20px 22px;
    border-radius: var(--pet-radius-md, 18px);
    background:
        radial-gradient(circle at 50% 0%, #FFEDD5 0%, #FFF7ED 55%, #FFF7ED 100%);
    border: 2px solid var(--pet-border);
    text-align: center;
    overflow: hidden;
}
/* 背景：散落的小脚印图案，营造宠物空间感 */
.pet-detail-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(253, 186, 116, 0.28) 3px, transparent 4px),
        radial-gradient(circle at 82% 18%, rgba(253, 186, 116, 0.22) 2px, transparent 3px),
        radial-gradient(circle at 88% 72%, rgba(253, 186, 116, 0.28) 3px, transparent 4px),
        radial-gradient(circle at 10% 82%, rgba(253, 186, 116, 0.22) 2px, transparent 3px),
        radial-gradient(circle at 50% 92%, rgba(253, 186, 116, 0.18) 2px, transparent 3px);
}
.pet-detail-hero-avatar {
    position: relative;
    width: 112px;
    height: 112px;
    border-width: 4px;
    box-shadow: 0 10px 24px -10px rgba(234, 88, 12, 0.45);
    animation: pet-detail-breath 3.8s ease-in-out infinite;
}
@keyframes pet-detail-breath {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.pet-detail-name {
    position: relative;
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--pet-text);
    letter-spacing: 1px;
}
.pet-detail-flavor {
    position: relative;
    margin: 0;
    max-width: 92%;
    font-size: 13px;
    line-height: 1.7;
    color: var(--pet-text-muted);
    font-style: italic;
}
.pet-detail-chips {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.pet-detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--pet-border);
    background: var(--pet-surface);
    color: var(--pet-text-secondary);
}
.pet-detail-chip--male { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; }
.pet-detail-chip--female { color: #9d174d; border-color: #fbcfe8; background: #fdf2f8; }
.pet-detail-chip--level {
    color: var(--pet-primary-dark);
    border-color: var(--pet-border-strong);
    background: #FFEDD5;
}

/* 情感化状态卡 */
.pet-detail-mood {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--pet-radius-sm, 14px);
    background: linear-gradient(135deg, #FFFBF2 0%, #FFF3E0 100%);
    border: 2px solid var(--pet-border);
}
.pet-detail-mood-emoji {
    font-size: 34px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(234, 88, 12, 0.18));
}
.pet-detail-mood-body { flex: 1; min-width: 0; }
.pet-detail-mood-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--pet-text);
    margin-bottom: 2px;
}
.pet-detail-mood-sub {
    font-size: 12px;
    color: var(--pet-text-muted);
    line-height: 1.5;
}

/* 陪伴进度卡 */
.pet-detail-companion {
    padding: 16px;
    border-radius: var(--pet-radius-sm, 14px);
    background:
        linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(249, 115, 22, 0.02)),
        var(--pet-surface);
    border: 2px solid var(--pet-border-strong);
}
.pet-detail-companion-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.pet-detail-companion-eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--pet-text-muted);
    font-weight: 600;
}
.pet-detail-companion-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--pet-primary-dark);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pet-detail-companion-number em {
    font-size: 14px;
    font-style: normal;
    margin-left: 4px;
    color: var(--pet-text-muted);
    font-weight: 600;
}
.pet-detail-companion-track {
    height: 8px;
    border-radius: 999px;
    background: #FEF0E0;
    overflow: hidden;
    margin-bottom: 6px;
}
.pet-detail-companion-track > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--pet-primary-light), var(--pet-primary));
    border-radius: 999px;
    transition: width .6s ease;
}
.pet-detail-companion-next {
    font-size: 12px;
    color: var(--pet-text-muted);
    font-weight: 500;
}

/* 状态条（饱食/心情/经验） */
.pet-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: var(--pet-radius-sm, 14px);
    background: var(--pet-surface);
    border: 2px solid var(--pet-border);
}
.pet-detail-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pet-detail-stat-emoji {
    font-size: 22px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}
.pet-detail-stat-body { flex: 1; min-width: 0; }
.pet-detail-stat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}
.pet-detail-stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pet-text-secondary);
}
.pet-detail-stat-value {
    font-size: 12px;
    color: var(--pet-text-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.pet-detail-stat-track {
    height: 8px;
    border-radius: 999px;
    background: #FEF0E0;
    overflow: hidden;
}
.pet-detail-stat-track > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width .6s ease;
}
.pet-detail-stat--hunger .pet-detail-stat-track > span { background: linear-gradient(90deg, #fbbf24, #f97316); }
.pet-detail-stat--mood .pet-detail-stat-track > span { background: linear-gradient(90deg, #f472b6, #ec4899); }
.pet-detail-stat--xp .pet-detail-stat-track > span { background: linear-gradient(90deg, #a78bfa, #8b5cf6); }

/* 小节标题 */
.pet-detail-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--pet-text-muted);
    letter-spacing: 2px;
    padding: 0 4px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.pet-detail-section-title::before,
.pet-detail-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--pet-border);
}

/* 资料网格 */
.pet-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pet-detail-item {
    padding: 12px 14px;
    border: 2px solid var(--pet-border);
    border-radius: var(--pet-radius-sm, 14px);
    background: var(--pet-surface);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .2s ease, transform .2s ease;
}
.pet-detail-item:hover {
    border-color: var(--pet-border-strong);
    transform: translateY(-1px);
}
.pet-detail-item-label {
    font-size: 12px;
    color: var(--pet-text-muted);
    font-weight: 600;
}
.pet-detail-item-value {
    font-size: 15px;
    color: var(--pet-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .pet-detail-hero-avatar { animation: none; }
    .pet-detail-companion-track > span,
    .pet-detail-stat-track > span,
    .pet-detail-item { transition: none; }
}
.pet-profile-avatar {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border: 3px solid var(--pet-border-strong);
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    box-shadow: var(--pet-shadow-sm);
}
.pet-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 与场景内 Canvas 精灵一致：侧栏优先展示品种 sprite_url 时用硬边缘像素缩放 */
.pet-profile-avatar img.pet-avatar-pixel {
    object-fit: contain;
    object-position: center bottom;
    padding: 4px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.pet-profile-avatar-empty {
    display: grid;
    place-items: center;
    font-size: 36px;
}

/* Status section */
.pet-status {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.pet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.pet-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 2px solid var(--pet-border);
    border-radius: var(--pet-radius-xs);
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    font-size: 13px;
    font-weight: 600;
    color: var(--pet-text-secondary);
}
.pet-badge svg { width: 14px; height: 14px; opacity: 0.7; }

/* Stat bars */
.pet-bars {
    display: grid;
    gap: 16px;
}
.pet-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}
.pet-bar-row span:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pet-text-secondary);
}
.pet-bar-row span:last-child {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--pet-text);
}
.pet-bar {
    height: 18px;
    background: #F5E6D3;
    border: 2.5px solid var(--pet-border);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(154,52,18,0.06);
}
.pet-bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 400ms ease-out;
    position: relative;
    overflow: hidden;
}
/* 数值变化由进度条本身的 steps 动画表达，不常驻跑高光动画。 */
.pet-bar-fill::after {
    content: none;
    display: none;
}
.pet-bar-fill.hunger {
    background: linear-gradient(90deg, #FFB84D, #F97316);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.pet-bar-fill.mood {
    background: linear-gradient(90deg, #7FD86F, #3c7a6b);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.pet-bar-fill.xp {
    background: linear-gradient(90deg, #60A5FA, #3B82F6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

/* Action buttons (legacy fallback for overlay usage) */
.pet-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.pet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--btn-min-height);
    padding: 8px 16px;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: #FFFCF5;
    color: var(--btn-border);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
.pet-btn:active:not(:disabled):not(.pet-btn--pending) {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-btn:focus-visible {
    outline: none;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}
.pet-btn:disabled,
.pet-btn.pet-btn--pending {
    opacity: 0.5;
    cursor: not-allowed;
}
/* 异步请求中：防重复点 + 中心转圈 */
.pet-btn.pet-btn--pending {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}
.pet-btn.pet-btn--pending svg {
    opacity: 0;
}
.pet-btn.pet-btn--pending::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(74, 47, 26, 0.2);
    border-top-color: #4A2F1A;
    border-radius: 50%;
    animation: pet-btn-spin 0.7s linear infinite;
}
@keyframes pet-btn-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .pet-btn, .pet-back, .pet-icon-btn, .pet-close, .pet-scene-pill {
        transition-duration: 0.01ms !important;
    }
    .pet-btn.pet-btn--pending::after {
        animation: none;
        border-color: rgba(74, 47, 26, 0.35);
        border-top-color: #4A2F1A;
    }
}
.pet-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.pet-btn.primary { background: var(--p-accent); }
.pet-btn.secondary { background: var(--p-paper); }
.pet-btn.warn { background: var(--p-warm); color: var(--p-ink); }
.pet-btn.danger { background: var(--p-warn); color: var(--p-paper); }

/* 底栏主操作：接近 App 44pt 触控目标 */
.pet-action-bar .pet-btn {
    min-height: 48px;
    padding: 12px 10px;
}
@media (max-width: 768px) {
    .pet-action-bar .pet-btn {
        font-size: 13px;
        padding: 12px 6px;
        gap: 4px;
    }
    .pet-action-bar .pet-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ── Action bar: shop buttons wood-tone ── */
.pet-action-bar .pet-btn#petownFurnitureBtn,
.pet-action-bar .pet-btn#petownCostumeBtn {
    background: linear-gradient(145deg, #F5DEB3, #DEB887);
    border-color: var(--btn-border);
    color: #5B3A1A;
}
@media (hover: hover) and (pointer: fine) {
    .pet-action-bar .pet-btn#petownFurnitureBtn:hover:not(:disabled):not(.pet-btn--pending),
    .pet-action-bar .pet-btn#petownCostumeBtn:hover:not(:disabled):not(.pet-btn--pending) {
        background: linear-gradient(145deg, #FAE8C8, #E8C99B);
    }
}
/* Friends button: blue tint */
.pet-action-bar .pet-btn#petownDiaryBtn {
    position: relative;
    background: linear-gradient(145deg, #FEF3C7, #FDE68A);
    border-color: var(--btn-border);
    color: #78350F;
}
@media (hover: hover) and (pointer: fine) {
    .pet-action-bar .pet-btn#petownDiaryBtn:hover:not(:disabled):not(.pet-btn--pending) {
        background: linear-gradient(145deg, #FFFBEB, #FEF3C7);
    }
}
.pet-diary-dot {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #EF4444;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.45);
    display: none;
}
.pet-diary-dot.is-visible { display: block; }

/* ── P0 companionship brief inside status rail ── */
.pet-status-brief {
    margin-bottom: 14px;
}
.pet-brief-main {
    display: grid;
    gap: 10px;
    border: 2px solid rgba(254, 215, 170, 0.75);
    border-radius: var(--pet-radius-sm);
    background: rgba(255, 255, 255, 0.52);
    padding: 14px;
    min-width: 0;
}
.pet-brief-status {
    margin: 0;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pet-text);
}
.pet-brief-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--pet-text-muted);
}
.pet-brief-action {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}
.pet-cat-touch-bubble {
    position: absolute;
    left: 50%;
    top: 42%;
    z-index: 15;
    transform: translate(-50%, -50%) scale(0.88);
    pointer-events: none;
    opacity: 0;
    padding: 8px 12px;
    border: 2px solid rgba(251, 146, 60, 0.72);
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.94);
    color: var(--pet-primary-dark);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 5px 18px rgba(154, 52, 18, 0.16);
    transition: opacity 160ms ease, transform 180ms var(--pet-ease-spring);
}
.pet-cat-touch-bubble.is-visible {
    opacity: 1;
    transform: translate(-50%, -68%) scale(1);
}
.pet-care-row.is-done {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(236, 253, 245, 0.56);
}
.pet-care-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.pet-care-check {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 9px;
    border: 2px solid rgba(217, 119, 6, 0.4);
    color: #d97706;
    background: rgba(255, 247, 237, 0.78);
}
.pet-care-row.is-done .pet-care-check {
    border-color: rgba(22, 163, 74, 0.36);
    color: #16a34a;
    background: rgba(220, 252, 231, 0.84);
}
.pet-care-row .pet-btn {
    padding: 8px 12px;
    min-height: var(--btn-min-height);
    min-width: 72px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 顶栏右上角好友图标按钮 */
.pet-icon-btn--friends-top {
    padding: 6px 10px !important;
}

/* ── 猫咪日记卡片（共享 .pet-sheet 容器） ── */
.pet-diary-card {
    position: relative;
    padding: 14px 16px 16px;
    border-radius: 16px;
    background: #FFFCF5;
    border: 2px solid #FCE7B1;
    box-shadow:
        0 2px 0 rgba(154, 52, 18, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background-image:
        repeating-linear-gradient(
            transparent 0,
            transparent 30px,
            rgba(251, 191, 36, 0.12) 30px,
            rgba(251, 191, 36, 0.12) 31px
        );
}
.pet-diary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pet-diary-card-date {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--pet-primary-dark);
    letter-spacing: 0.02em;
}
.pet-diary-card-paw { font-size: 15px; opacity: 0.7; }
.pet-diary-card-body {
    margin: 0;
    /* 日记正文：手写中文 + 像素英数 */
    font-family: 'LXGW WenKai', 'Pixelify Sans', 'PingFang SC', serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.85;
    color: var(--p-ink);
    white-space: pre-wrap;
    word-wrap: break-word;
}
/* ── Panel sections ── */
.pet-panel {
    padding: 20px;
}
.pet-panel h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--pet-primary-dark);
}
.pet-panel h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--pet-primary), var(--pet-primary-dark));
    flex-shrink: 0;
}
.pet-list {
    display: grid;
    gap: 10px;
}
.pet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 2px solid rgba(254, 215, 170, 0.6);
    border-radius: var(--pet-radius-xs);
    background: rgba(255, 255, 255, 0.5);
    transition: background var(--pet-transition), border-color var(--pet-transition);
    position: relative;
}
.pet-row:hover { background: rgba(255, 255, 255, 0.75); border-color: rgba(254, 215, 170, 0.9); }
.pet-row h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--pet-text-secondary);
}
.pet-row p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--pet-text-muted);
    line-height: 1.45;
}
.pet-row-meta {
    font-size: 11px;
    font-weight: 700;
    color: var(--pet-text-muted);
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 3px 10px;
    background: rgba(255,237,213,0.6);
    border-radius: 8px;
    border: 1.5px solid rgba(254,215,170,0.5);
}
/* ── Log row with type icon ── */
.pet-log-row {
    padding-left: 12px;
}
.pet-log-row-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.pet-log-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 16px;
    border: 2px solid var(--pet-border);
    background: linear-gradient(145deg, #FFF7ED, #FFEDD5);
}
.pet-log-icon.kind-feed { border-color: #FDBA74; background: linear-gradient(145deg, #FFF7ED, #FED7AA); }
.pet-log-icon.kind-play { border-color: #6EE7B7; background: linear-gradient(145deg, #ECFDF5, #D1FAE5); }
.pet-log-icon.kind-expedition { border-color: #FDE68A; background: linear-gradient(145deg, #FFFBEB, #FEF3C7); }
.pet-log-icon.kind-encounter { border-color: #C4B5FD; background: linear-gradient(145deg, #F5F3FF, #EDE9FE); }
.pet-log-icon.kind-system { border-color: #93C5FD; background: linear-gradient(145deg, #EFF6FF, #DBEAFE); }
.pet-log-icon.kind-buy { border-color: #FDBA74; background: linear-gradient(145deg, #FFFBEB, #FEF3C7); }
.pet-log-icon.kind-equip { border-color: #A78BFA; background: linear-gradient(145deg, #F5F3FF, #EDE9FE); }
.pet-log-text { min-width: 0; flex: 1; }
.pet-gold-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    border: 1.5px solid #f59e0b;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}
.pet-empty {
    padding: 18px;
    border: 2px dashed var(--pet-border);
    border-radius: var(--pet-radius-xs);
    color: var(--pet-text-muted);
    font-size: 14px;
    text-align: center;
}

/* ── 好友弹层 ── */
.pet-friend-no-profile {
    font-size: 12px;
    font-weight: 600;
    color: var(--pet-text-muted);
    padding: 8px 0;
}
.pet-friend-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pet-friend-card {
    position: relative;
    display: flex;
    border-radius: var(--pet-radius-sm);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 250, 240, 0.88) 100%);
    border: 3px solid rgba(253, 186, 116, 0.85);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 6px rgba(249, 115, 22, 0.05),
        0 4px 0 rgba(154, 52, 18, 0.1),
        0 8px 20px rgba(154, 52, 18, 0.06);
    transition: transform var(--pet-transition), box-shadow var(--pet-transition), border-color var(--pet-transition);
}
@media (prefers-reduced-motion: reduce) {
    .pet-friend-card { transition: none; }
}
@media (hover: hover) and (pointer: fine) {
    .pet-friend-card:hover {
        transform: translateY(-2px);
        border-color: var(--pet-primary-light);
        box-shadow:
            inset 0 2px 0 rgba(255, 255, 255, 0.95),
            inset 0 -2px 6px rgba(249, 115, 22, 0.08),
            0 5px 0 rgba(154, 52, 18, 0.12),
            0 12px 28px rgba(154, 52, 18, 0.1);
    }
}
.pet-friend-card-accent {
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 5px;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(180deg, var(--pet-primary-light), var(--pet-primary));
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.06);
}
.pet-friend-card-inner {
    flex: 1;
    min-width: 0;
    padding: 14px 14px 14px 18px;
    margin-left: 5px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pet-friend-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.pet-friend-avatar-frame {
    flex-shrink: 0;
    width: 56px !important;
    height: 56px !important;
    border: 3px solid var(--pet-border-strong) !important;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.75),
        0 3px 0 rgba(154, 52, 18, 0.12) !important;
}
.pet-friend-avatar-frame .lp-avatar-fallback {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
}
.pet-friend-avatar-frame img {
    border-radius: 50%;
    object-fit: cover;
}
.pet-friend-main {
    min-width: 0;
    flex: 1;
}
.pet-friend-main h3 {
    margin: 0 0 8px;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--pet-text);
    line-height: 1.25;
}
.pet-friend-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.pet-friend-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    border: 2px solid rgba(253, 186, 116, 0.85);
    background: rgba(255, 255, 255, 0.85);
    color: var(--pet-text-secondary);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.pet-friend-chip--name {
    border-color: rgba(249, 115, 22, 0.45);
    background: linear-gradient(145deg, #FFF7ED, #FFEDD5);
    color: var(--pet-primary-dark);
    font-size: 13px;
}
.pet-friend-chip--lv {
    background: linear-gradient(135deg, #FDE68A, #FBBF24);
    border-color: #F59E0B;
    color: #78350F;
}
.pet-friend-hint {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--pet-text-muted);
    line-height: 1.45;
}
.pet-friend-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
    border-top: 2px dashed rgba(254, 215, 170, 0.75);
}
.pet-friend-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pet-text-secondary);
    text-decoration: none;
    cursor: pointer;
    border-radius: 999px;
    border: 2px solid var(--pet-border);
    background: var(--pet-surface);
    transition: color var(--pet-transition), border-color var(--pet-transition), background var(--pet-transition);
}
.pet-friend-action-btn:hover {
    color: var(--pet-primary-dark);
    border-color: var(--pet-primary);
    background: #FFF7ED;
}
.pet-friend-action-btn:focus-visible {
    outline: 3px solid var(--pet-secondary);
    outline-offset: 2px;
}
.pet-friend-action-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.pet-friend-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 7px 12px;
    border-radius: 999px;
    border: 3px solid transparent;
    white-space: nowrap;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
}
.pet-friend-badge--pet {
    background: linear-gradient(145deg, #D1FAE5, #6EE7B7);
    border-color: #34D399;
    color: #064E3B;
}
.pet-friend-badge--empty {
    background: linear-gradient(145deg, #F3F4F6, #E5E7EB);
    border-color: #D1D5DB;
    color: #4B5563;
}
.pet-friend-empty {
    text-align: center;
    padding: 24px 20px 20px;
    border-radius: var(--pet-radius-sm);
    border: 3px dashed rgba(251, 146, 60, 0.65);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 247, 237, 0.9) 100%);
    box-shadow: inset 0 2px 12px rgba(249, 115, 22, 0.06);
}
.pet-friend-empty-visual {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #FFEDD5, #FDBA74);
    border: 3px solid var(--pet-border-strong);
    box-shadow: var(--pet-shadow-sm);
    color: var(--pet-primary-dark);
}
.pet-friend-empty-visual svg {
    width: 38px;
    height: 38px;
}
.pet-friend-empty-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    color: var(--pet-primary-dark);
}
.pet-friend-empty-hint {
    margin: 10px 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pet-text-muted);
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}
.pet-friend-empty-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 12px 20px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-width: 3px !important;
    box-shadow: 0 4px 0 rgba(6, 78, 59, 0.15), var(--pet-shadow-sm) !important;
}
.pet-friend-empty-cta svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
@media (max-width: 520px) {
    .pet-friend-card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .pet-friend-badge {
        text-align: center;
        justify-content: center;
    }
    .pet-friend-action-btn {
        justify-content: center;
    }
}

/* ── Overlay / Modal ── */
.pet-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(120, 53, 15, 0.45);
    backdrop-filter: blur(4px);
}
.pet-overlay.is-open { display: flex; animation: petOverlayFade 160ms ease-out both; }
@keyframes petOverlayFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes petModalPop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes petCardRise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes petBodyFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.pet-overlay.is-open .pet-overlay-frame {
    animation: petModalPop 200ms cubic-bezier(.2,.9,.3,1.2) both;
}
/* Entrance for sheet cards & list rows */
.pet-overlay.is-open .pet-sheet-body .pet-furn-card,
.pet-overlay.is-open .pet-sheet-body .pet-feed-card,
.pet-overlay.is-open .pet-sheet-body .pet-row,
.pet-overlay.is-open .pet-sheet-body .pet-album-card,
.pet-overlay.is-open .pet-sheet-body .pet-diary-card {
    animation: petCardRise 260ms ease-out both;
}
/* Stagger only for list variant (direct body children) */
.pet-overlay.is-open .pet-sheet-body.is-list > *:nth-child(1) { animation-delay: 30ms; }
.pet-overlay.is-open .pet-sheet-body.is-list > *:nth-child(2) { animation-delay: 70ms; }
.pet-overlay.is-open .pet-sheet-body.is-list > *:nth-child(3) { animation-delay: 110ms; }
.pet-overlay.is-open .pet-sheet-body.is-list > *:nth-child(4) { animation-delay: 150ms; }
.pet-overlay.is-open .pet-sheet-body.is-list > *:nth-child(n+5) { animation-delay: 190ms; }
/* Body fade when switching content (tab/page) */
.pet-sheet-body.is-switching {
    animation: petBodyFade 140ms ease-out both;
}
/* Generic card hover lift (applies inside sheet only) */
.pet-sheet-body .pet-album-card,
.pet-sheet-body .pet-diary-card {
    transition: transform var(--pet-transition), box-shadow var(--pet-transition);
}
.pet-sheet-body .pet-album-card:hover,
.pet-sheet-body .pet-diary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(154, 52, 18, 0.14);
}
@media (prefers-reduced-motion: reduce) {
    .pet-overlay.is-open,
    .pet-overlay.is-open .pet-overlay-frame,
    .pet-overlay.is-open .pet-sheet-body > *,
    .pet-sheet-body.is-switching {
        animation: none !important;
    }
}
.pet-overlay-frame {
    width: min(860px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: rgba(255, 252, 245, 0.98);
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--btn-border);
}
.pet-modal {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 24px;
    background: transparent;
    /* firefox */
    scrollbar-width: auto;
    scrollbar-color: #F97316 #FFEFD5;
}
/* ── Pixel / cartoon scrollbar (shared by modal & logs) ── */
.pet-modal::-webkit-scrollbar,
.pet-logs-scroll::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
.pet-modal::-webkit-scrollbar-track,
.pet-logs-scroll::-webkit-scrollbar-track {
    background:
        repeating-linear-gradient(0deg, rgba(74,47,26,0.09) 0 1px, transparent 1px 6px),
        repeating-linear-gradient(90deg, rgba(74,47,26,0.09) 0 1px, transparent 1px 6px),
        #FFE4B5;
    border-left: 3px solid #4A2F1A;
    border-right: 3px solid #4A2F1A;
}
.pet-modal::-webkit-scrollbar-thumb,
.pet-logs-scroll::-webkit-scrollbar-thumb {
    background:
        linear-gradient(180deg,
            rgba(255,255,255,0.35) 0 3px,
            transparent 3px calc(100% - 3px),
            rgba(0,0,0,0.22) calc(100% - 3px) 100%),
        #F97316;
    border: 3px solid #4A2F1A;
    border-radius: 3px;
    box-shadow: inset -2px 0 0 rgba(0,0,0,0.18),
                inset 2px 0 0 rgba(255,255,255,0.22);
}
.pet-modal::-webkit-scrollbar-thumb:hover,
.pet-logs-scroll::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg,
            rgba(255,255,255,0.4) 0 3px,
            transparent 3px calc(100% - 3px),
            rgba(0,0,0,0.22) calc(100% - 3px) 100%),
        #FB923C;
}
.pet-modal::-webkit-scrollbar-thumb:active,
.pet-logs-scroll::-webkit-scrollbar-thumb:active {
    background:
        linear-gradient(180deg,
            rgba(0,0,0,0.22) 0 3px,
            transparent 3px calc(100% - 3px),
            rgba(255,255,255,0.25) calc(100% - 3px) 100%),
        #EA580C;
}
.pet-modal::-webkit-scrollbar-corner,
.pet-logs-scroll::-webkit-scrollbar-corner {
    background: #FFE4B5;
    border-left: 3px solid #4A2F1A;
}
.pet-logs-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    font-size: 13px;
    color: var(--pet-text-muted);
}
.pet-logs-pager .pet-btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}
.pet-logs-scroll {
    max-height: min(460px, 55vh);
    overflow-y: auto;
    scrollbar-width: auto;
    scrollbar-color: #F97316 #FFE4B5;
}
.pet-modal-head {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left));
    background: var(--p-paper, #fbf3df);
    border-bottom: 2px solid var(--pet-border, #7a5d3f);
}
.pet-modal-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--pet-primary-dark, #e07a3c);
}
.pet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--btn-icon-size);
    height: var(--btn-icon-size);
    padding: 0;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: #FFFCF5;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    color: var(--btn-border);
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) {
    .pet-close:hover {
        background: #FED7AA;
    }
}
.pet-close:active {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-close:focus-visible {
    outline: none;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}

/* Modal content helpers */
.pet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.pet-tile {
    padding: 16px;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: var(--btn-radius);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
@media (hover: hover) and (pointer: fine) {
    .pet-tile:hover { background: rgba(254, 215, 170, 0.6); }
}
.pet-tile:active {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-tile.is-selected { background: #FDE047; }
.pet-tile.is-selected:active {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-tile-art {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border: 3px solid var(--pet-border);
    border-radius: var(--pet-radius-sm);
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    font-size: 48px;
    overflow: hidden;
}
.pet-tile-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
.pet-tile-art img.pet-breed-pixel {
    object-fit: contain;
    padding: 4px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.pet-tile h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.pet-tile p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--pet-text-muted);
    line-height: 1.5;
}

/* Form elements */
.pet-form {
    display: grid;
    gap: 14px;
}
.pet-form label {
    font-size: 14px;
    font-weight: 600;
}
.pet-input {
    width: 100%;
    padding: 14px 16px;
    border: 3px solid var(--pet-border);
    border-radius: var(--pet-radius-sm);
    font: 500 15px/1.4 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    background: #FFFDF5;
    color: var(--pet-text);
    box-sizing: border-box;
    transition: border-color var(--pet-transition), box-shadow var(--pet-transition);
}
.pet-input:focus {
    outline: none;
    border-color: var(--pet-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.pet-input::placeholder { color: var(--pet-text-muted); }

/* Play interaction — 逗猫棒与分数动画复用于主场景玩法。 */
.pet-sheet-badge.is-urgent {
    color: #c62828;
    animation: pet-timer-pulse 500ms ease infinite;
}
.pet-toy {
    position: absolute;
    width: 56px;
    height: 56px;
    color: #6d4c41;
    display: grid;
    place-items: center;
    border: 4px solid #f59e0b;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff8e1 0%, transparent 45%),
        radial-gradient(circle at 40% 35%, #ffe082, #ffca28 55%, #f9a825 100%);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
    padding: 0;
    box-shadow:
        0 4px 0 rgba(180, 83, 9, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.18),
        inset 0 2px 3px rgba(255, 255, 255, 0.55),
        inset 0 -3px 6px rgba(245, 158, 11, 0.25);
    transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--pet-transition);
    z-index: 3;
}
.pet-toy.is-fresh {
    animation: pet-toy-pop 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pet-toy:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow:
        0 5px 0 rgba(180, 83, 9, 0.4),
        0 12px 28px rgba(0, 0, 0, 0.2),
        inset 0 2px 3px rgba(255, 255, 255, 0.6),
        inset 0 -3px 6px rgba(245, 158, 11, 0.2);
}
.pet-toy:active {
    transform: scale(0.92) translateY(2px);
    box-shadow:
        0 2px 0 rgba(180, 83, 9, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 3px 8px rgba(180, 83, 9, 0.2);
}
.pet-toy:focus {
    outline: none;
}
.pet-toy:focus-visible {
    outline: 3px solid var(--pet-secondary);
    outline-offset: 3px;
}
.pet-toy svg {
    width: 28px;
    height: 28px;
    stroke: #6d4c41;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.12));
}
@keyframes pet-toy-pop {
    0% { transform: scale(0) rotate(-18deg); opacity: 0; }
    65% { transform: scale(1.12) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.pet-play-score-pop {
    position: absolute;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow:
        0 2px 0 rgba(180, 83, 9, 0.45),
        0 2px 8px rgba(0,0,0,0.25),
        0 0 12px rgba(255, 193, 7, 0.55);
    pointer-events: none;
    z-index: 10;
    animation: pet-score-float 700ms ease-out forwards;
}
@keyframes pet-score-float {
    0% { opacity: 1; transform: translateY(0) scale(0.75); }
    25% { transform: translateY(-10px) scale(1.25); }
    100% { opacity: 0; transform: translateY(-52px) scale(1); }
}
@keyframes pet-timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
/* Record congrats */
.pet-record-congrats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 12px 8px;
    text-align: center;
}
.pet-record-congrats-icon {
    font-size: 64px;
    line-height: 1;
    animation: pet-record-bounce 820ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.pet-record-congrats-title {
    margin: 0;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--pet-primary-dark);
}
.pet-record-congrats-compare {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: #FFFBF0;
    border: 3px solid #4A2F1A;
    border-radius: 10px;
    box-shadow: 3px 3px 0 #4A2F1A;
}
.pet-record-congrats-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 72px;
}
.pet-record-congrats-label {
    font-size: 11px;
    color: var(--pet-text-muted);
    font-weight: 700;
    letter-spacing: 0.06em;
}
.pet-record-congrats-prev {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--pet-text-muted);
    line-height: 1;
    text-decoration: line-through;
}
.pet-record-congrats-new {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #EA580C;
    line-height: 1;
    text-shadow: 2px 2px 0 rgba(180, 83, 9, 0.18);
}
.pet-record-congrats-arrow {
    font-size: 24px;
    color: #F97316;
    font-weight: 700;
}
.pet-record-congrats-delta {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #16A34A;
}
.pet-record-congrats-rewards {
    margin: 0;
    font-size: 13px;
    color: var(--pet-text-secondary);
}
@keyframes pet-record-bounce {
    0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
    60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
    .pet-record-congrats-icon { animation: none; }
}
@media (max-width: 640px) {
    .pet-toy { width: 48px; height: 48px; border-width: 3px; }
    .pet-toy svg { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .pet-toy.is-fresh { animation: none; }
    .pet-play-score-pop { animation: none; opacity: 0; }
    .pet-sheet-badge.is-urgent { animation: none; }
}

/* Login / coming soon */
.pet-login {
    padding: 40px 24px;
    text-align: center;
}
.pet-login p {
    font-size: 15px;
    color: var(--pet-text-muted);
    margin: 8px 0;
}

/* Toast */
.pet-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(80px);
    padding: 14px 22px;
    background: rgba(120, 53, 15, 0.92);
    color: #FFF7ED;
    border: 2px solid var(--pet-border-strong);
    border-radius: var(--pet-radius-sm);
    font: 600 14px/1.4 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    opacity: 0;
    transition: opacity 250ms ease, transform 250ms ease;
    z-index: 80;
    box-shadow: var(--pet-shadow-lg);
}
.pet-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── 轻量确认弹窗（cottagecore 圆角卡片） ── */
.pet-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(78, 40, 15, 0.48);
    backdrop-filter: blur(3px);
    animation: petConfirmFade 180ms ease-out both;
}
@keyframes petConfirmFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.pet-confirm-box {
    max-width: 380px;
    width: 100%;
    background: linear-gradient(180deg, #FFF8EB 0%, #FFEAD0 100%);
    border: 3px solid #FDBA74;
    border-radius: 24px;
    box-shadow: 0 6px 0 rgba(154, 52, 18, 0.16), 0 20px 48px rgba(154, 52, 18, 0.22);
    padding: 22px 22px 20px;
    animation: petConfirmPop 260ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    overflow: hidden;
}
.pet-confirm-box::before {
    /* 顶部柔和光晕装饰 */
    content: '';
    position: absolute;
    left: -20%; right: -20%; top: -40%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(255, 224, 185, 0.6) 0%, transparent 70%);
    pointer-events: none;
}
@keyframes petConfirmPop {
    from { opacity: 0; transform: translateY(10px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.pet-confirm-msg {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--pet-text);
    text-align: center;
    position: relative;
}
.pet-confirm-msg strong {
    color: var(--pet-primary-dark);
    font-weight: 700;
}

/* 结构化富内容 */
.pet-confirm-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.pet-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #FDBA74;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 3px 0 rgba(154, 52, 18, 0.15);
    flex-shrink: 0;
}
.pet-confirm-icon img { width: 48px; height: 48px; object-fit: contain; image-rendering: auto; }
.pet-confirm-icon span { font-size: 28px; line-height: 1; }
.pet-confirm-title {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--pet-primary-dark);
    margin: 0;
    text-align: center;
}
.pet-confirm-lede {
    font-size: 13px;
    color: var(--pet-text-muted);
    margin: 0 0 10px;
    text-align: center;
}
.pet-confirm-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 6px;
    flex-wrap: wrap;
}
.pet-confirm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pet-text-secondary);
    background: rgba(255, 255, 255, 0.82);
    border: 2px solid var(--pet-border-strong);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(154, 52, 18, 0.12);
    white-space: nowrap;
}
.pet-confirm-chip.to {
    background: var(--pet-primary);
    color: #FFF7ED;
    border-color: var(--pet-primary-dark);
    box-shadow: 0 2px 0 var(--pet-primary-dark);
}
.pet-confirm-chip .pet-confirm-chip-icon { font-size: 14px; line-height: 1; }
.pet-confirm-arrow {
    font-size: 18px;
    color: var(--pet-primary);
    font-weight: 700;
    animation: petConfirmArrow 1s ease-in-out infinite;
}
@keyframes petConfirmArrow {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(3px); }
}
.pet-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
    position: relative;
}
.pet-confirm-actions .pet-btn {
    min-height: 44px;
    font-weight: 700;
    font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
    .pet-confirm-arrow { animation: none; }
    .pet-confirm-box { animation: none; }
}

/* ── Scene layers (outdoor / indoor) ── */
.pet-scene-layer {
    position: absolute;
    inset: 0;
    transition: opacity 200ms ease;
}
.pet-scene-layer--indoor {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.pet-scene.is-indoor .pet-scene-layer--outdoor {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.pet-scene.is-indoor .pet-scene-layer--indoor {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* ── Scene pills (top-left overlay, 小而克制) ── */
.pet-scene-pills {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;
    display: inline-flex;
    padding: 2px;
    gap: 1px;
    background: rgba(255, 252, 245, 0.78);
    border: 1.5px solid rgba(253, 186, 116, 0.7);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(154, 52, 18, 0.12);
    backdrop-filter: blur(4px);
}
.pet-scene-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: var(--btn-border-w) solid var(--btn-border);
    border-radius: 999px;
    background: #FFFCF5;
    color: var(--btn-border);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: transform 80ms, box-shadow 80ms, background 140ms;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.pet-scene-pill.is-active { background: #FDE047; }
.pet-scene-pill:not(.is-active):active {
    transform: translate(var(--btn-press-x), var(--btn-press-y));
    box-shadow: var(--btn-press-shadow) var(--btn-press-shadow) 0 var(--btn-border);
}
.pet-scene-pill:focus-visible {
    outline: none;
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}
.pet-scene-pill span.emoji { font-size: 11px; line-height: 1; }

/* ── Scene transition overlay（切换时的加载幕+猫咪走动） ── */
.pet-scene-transition {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: radial-gradient(circle at 50% 40%, rgba(255, 247, 237, 0.96) 0%, rgba(253, 210, 156, 0.96) 100%);
    opacity: 0;
    pointer-events: none;
    transition: none;
}
.pet-scene-transition.is-active {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 120ms ease;
}
.pet-scene-transition-stage {
    position: relative;
    width: min(240px, 68%);
    height: 72px;
    overflow: hidden;
}
.pet-scene-transition-ground {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 5px;
    background: repeating-linear-gradient(90deg, #FDBA74 0 10px, #F97316 10px 20px);
    border-radius: 3px;
    opacity: 0.7;
}
.pet-scene-transition-cat {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 48px;
    height: 48px;
    background: url('/static/img/petown/cat_orange-natural.webp?v=22') 0 -96px / 192px 288px no-repeat;
    image-rendering: pixelated;
    will-change: transform;
}
.pet-scene-transition.is-active .pet-scene-transition-cat {
    animation: petownTransitionCatRun 320ms steps(8, end) forwards;
}
@keyframes petownTransitionCatRun {
    from { transform: translateX(-56px); }
    to   { transform: translateX(var(--pet-scene-transition-distance, 296px)); }
}
.pet-scene-transition[data-direction="rtl"].is-active .pet-scene-transition-cat {
    animation: petownTransitionCatRunRTL 320ms steps(8, end) forwards;
}
@keyframes petownTransitionCatRunRTL {
    from { transform: translateX(var(--pet-scene-transition-distance, 296px)) scaleX(-1); }
    to   { transform: translateX(-56px) scaleX(-1); }
}
.pet-scene-transition-label {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--pet-primary-dark);
    letter-spacing: 0.5px;
}
.pet-scene-transition-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin-top: -4px;
}
.pet-scene-transition-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pet-primary);
    animation: none;
}
.pet-scene-transition.is-active .pet-scene-transition-dots span {
    animation: petownTransitionDot 320ms ease-in-out infinite;
}
.pet-scene-transition-dots span:nth-child(2) { animation-delay: 120ms; }
.pet-scene-transition-dots span:nth-child(3) { animation-delay: 200ms; }
@keyframes petownTransitionDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%          { transform: scale(1);   opacity: 1;   }
}
@media (prefers-reduced-motion: reduce) {
    .pet-scene-layer { transition: none !important; }
    .pet-scene-transition { transition: none !important; }
    .pet-scene-transition.is-active .pet-scene-transition-cat,
    .pet-scene-transition.is-active .pet-scene-transition-dots span { animation: none; }
}

/* ── Indoor scene: 小窝（永远明亮，cottagecore 暖调） ── */
/* 室内场景下屏蔽色温 / 雨，保持恒定明亮 */
.pet-scene.is-indoor .pet-scene-tint,
.pet-scene.is-indoor .pet-scene-rain { opacity: 0 !important; visibility: hidden !important; }

.pet-indoor-art-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    image-rendering: auto;
}
.pet-indoor-art-bg.is-loaded {
    background-image: url('/static/img/petown/petown-home-cottagecore-desktop-compressed.webp');
}
@media (max-width: 1023px) {
    .pet-scene-art-bg {
        background-image: url('/static/img/petown/petown-yard-cottagecore-calm-mobile-compressed.webp');
    }
    .pet-indoor-art-bg.is-loaded {
        background-image: url('/static/img/petown/petown-home-cottagecore-mobile-compressed.webp');
    }
}

/* 浮空木架：带支架 + 小盆栽 + 毛线球 + 两本书 */
.pet-indoor-shelf {
    position: absolute;
    left: 8%;
    top: 24%;
    width: 88px;
    height: 40px;
    /* 高于窗户(3)，避免与窗洞重叠时点击落到窗上 */
    z-index: 5;
}
.pet-indoor-shelf-board {
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 5px;
    background: linear-gradient(180deg, #F4D9B5, #D4A876);
    border-radius: 2px;
    box-shadow: 0 1px 0 rgba(162, 118, 72, 0.35);
}
.pet-indoor-shelf-bracket {
    position: absolute;
    bottom: 5px;
    width: 4px; height: 8px;
    background: #D4A876;
    border-radius: 0 0 2px 2px;
}
.pet-indoor-shelf-bracket.l { left: 6px; }
.pet-indoor-shelf-bracket.r { right: 6px; }
.pet-indoor-shelf-plant {
    position: absolute;
    left: 6px; bottom: 5px;
    width: 24px; height: 28px;
}
.pet-indoor-shelf-plant-leaves {
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    width: 24px; height: 20px;
    background:
        radial-gradient(ellipse at 28% 60%, #97C5A8 0 7px, transparent 8px),
        radial-gradient(ellipse at 72% 60%, #7EB592 0 7px, transparent 8px),
        radial-gradient(ellipse at 50% 18%, #B6D7BE 0 8px, transparent 9px);
    filter: drop-shadow(0 1px 0 rgba(90, 130, 100, 0.25));
}
.pet-indoor-shelf-plant-pot {
    position: absolute;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: 18px; height: 12px;
    background: linear-gradient(180deg, #F6B8BB, #E4858D);
    border-radius: 2px 2px 5px 5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.pet-indoor-shelf-book {
    position: absolute;
    bottom: 5px;
    width: 9px;
    height: 22px;
    border-radius: 1px 1px 0 0;
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.12), 0 1px 0 rgba(0,0,0,0.12);
}
.pet-indoor-shelf-book.b1 { left: 38px; height: 22px; background: #BFE5D4; }
.pet-indoor-shelf-book.b2 { left: 49px; height: 26px; background: #FFD089; }
.pet-indoor-shelf-book.b3 { left: 60px; height: 20px; background: #FBCFD2; }
.pet-indoor-shelf-yarn {
    position: absolute;
    right: 4px; bottom: 5px;
    width: 13px; height: 13px;
    background: radial-gradient(circle at 38% 38%, #FFD9A3, #F5A365);
    border-radius: 50%;
    box-shadow: inset -2px -2px 0 rgba(0,0,0,0.1);
}
.pet-indoor-shelf-yarn::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 50%;
    border-bottom-color: transparent;
    transform: rotate(35deg);
}

/* 白色照片框 + 桃心 */
.pet-indoor-frame {
    position: absolute;
    right: 12%;
    top: 18%;
    width: 44px;
    height: 40px;
    background: #FFFFFF;
    border: 3px solid #F4D9B5;
    border-radius: 3px;
    z-index: 5;
    box-shadow: 0 2px 0 rgba(162, 118, 72, 0.18);
}
.pet-indoor-frame::before {
    /* 挂绳 */
    content: '';
    position: absolute;
    left: 50%; top: -7px;
    width: 14px; height: 7px;
    border: 1.5px solid #D4A876;
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    transform: translateX(-50%);
}
.pet-indoor-frame::after {
    /* 爱心图案 */
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -55%) rotate(-45deg);
    width: 14px; height: 14px;
    background: #F5A7AD;
    box-shadow:
        7px 0 0 #F5A7AD,
        0 -7px 0 #F5A7AD;
    border-radius: 50% 50% 0 50%;
}


/* 猫垫（圆形软垫） */
.pet-indoor-cushion {
    position: absolute;
    left: 14%;
    bottom: 10%;
    width: 110px;
    height: 42px;
    z-index: 3;
}
.pet-indoor-cushion-base {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 100%;
    background: radial-gradient(ellipse at center, #F5A7AD 0%, #E4858D 70%, #CF6E78 100%);
    border-radius: 50%;
    box-shadow: inset 0 -3px 0 rgba(186, 93, 102, 0.4), 0 2px 0 rgba(162, 118, 72, 0.18);
}
.pet-indoor-cushion-top {
    position: absolute;
    left: 10%; right: 10%;
    top: 10%;
    height: 55%;
    background: radial-gradient(ellipse at center, #FBCFD2 0%, #F5A7AD 100%);
    border-radius: 50%;
}

/* 水碗 */
.pet-indoor-bowl {
    position: absolute;
    right: 10%;
    bottom: 9%;
    width: 56px;
    height: 22px;
    z-index: 3;
}
.pet-indoor-bowl-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #BFE5D4 0%, #7EB592 100%);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    box-shadow: inset 0 -2px 0 rgba(90, 130, 100, 0.3);
}
.pet-indoor-bowl-water {
    position: absolute;
    left: 12%; right: 12%; top: 2px;
    height: 5px;
    background: linear-gradient(180deg, #D8EEFF 0%, #A8D5FF 100%);
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pet-indoor-fireplace { display: none; }

/* 可装饰的 indoor 物件：悬停提示 + 光晕 */
.pet-indoor-decor {
    cursor: pointer;
    transition: transform var(--pet-transition), filter var(--pet-transition);
}
.pet-indoor-decor:hover {
    filter: drop-shadow(0 0 6px rgba(249, 115, 22, 0.45)) brightness(1.04);
}

/* 已装备家具的 sprite 覆盖层 — 统一 72×72（与院子 .pet-sprite-custom 对齐），按锚点居中底对齐 */
.pet-indoor-item-sprite {
    position: absolute;
    width: 72px;
    height: 72px;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    image-rendering: auto;
    display: none;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}
.pet-indoor-decor.is-equipped > .pet-indoor-item-sprite {
    display: block;
}
/* 装备后隐藏 CSS 占位视觉（保留 sprite） */
.pet-indoor-frame.is-equipped { background: transparent; border-color: transparent; box-shadow: none; }
.pet-indoor-frame.is-equipped::before,
.pet-indoor-frame.is-equipped::after { display: none; }
.pet-indoor-shelf.is-equipped > :not(.pet-indoor-item-sprite):not(.pet-indoor-shelf-board):not(.pet-indoor-shelf-bracket) { opacity: 0; }
.pet-indoor-cushion.is-equipped > .pet-indoor-cushion-base,
.pet-indoor-cushion.is-equipped > .pet-indoor-cushion-top { opacity: 0; }
.pet-indoor-bowl.is-equipped > .pet-indoor-bowl-body,
.pet-indoor-bowl.is-equipped > .pet-indoor-bowl-water { opacity: 0; }

/* 相框 sprite：墙面小尺寸（~44×40），居中 */
.pet-indoor-frame .pet-indoor-item-sprite {
    width: 44px; height: 40px;
    left: 50%; top: 50%; bottom: auto;
    transform: translate(-50%, -50%);
    background-position: center;
}
/* 书架 sprite：从书架板起立 */
.pet-indoor-shelf .pet-indoor-item-sprite {
    bottom: 5px;
}
.pet-indoor-shelf.pet-indoor-decor:hover,
.pet-indoor-frame.pet-indoor-decor:hover,
.pet-indoor-cushion.pet-indoor-decor:hover,
.pet-indoor-bowl.pet-indoor-decor:hover {
    transform: translateY(-1px);
}
/* Indoor "cat is out" hint when expeditioning */
.pet-indoor-away-note {
    display: none;
    position: absolute;
    left: 50%;
    top: 36%;
    transform: translateX(-50%);
    z-index: 7;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #5D3A1F;
    background: rgba(255, 247, 237, 0.94);
    border: 2px solid var(--pet-border-strong);
    border-radius: 10px;
    box-shadow: var(--pet-shadow-sm);
    white-space: nowrap;
}
.pet-scene.is-indoor .pet-indoor-away-note.visible { display: block; }

/* Mobile tweaks for indoor props */
@media (max-width: 640px) {
    .pet-indoor-shelf { width: 76px; left: 5%; height: 36px; top: 22%; }
    .pet-indoor-shelf-plant { width: 20px; height: 24px; left: 4px; }
    .pet-indoor-shelf-plant-leaves { width: 20px; height: 16px; }
    .pet-indoor-shelf-plant-pot { width: 16px; height: 10px; }
    .pet-indoor-shelf-book.b1 { left: 30px; }
    .pet-indoor-shelf-book.b2 { left: 40px; }
    .pet-indoor-shelf-book.b3 { left: 50px; }
    .pet-indoor-shelf-yarn { right: 3px; width: 11px; height: 11px; }
    .pet-indoor-frame { right: 8%; width: 38px; height: 34px; }
    .pet-indoor-cushion { left: 10%; width: 52px; height: 20px; bottom: 10%; }
    .pet-indoor-bowl { right: 8%; width: 28px; height: 12px; }
    .pet-scene-pill { padding: 6px 12px; min-height: 44px; font-size: 12px; }
    .pet-scene-transition-stage { height: 60px; }
    .pet-scene-transition-cat { width: 40px; height: 40px; }
    .pet-scene-transition-label { font-size: 13px; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .pet-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    .pet-shell > .pet-scene { grid-column: 1; grid-row: 1; }
    .pet-shell > .pet-status { grid-column: 1; grid-row: 2; }
    .pet-action-bar { grid-column: 1; grid-row: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pet-bottom-row { grid-column: 1; grid-row: 4; grid-template-columns: 1fr; }
    .pet-scene { min-height: 380px; }
}
@media (max-width: 640px) {
    .pet-app {
        padding: 12px;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .pet-topbar { gap: 6px; margin-bottom: 12px; }
    .pet-topbar-left { gap: 10px; }
    .pet-back { padding: 8px 12px; font-size: 13px; }
    .pet-title { font-size: 20px; }
    .pet-subtitle { font-size: 11px; margin-top: 1px; }
    .pet-actions-top { gap: 6px; }
    .pet-ambient-row { margin: 8px 0 2px; gap: 6px; }
    .pet-ambient-chip { padding: 5px 8px; font-size: 11px; }
    .pet-ambient-icon { font-size: 13px; }
    .pet-action-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pet-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pet-grid { grid-template-columns: 1fr; }
    .pet-scene { min-height: 320px; }
    .pet-scene-fence-item { width: 38px; height: 32px; }
    #petownCatCanvas { width: 100%; height: 58%; }
    .pet-modal { padding: 18px; }
    .pet-modal-head {
        padding: 14px 18px 12px;
    }
    .pet-modal-head h2 { font-size: 18px; }
    .pet-btn { padding: 12px 10px; font-size: 13px; min-height: 44px; }
    .pet-icon-btn { padding: 10px 12px; font-size: 12px; min-height: 44px; }
    .pet-row .pet-btn { min-height: 44px; padding: 10px 14px; }
    .pet-feed-card .pet-btn { min-height: 44px; padding: 10px 14px; }
}

/* ── 明信片 / 相册 ── */
.pet-postcard-modal {
    padding: 8px 4px 4px;
}
.pet-postcard-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: var(--pet-muted);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
    border: 6px solid #fff;
    margin-bottom: 16px;
}
.pet-postcard-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pet-postcard-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pet-text-muted);
    font-size: 14px;
    gap: 8px;
}
.pet-postcard-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--pet-text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: pet-postcard-spin 0.9s linear infinite;
}
@keyframes pet-postcard-spin { to { transform: rotate(360deg); } }
.pet-postcard-caption {
    margin: 0 0 12px;
    text-align: center;
    font-size: 15px;
    color: var(--pet-text);
    font-style: italic;
    padding: 0 12px;
}
.pet-postcard-outcome {
    margin: 0 0 4px;
    text-align: center;
    color: var(--pet-text);
    font-size: 14px;
}
.pet-postcard-reward {
    margin: 0 0 8px;
    text-align: center;
    color: var(--pet-text-muted);
    font-size: 13px;
}
.pet-postcard-enc {
    margin: 4px 0;
    text-align: center;
    font-size: 13px;
    color: var(--pet-text);
}
.pet-postcard-enc span {
    color: var(--pet-text-muted);
    font-size: 12px;
    margin-left: 6px;
}
.pet-album-card { transition: transform 0.15s; }
.pet-album-card:hover { transform: translateY(-2px); }

/* ── Unified sheet (shop / feed / expedition / album / diary) ── */
.pet-sheet {
    padding: 0;
    background:
        repeating-linear-gradient(0deg, rgba(74,47,26,0.05) 0 1px, transparent 1px 14px),
        repeating-linear-gradient(90deg, rgba(74,47,26,0.05) 0 1px, transparent 1px 14px),
        #FFEFD5;
    border-radius: var(--pet-radius);
    overflow: hidden;
    position: relative;
    image-rendering: pixelated;
}
/* ── Top bar: badges + tabs/extras ── */
.pet-sheet-topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    background: #F97316;
    border-bottom: 4px solid #4A2F1A;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.14);
}
.pet-sheet-badges {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pet-sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #FDE047;
    color: #4A2F1A;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
    border: 3px solid #4A2F1A;
    border-radius: 6px;
    box-shadow: 3px 3px 0 #4A2F1A;
}
.pet-sheet-badge svg { width: 18px; height: 18px; color: #B45309; }
.pet-sheet-badge.is-info {
    background: #FFE4B5;
    color: #4A2F1A;
}
.pet-sheet-badge.is-info svg { color: #9A3412; }
.pet-sheet-badge.is-level {
    background: #FDBA74;
    color: #4A2F1A;
}
.pet-sheet-extras {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}
.pet-sheet-note {
    font-family: 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: #FFFBF0;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.22);
    padding: 6px 10px;
    background: rgba(74,47,26,0.35);
    border-radius: 999px;
    letter-spacing: 0.5px;
}
.pet-sheet-tabs {
    display: flex;
    gap: 10px;
}
.pet-sheet-tabs .pet-btn {
    position: relative;
    padding: 9px 20px;
    font-size: 14px;
    background: var(--p-paper);
    color: var(--p-ink);
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border);
    opacity: 1;
    min-height: var(--btn-min-height);
}
.pet-sheet-tabs .pet-btn.is-active {
    background: var(--p-ink);
    color: var(--p-paper);
    padding-left: 28px;
}
.pet-sheet-tabs .pet-btn.is-active::before {
    content: '▸';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--p-warm);
    line-height: 1;
}
.pet-sheet-tabs .pet-btn:focus-visible {
    box-shadow: var(--btn-shadow-offset) var(--btn-shadow-offset) 0 var(--btn-border),
                var(--btn-focus-ring);
}
.pet-sheet-body {
    position: relative;
    padding: 20px 18px 24px;
    min-height: 200px;
}
.pet-sheet-body.is-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pet-sheet-body.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.pet-sheet-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--pet-text-muted);
}
.pet-sheet-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.pet-sheet-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 4px 18px 20px;
    font-size: 13px;
    color: var(--pet-text-muted);
}
/* ── 目标槽位 banner（从场景点击打开商店时提示"正在为 xx 选家具"） ── */
.pet-sheet-target {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 14px 16px 0;
    background: #FEF3C7;
    border: 3px solid #4A2F1A;
    border-radius: 6px;
    box-shadow: 3px 3px 0 #4A2F1A;
    font-size: 13px;
    font-weight: 700;
    color: #4A2F1A;
    line-height: 1.3;
}
.pet-sheet-target-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
.pet-sheet-target-label {
    flex: 1;
    min-width: 0;
}
.pet-sheet-target-label strong {
    color: #B45309;
    letter-spacing: 0.5px;
}
.pet-sheet-target-clear {
    flex-shrink: 0;
    padding: 5px 10px;
    background: var(--p-paper);
    color: var(--p-ink);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--p-ink);
    transition: transform 80ms, box-shadow 80ms;
    font-family: inherit;
}
.pet-sheet-target-clear:hover {
    background: var(--p-paper-soft);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--p-ink);
}
.pet-sheet-target-clear:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}
/* ── 顶部 slot 快捷跳转条 ── */
.pet-shop-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 0;
}
.pet-shop-filter-label {
    flex-shrink: 0;
    color: var(--p-ink-soft);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.pet-sheet-slot-nav {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    margin: 12px 0 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    background: #FFE4B5;
    border-top: 3px solid #4A2F1A;
    border-bottom: 3px solid #4A2F1A;
}
.pet-sheet-slot-nav::-webkit-scrollbar { height: 6px; }
.pet-sheet-slot-nav::-webkit-scrollbar-thumb { background: #F97316; border-radius: 3px; }
.pet-slot-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--p-paper);
    color: var(--p-ink);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--p-ink);
    transition: transform 80ms, box-shadow 80ms, background 100ms, color 100ms;
    white-space: nowrap;
}
.pet-slot-chip:hover {
    background: var(--p-paper-soft);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--p-ink);
}
.pet-slot-chip:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}
.pet-slot-chip:focus-visible {
    outline: 2px solid var(--p-ink);
    outline-offset: 3px;
}
.pet-slot-chip.is-target {
    background: var(--p-ink);
    color: var(--p-paper);
    border-color: var(--p-ink);
}
.pet-shop-filter-bar .pet-slot-chip {
    min-height: var(--pet-control-height);
}
#petownApp .pet-shop-filter-bar .pet-slot-chip.is-active {
    background: var(--p-ink);
    color: var(--p-paper);
    border-color: var(--p-ink);
}
.pet-slot-chip-icon {
    font-size: 14px;
    line-height: 1;
}
.pet-slot-chip-count {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 800;
}
/* ── Shelf / slot section ── */
.pet-collection-slot {
    margin-bottom: 24px;
    border-radius: 12px;
    transition: box-shadow 0.4s ease, background 0.4s ease;
}
.pet-collection-slot:last-child { margin-bottom: 0; }
.pet-collection-slot.is-flash {
    background: rgba(249, 115, 22, 0.08);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.35);
}
.pet-collection-slot-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 7px 14px;
    background: #F97316;
    color: #FFFBF0;
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    border: 3px solid #4A2F1A;
    border-radius: 4px;
    box-shadow: 3px 3px 0 #4A2F1A;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.22);
}
.pet-collection-slot-icon {
    font-size: 16px;
    line-height: 1;
}
.pet-collection-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
}
.pet-shop-empty {
    max-width: 360px;
    margin: 0 auto;
}
.pet-shop-empty-title {
    margin: 0 0 8px;
    color: var(--p-ink);
    font-size: 16px;
    font-weight: 800;
}
.pet-shop-empty-copy {
    margin: 0 0 16px;
    color: var(--p-ink-soft);
    font-size: 13px;
    line-height: 1.6;
}
/* ── Item card (pixel crate) ── */
.pet-furn-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #FFFBF0;
    border: 3px solid #4A2F1A;
    border-radius: 6px;
    box-shadow: 4px 4px 0 #4A2F1A;
    transition: transform 100ms ease-out, box-shadow 100ms ease-out;
    overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
    .pet-furn-card:hover {
        transform: translate(-2px, -2px);
        box-shadow: 6px 6px 0 #4A2F1A;
    }
}
.pet-furn-card.is-equipped {
    background: #FEF3C7;
    border-color: #B45309;
    box-shadow: 4px 4px 0 #B45309;
}
.pet-furn-card.is-owned {
    background: #ECFCCB;
    border-color: #3F6212;
    box-shadow: 4px 4px 0 #3F6212;
}
.pet-furn-card.is-purchased::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--p-ok);
    border-right: 2px solid var(--p-ink);
    z-index: 2;
    pointer-events: none;
}
/* ── Icon stage (display shelf tile) ── */
.pet-furn-icon {
    width: 100%;
    height: 104px;
    display: grid;
    place-items: center;
    background:
        repeating-linear-gradient(0deg, rgba(74,47,26,0.07) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(90deg, rgba(74,47,26,0.07) 0 1px, transparent 1px 8px),
        #FFE4B5;
    border-bottom: 3px solid #4A2F1A;
    box-shadow: inset 0 -4px 0 rgba(74,47,26,0.14);
    font-size: 44px;
    line-height: 1;
    overflow: hidden;
    position: relative;
}
.pet-furn-icon img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
    transition: transform 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) {
    .pet-furn-card:hover .pet-furn-icon img {
        transform: translateY(-3px) scale(1.05);
    }
}
.pet-furn-card.is-equipped .pet-furn-icon {
    background:
        repeating-linear-gradient(0deg, rgba(180,83,9,0.1) 0 1px, transparent 1px 8px),
        repeating-linear-gradient(90deg, rgba(180,83,9,0.1) 0 1px, transparent 1px 8px),
        #FED7AA;
    border-bottom-color: #B45309;
}
/* ── Card body (text + actions) ── */
.pet-furn-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}
.pet-furn-name {
    font-size: 14px;
    font-weight: 800;
    color: #4A2F1A;
    margin: 0;
    letter-spacing: 0.3px;
}
.pet-furn-buff {
    font-size: 11px;
    color: #78350F;
    margin: 0;
    line-height: 1.4;
    opacity: 0.8;
}
.pet-furn-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 800;
    color: #4A2F1A;
    margin: 4px 0 2px;
    padding: 3px 8px;
    background: #FDE047;
    border: 2px solid #4A2F1A;
    border-radius: 4px;
    width: fit-content;
    box-shadow: 2px 2px 0 #4A2F1A;
}
/* ── Badge (pixel tag over icon area) ── */
.pet-furn-badges {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: calc(100% - 20px);
    z-index: 3;
    pointer-events: none;
}
.pet-furn-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.3px;
    border: 2px solid #4A2F1A;
    border-radius: 4px;
    box-shadow: 2px 2px 0 #4A2F1A;
}
.pet-furn-badge.equipped {
    background: #F97316;
    color: #FFFBF0;
}
.pet-furn-badge.owned {
    background: #84CC16;
    color: #1A2E05;
}
.pet-furn-badge.placed {
    background: #FEF3C7;
    color: #78350F;
    padding: 3px 7px;
    font-size: 10px;
    letter-spacing: 0;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.pet-furn-card.is-placed {
    border-style: dashed;
    background: rgba(254, 243, 199, 0.35);
    opacity: 0.92;
}
.pet-furn-card.is-not-fit {
    opacity: 0.42;
    filter: grayscale(0.55);
}
.pet-furn-card.is-not-fit:hover { transform: none; box-shadow: 4px 4px 0 #4A2F1A; }
.pet-btn.move-btn {
    background: var(--p-warm) !important;
    color: var(--p-ink) !important;
}
/* ── Action buttons (NES-style press-in) ── */
.pet-furn-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 6px;
}
.pet-furn-actions .pet-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    min-height: var(--pet-control-height);
    border: var(--pet-control-border);
    border-radius: var(--pet-control-radius);
    box-shadow: var(--pet-control-shadow);
    transition: transform 80ms ease-out, box-shadow 80ms ease-out, filter 80ms;
    text-shadow: none;
}
.pet-furn-actions .pet-btn:hover:not(:disabled) {
    transform: translate(-1px, -1px);
    box-shadow: var(--pet-control-shadow-hover);
}
.pet-furn-actions .pet-btn:active:not(:disabled):not(.pet-btn--pending) {
    transform: translate(2px, 2px);
    box-shadow: none;
}
.pet-furn-actions .pet-btn:focus-visible {
    outline: none;
    box-shadow: var(--pet-control-shadow);
}
.pet-furn-actions .pet-btn.pet-btn--pending::after {
    border-color: var(--p-ink-soft);
    border-top-color: var(--p-ink);
}
.pet-furn-actions .pet-btn.buy-btn {
    background: var(--p-accent);
    color: var(--p-ink);
}
.pet-furn-actions .pet-btn.buy-btn:disabled {
    opacity: 0.45;
    filter: grayscale(0.5);
    box-shadow: 2px 2px 0 var(--p-ink);
}
.pet-furn-actions .pet-btn.equip-btn {
    background: var(--p-ok);
    color: var(--p-ink);
}
.pet-furn-actions .pet-btn.equipped-btn {
    background: var(--p-ink);
    color: var(--p-paper);
    cursor: default;
    opacity: 0.85;
    box-shadow: none;
}
.pet-furn-actions .pet-btn.remove-btn {
    background: var(--p-paper);
    color: var(--p-ink);
}
/* ── Feed card ── */
.pet-feed-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 2px solid rgba(254, 215, 170, 0.6);
    border-radius: var(--pet-radius-xs);
    background: rgba(255, 255, 255, 0.5);
    transition: background var(--pet-transition);
}
.pet-feed-card:hover { background: rgba(255, 255, 255, 0.7); }
.pet-feed-card .pet-furn-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin-bottom: 0;
    font-size: 28px;
    border-radius: 8px;
}
.pet-feed-card .pet-furn-icon img {
    max-width: 48px;
    max-height: 48px;
}
.pet-feed-info {
    flex: 1;
    min-width: 0;
}
.pet-feed-card .pet-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
}
@media (max-width: 640px) {
    .pet-sheet-topbar { padding: 12px; gap: 8px; }
    .pet-sheet-badge { font-size: 14px; padding: 6px 10px; }
    .pet-sheet-extras { margin-left: 0; flex: 1 1 100%; }
    .pet-sheet-tabs { flex: 1 1 100%; }
    .pet-sheet-tabs .pet-btn { flex: 1; font-size: 12px; padding: 7px 10px; min-height: 44px; }
    .pet-sheet-body { padding: 16px 14px 20px; }
    .pet-sheet-note { font-size: 11px; padding: 5px 9px; }
    .pet-sheet-target { margin: 10px 12px 0; padding: 8px 10px; font-size: 12px; gap: 8px; }
    .pet-sheet-target-clear { padding: 4px 8px; font-size: 11px; }
    .pet-shop-filter-bar { padding: 8px 12px 0; gap: 6px; }
    .pet-shop-filter-label { font-size: 11px; }
    .pet-shop-filter-bar .pet-slot-chip { flex: 1; justify-content: center; padding: 6px 8px; }
    .pet-sheet-slot-nav { padding: 8px 12px; gap: 6px; }
    .pet-slot-chip { padding: 5px 10px; font-size: 11px; }
    .pet-collection-slot-title { font-size: 13px; padding: 6px 12px; }
    .pet-collection-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pet-furn-icon { font-size: 32px; height: 92px; }
    .pet-furn-icon img { max-width: 64px; max-height: 64px; }
    .pet-furn-body { padding: 8px 10px 10px; }
    .pet-furn-name { font-size: 13px; }
    .pet-furn-badges { top: 5px; right: 5px; gap: 3px; max-width: calc(100% - 16px); }
    .pet-furn-badge,
    .pet-furn-badge.placed { padding: 3px 5px; font-size: 9px; }
    .pet-furn-actions .pet-btn { padding: 8px 4px; font-size: 12px; min-height: 44px; }
    .pet-feed-card .pet-furn-icon { width: 48px; height: 48px; min-width: 48px; }
    .pet-feed-card .pet-furn-icon img { max-width: 40px; max-height: 40px; }
}

/* ── Login Overlay ── */
.pet-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(120, 53, 15, 0.5);
    backdrop-filter: blur(6px);
}
.pet-login-dialog {
    width: min(460px, 100%);
    padding: 32px 32px 24px;
    background: var(--pet-surface);
    border: 3px solid var(--pet-border-strong);
    border-radius: var(--pet-radius);
    box-shadow: var(--pet-shadow-lg);
    text-align: center;
    overflow: hidden;
}
.pet-login-header { margin-bottom: 4px; }
.pet-login-game-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--pet-text);
    margin: 0 0 6px;
}
.pet-login-tagline {
    font-size: 14px;
    color: var(--pet-text-muted);
    margin: 0;
}
/* ── Cat run stage ── */
.pet-login-cat-stage {
    position: relative;
    height: 72px;
    margin: 8px -32px 12px;
    overflow: hidden;
    container-type: inline-size;
}
.pet-login-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--pet-border) 0 6px, var(--pet-border-strong) 6px 8px);
    border-radius: 2px;
}
.pet-login-cat {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 56px;
    height: 56px;
    background: url('/static/img/petown/cat_orange-natural.webp?v=22') 0 0 / 224px 336px no-repeat;
    image-rendering: pixelated;
    will-change: transform;
    animation: petLoginCatFrame 0.44s steps(4) infinite, petLoginCatRun 6s linear infinite;
}
.pet-login-cat-2 {
    background-image: url('/static/img/petown/cat_tabby-natural.webp?v=22');
    animation: petLoginCatFrame 0.44s steps(4) infinite, petLoginCatRun2 8s linear infinite;
    animation-delay: 0s, -3s;
}
@keyframes petLoginCatFrame {
    from { background-position-x: 0; }
    to   { background-position-x: -224px; }
}
/* row 2 = run row, offset = 2 * 56px = 112px (scaled from 128px frames) */
.pet-login-cat { background-position-y: -112px; }
@keyframes petLoginCatRun {
    from { transform: translateX(-56px); }
    to   { transform: translateX(calc(100cqw + 56px)); }
}
@keyframes petLoginCatRun2 {
    from { transform: translateX(-56px); }
    to   { transform: translateX(calc(100cqw + 56px)); }
}
@media (prefers-reduced-motion: reduce) {
    .pet-login-cat { animation: none; display: none; }
}
.pet-login-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    text-align: left;
}
.pet-login-features li {
    position: relative;
    padding: 6px 0 6px 24px;
    font-size: 14px;
    color: var(--pet-text-secondary);
    line-height: 1.5;
}
.pet-login-features li::before {
    content: '\1F43E';
    position: absolute;
    left: 0;
    font-size: 13px;
}
.pet-login-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.pet-login-back {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: var(--pet-text-muted);
    text-decoration: none;
}
.pet-login-back:hover {
    color: var(--pet-text-secondary);
    text-decoration: underline;
}
@media (max-width: 640px) {
    .pet-login-dialog { padding: 24px 20px 20px; }
    .pet-login-game-name { font-size: 20px; }
    .pet-login-cat-stage { margin-left: -20px; margin-right: -20px; }
}

/* ── 全屏加载动画 ── */
.petown-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: linear-gradient(170deg, #FFF7ED 0%, #FFEDD5 40%, #FED7AA 100%);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    color: #78350F;
    transition: opacity 400ms ease-out, visibility 400ms ease-out;
    pointer-events: auto;
    padding: 24px;
    text-align: center;
}
.petown-splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.petown-splash.is-hidden .petown-splash-cat,
.petown-splash.is-hidden .petown-splash-dots span {
    animation-play-state: paused;
}
.petown-splash-logo {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #78350F;
    letter-spacing: 0.5px;
    margin: 0;
}
.petown-splash-tagline {
    font-size: 14px;
    color: #9A3412;
    margin: -18px 0 0;
    opacity: 0.8;
}
.petown-splash-stage {
    position: relative;
    width: min(320px, 72vw);
    height: 96px;
    overflow: hidden;
}
.petown-splash-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: repeating-linear-gradient(90deg, #FDBA74 0 10px, #F97316 10px 20px);
    border-radius: 3px;
    opacity: 0.6;
}
.petown-splash-cat {
    position: absolute;
    bottom: 6px;
    left: 0;
    width: 56px;
    height: 56px;
    background: url('/static/img/petown/cat_orange-natural.webp?v=22') 0 -112px / 224px 336px no-repeat;
    image-rendering: pixelated;
    will-change: transform;
    animation:
        petownSplashCatFrame 0.44s steps(4) infinite,
        petownSplashCatRun 2.8s linear infinite;
}
@keyframes petownSplashCatFrame {
    from { background-position-x: 0; }
    to   { background-position-x: -224px; }
}
@keyframes petownSplashCatRun {
    from { transform: translateX(-64px); }
    to   { transform: translateX(calc(min(320px, 72vw) + 8px)); }
}
.petown-splash-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}
.petown-splash-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #F97316;
    animation: petownSplashDot 1.2s ease-in-out infinite;
}
.petown-splash-dots span:nth-child(2) { animation-delay: 0.15s; }
.petown-splash-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes petownSplashDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40%          { transform: scale(1);   opacity: 1;   }
}
.petown-splash-hint {
    font-size: 13px;
    color: #C2825A;
    margin: 0;
}
@media (prefers-reduced-motion: reduce) {
    .petown-splash-cat,
    .petown-splash-dots span { animation: none; }
}

/* ──────────────────────────────────────────────── */
/* PIXEL-FIRST chrome overrides (docs/wiki/design/petown-ui.md §3, §7)   */
/* 高特异性，强制 chrome 对齐宪法                    */
/* ──────────────────────────────────────────────── */

/* 1. 通用：UI 元素去 shadow、去渐变、强制 2px 圆角 */
.pet-app .pet-card,
.pet-app .pet-bar,
.pet-app .pet-bar-fill,
.pet-app .pet-modal,
.pet-app .pet-toast,
.pet-app .pet-badge,
.pet-app .pet-detail-chip,
.pet-app .pet-confirm-box,
.pet-app .pet-album-card,
.pet-app .pet-collection-slot,
.pet-app .pet-confirm-chip-icon,
.pet-app .pet-action-bar,
.pet-app .pet-profile-header,
.pet-app .pet-ambient-chip {
    box-shadow: none;
    border-radius: 2px;
    background-image: none;
}

/* 2. 卡片基底：纸色 + 2px 实心墨描边 + 像素硬阴影（右下） */
.pet-app .pet-card {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--p-ink);
}
.pet-app .pet-card.pet-status,
.pet-app .pet-card.pet-panel {
    background: var(--p-paper);
}

/* 4. 进度条：硬边像素长条（非渐变） */
.pet-app .pet-bar {
    height: 12px;
    background: var(--p-paper-soft);
    border: 2px solid var(--p-ink);
    border-radius: 0;
    overflow: hidden;
    image-rendering: pixelated;
}
.pet-app .pet-bar-fill {
    height: 100%;
    border-radius: 0;
    background: var(--p-accent);
    box-shadow: none;
    transition: width 320ms steps(8);
}
.pet-app .pet-bar-fill.hunger { background: var(--p-warn); }
.pet-app .pet-bar-fill.mood { background: var(--p-warm); }
.pet-app .pet-bar-fill.xp { background: var(--p-cool); }
.pet-app .pet-bar-row {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 12px;
    color: var(--p-ink);
    letter-spacing: 0.04em;
}

/* 5. emoji 缩小+黑白滤镜让它不抢戏 */
.pet-app .pet-scene-pill .emoji,
.pet-app .pet-ambient-chip .pet-ambient-icon {
    filter: grayscale(0.4) saturate(0.7);
    font-size: 12px;
}

/* 6. Modal & overlay */
.pet-app .pet-modal,
.pet-app .pet-confirm-box {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 4px 4px 0 var(--p-ink);
}
.pet-overlay {
    background: rgba(29, 37, 69, 0.55);
}

/* 7. 卡片标题 */
.pet-app .pet-panel h2,
.pet-app .pet-card h2 {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: var(--p-ink);
    letter-spacing: 0.04em;
    margin: 0 0 12px;
}
.pet-app .pet-title {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 20px;
    font-weight: normal;
    color: var(--p-ink);
    letter-spacing: 0.04em;
}
.pet-app .pet-subtitle {
    font-family: 'LXGW WenKai', serif;
    font-size: 12px;
    color: var(--p-ink-soft);
}

/* 9. 徽章/chip/标签 */
.pet-app .pet-badge,
.pet-app .pet-detail-chip,
.pet-app .pet-ambient-chip,
.pet-app .pet-confirm-chip-icon {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    color: var(--p-ink);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 11px;
    box-shadow: none;
}

/* 10. 列表/list 元素 — 去渐变，paper-soft 底 */
.pet-app .pet-list > * {
    background: var(--p-paper-soft);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: none;
    background-image: none;
}

/* 11. 商店/相册/友卡片 */
.pet-app .pet-album-card,
.pet-app .pet-collection-slot,
.pet-app .pet-shop-card {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--p-ink);
    background-image: none;
}

/* 12. 底部 dock 容器自身去渐变 */
.pet-app .pet-action-bar {
    background: transparent;
    box-shadow: none;
    border: 0;
}

/* 13. Profile header 卡片 */
.pet-app .pet-profile-header {
    background: var(--p-paper-soft);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: none;
    background-image: none;
}

/* 14. Toast */
.pet-app .pet-toast,
.pet-toast {
    background: var(--p-ink);
    color: var(--p-paper);
    border: 2px solid var(--p-paper);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--p-paper);
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 12px;
}

/* 17. 入口 login 卡 / topbar 强化背景 */
.pet-app .pet-login {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 4px 4px 0 var(--p-ink);
    background-image: none;
}

/* 18. 全局清掉残留 gradient 背景的 UI 元素（但不影响 .pet-scene-* 内部） */
.pet-app .pet-shell .pet-card *:not([class*="pet-scene-"]):not([class*="pet-indoor-"]):not([class*="pet-yard-"]):not([class*="pet-cat-"]) {
    background-image: none;
}

/* ──────────────────────────────────────────────── */
/* PIXEL-FIRST 布局 — 院子是主角 (docs/wiki/design/petown-ui.md §6)      */
/* ──────────────────────────────────────────────── */

/* === 桌面：左侧 360px 固定 sidebar + 右侧场景铺底 === */
@media (min-width: 1024px) {
    body.lp-hide-site-chrome {
        background: var(--p-night);
        overflow: hidden;
    }
    .pet-app {
        padding: 0;
        height: 100vh;
        overflow: hidden;
        position: relative;
        --p-sidebar: 360px;
    }
    /* sidebar wrapper：固定左侧 360px 实底，flex column 紧凑堆叠 status + bottom-row */
    .pet-app .pet-sidebar-stack {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: var(--p-sidebar);
        padding: 16px 20px 12px;
        background: var(--p-paper);
        border-right: 2px solid var(--p-ink);
        box-shadow: 4px 0 0 var(--p-ink-soft);
        z-index: 30;
        display: flex;
        flex-direction: column;
        gap: 14px;
        overflow-y: auto;
    }
    .pet-app .pet-sidebar-stack::-webkit-scrollbar { width: 6px; }
    .pet-app .pet-sidebar-stack::-webkit-scrollbar-thumb { background: var(--p-ink-soft); }
    /* topbar 仅覆盖 sidebar 右侧的场景区，半透明压暗 */
    .pet-app .pet-topbar {
        position: fixed;
        top: 0;
        left: var(--p-sidebar);
        right: 0;
        margin: 0;
        max-width: none;
        padding: 12px 20px;
        z-index: 60;
        background: linear-gradient(180deg,
            rgba(29, 37, 69, 0.55) 0%,
            rgba(29, 37, 69, 0.0) 100%);
        flex-wrap: nowrap;
        align-items: flex-start;
    }
    .pet-app .pet-topbar .pet-back {
        background: var(--p-paper);
    }
    .pet-app .pet-topbar .pet-title {
        color: var(--p-paper);
        text-shadow: 2px 2px 0 var(--p-night);
    }
    .pet-app .pet-topbar .pet-subtitle {
        color: var(--p-paper-soft);
        text-shadow: 1px 1px 0 var(--p-night);
    }
    .pet-app .pet-topbar .pet-actions-top {
        margin-top: 4px;
    }
    /* shell 容器透传 */
    .pet-app .pet-shell {
        max-width: none;
        margin: 0;
        padding: 0;
        display: block;
        position: relative;
        height: 100vh;
    }
    /* 场景：从 sidebar 右侧开始，填满剩余视口 */
    .pet-app .pet-card.pet-scene {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        left: var(--p-sidebar);
        width: auto;
        height: 100vh;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        z-index: 1;
    }
    /* 场景切换 pill：场景区域内右上（清掉原 left:8px 防止撑成全宽白条） */
    .pet-app .pet-scene-pills {
        position: fixed;
        top: 64px;
        left: auto;
        right: 20px;
        width: auto;
        z-index: 55;
    }
    /* sidebar 内：status 和 bottom-row 自然 flex 流式排，不再用 fixed */
    .pet-app .pet-sidebar-stack .pet-card.pet-status {
        position: static;
        width: auto;
        max-height: none;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        flex: 0 0 auto;
        overflow: visible;
    }
    /* 头像条 margin 重置（sidebar 内不需要 hover 背景延展抵消） */
    .pet-app .pet-sidebar-stack .pet-profile-header--clickable {
        margin: 0 0 6px;
        padding: 8px 0;
    }
    .pet-app .pet-sidebar-stack .pet-bottom-row {
        position: static;
        width: auto;
        max-height: none;
        padding: 0;
        grid-template-columns: 1fr;
        gap: 10px;
        overflow: visible;
        background: transparent;
        flex: 1 1 auto;
        z-index: auto;
    }
    .pet-app .pet-sidebar-stack .pet-bottom-row .pet-card {
        padding: 10px 12px;
        max-height: none;
        overflow: visible;
        background: var(--p-paper-soft);
        border: 2px solid var(--p-ink);
        border-radius: 2px;
        box-shadow: 2px 2px 0 var(--p-ink);
    }
    .pet-app .pet-sidebar-stack .pet-bottom-row .pet-card h2 {
        font-size: 12px;
        margin-bottom: 6px;
    }
    /* status 卡内部：紧凑布局 */
    .pet-app .pet-sidebar-stack .pet-status-brief { margin-bottom: 10px; }
    .pet-app .pet-sidebar-stack .pet-ambient-row { margin-bottom: 10px; }
    /* 进度条紧凑 + 数字加大加粗 + tabular-nums + 高对比 */
    .pet-app .pet-sidebar-stack .pet-bars { gap: 8px; }
    .pet-app .pet-sidebar-stack .pet-bar-row {
        margin-bottom: 3px;
        font-family: 'Zpix', 'Pixelify Sans', sans-serif;
        font-size: 12px;
        letter-spacing: 0.04em;
    }
    .pet-app .pet-sidebar-stack .pet-bar-row span:first-child {
        color: var(--p-ink);
        font-weight: normal;
    }
    .pet-app .pet-sidebar-stack .pet-bar-row span:last-child {
        font-family: 'Pixelify Sans', 'Zpix', monospace;
        font-size: 14px;
        font-weight: 700;
        color: var(--p-ink);
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.02em;
    }
    .pet-app .pet-sidebar-stack .pet-bar { height: 10px; }
    /* 主 dock：在场景区底部居中（不在 sidebar 上） */
    .pet-app .pet-action-bar {
        position: fixed;
        bottom: 24px;
        /* 中心 = sidebar 宽度 + 剩余宽度的一半 */
        left: calc(var(--p-sidebar) + (100vw - var(--p-sidebar)) / 2);
        transform: translateX(-50%);
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        padding: 8px;
        z-index: 40;
        background: var(--p-paper);
        border: 2px solid var(--p-ink);
        border-radius: 2px;
        box-shadow: 4px 4px 0 var(--p-ink);
        max-width: calc(100vw - var(--p-sidebar) - 40px);
    }
    .pet-app .pet-action-bar #petownFeedBtn,
    .pet-app .pet-action-bar #petownPlayBtn,
    .pet-app .pet-action-bar #petownExpeditionBtn {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 96px;
    }
    .pet-app .pet-action-bar #petownShopBtn,
    .pet-app .pet-action-bar #petownAlbumBtn,
    .pet-app .pet-action-bar #petownDiaryBtn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 0;
    }
    .pet-app .pet-action-bar #petownShopBtn {
        margin-left: 6px;
        position: relative;
    }
    .pet-app .pet-action-bar #petownShopBtn::before {
        content: "";
        position: absolute;
        left: -6px;
        top: 4px;
        bottom: 4px;
        width: 2px;
        background: var(--p-ink-soft);
    }
}

/* ──────────────────────────────────────────────── */
/* PIXEL-FIRST 院子升级 — 风景吸引人 (docs/wiki/design/petown-ui.md §8)   */
/* ──────────────────────────────────────────────── */

/* === 远景剪影山 — 3 层视差 + 大气透视 ===
   z-index 5：浮于庭院背景之上；
   位置：贴在背景地平线之上，与 fence 顶端齐平 */
.pet-scene-mountains {
    position: absolute;
    left: 0; right: 0;
    bottom: 55%;
    height: 24%;
    pointer-events: none;
    z-index: 5;
    image-rendering: pixelated;
    transition: filter 800ms ease-out;
}
.pet-scene-mountain {
    position: absolute;
    left: -8%; right: -8%;
    bottom: 0;
    image-rendering: pixelated;
}
.pet-scene-mountain-far {
    height: 60%;
    background: #8aa3c1;
    opacity: 0.55;
    filter: blur(0.5px);
    clip-path: polygon(
        0% 100%, 0% 70%, 8% 50%, 14% 60%, 22% 30%, 30% 55%,
        38% 38%, 48% 60%, 58% 28%, 66% 50%, 76% 40%, 86% 58%,
        96% 32%, 100% 50%, 100% 100%
    );
}
.pet-scene-mountain-mid {
    height: 75%;
    background: #687a96;
    opacity: 0.7;
    clip-path: polygon(
        0% 100%, 0% 80%, 6% 65%, 14% 75%, 24% 50%, 34% 70%,
        46% 45%, 56% 70%, 68% 50%, 78% 65%, 88% 55%, 100% 70%,
        100% 100%
    );
}
.pet-scene-mountain-near {
    height: 90%;
    background: #4f5f78;
    opacity: 0.85;
    clip-path: polygon(
        0% 100%, 0% 90%, 12% 75%, 22% 88%, 36% 65%, 50% 82%,
        64% 70%, 76% 85%, 90% 72%, 100% 85%, 100% 100%
    );
}
/* 时段调色 */
.pet-scene.is-morning .pet-scene-mountain-far { background: #b39db3; }
.pet-scene.is-morning .pet-scene-mountain-mid { background: #927a92; }
.pet-scene.is-morning .pet-scene-mountain-near { background: #6e596e; }
.pet-scene.is-dusk .pet-scene-mountain-far { background: #b48ba6; }
.pet-scene.is-dusk .pet-scene-mountain-mid { background: #8a6884; }
.pet-scene.is-dusk .pet-scene-mountain-near { background: #5e4660; }
.pet-scene.is-night .pet-scene-mountain-far { background: #4d5a82; opacity: 0.7; }
.pet-scene.is-night .pet-scene-mountain-mid { background: #353f60; opacity: 0.82; }
.pet-scene.is-night .pet-scene-mountain-near { background: #1f2640; opacity: 0.92; }

/* === Cottagecore 风庭院树 — 多层 ellipse 叶冠 + 棕色树干（参考真实院子图）=== */
/* 远景林带不再使用 */
.pet-scene-forest { display: none; }

.pet-scene-yard-tree {
    position: absolute;
    pointer-events: none;
    /* 在 fence (z=2) 之前——canopy 部分会盖住围栏中段 */
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    --t-leaf-base:  #4d7a26;
    --t-leaf-mid:   #6ba038;
    --t-leaf-hi:    #8cc257;
    --t-leaf-lite:  #a4d472;
    --t-wood:       #6b4a26;
    --t-wood-d:     #4d3416;
    --t-wood-hi:    #8c6839;
}
/* Canopy 占容器顶部，多层 ellipse 重叠成"叶子团" */
.pet-scene-yard-tree-canopy {
    width: 100%;
    height: 58%;
    flex-shrink: 0;
    transform-origin: 50% 100%;
    animation: petYardTreeSway 8s ease-in-out infinite;
    will-change: transform;
    filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.18));
    overflow: visible;
}
.pet-scene-yard-tree-canopy svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}
/* Trunk — 棕色木质，粗壮，从 canopy 底部延伸到草地 */
.pet-scene-yard-tree-trunk {
    width: 32%;
    flex: 1;
    position: relative;
    /* 圆柱质感：左暗右亮模拟侧光，背景 = 渐变 + 树皮纹理 */
    background:
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.22) 0,
            rgba(0, 0, 0, 0.22) 1px,
            transparent 1px,
            transparent 18px
        ),
        radial-gradient(ellipse at 30% 60%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
        linear-gradient(
            90deg,
            var(--t-wood-d) 0%,
            var(--t-wood) 25%,
            var(--t-wood-hi) 50%,
            var(--t-wood) 75%,
            var(--t-wood-d) 100%
        );
    border-radius: 4px 4px 2px 2px;
    box-shadow:
        inset 0 -4px 0 rgba(0, 0, 0, 0.28),
        inset 0 2px 0 rgba(255, 255, 255, 0.10),
        2px 4px 0 rgba(0, 0, 0, 0.16);
}
/* 树洞 / 节疤 — 中段一个椭圆暗色装饰 */
.pet-scene-yard-tree-trunk::before {
    content: '';
    position: absolute;
    top: 32%;
    left: 30%;
    width: 38%;
    height: 8%;
    background: radial-gradient(ellipse at center, var(--t-wood-d) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.7;
}
/* 树根 / 基部加宽 */
.pet-scene-yard-tree-trunk::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -20%;
    right: -20%;
    height: 16%;
    background:
        radial-gradient(ellipse at center top, var(--t-wood) 0%, var(--t-wood-d) 60%, transparent 90%);
    border-radius: 50% 50% 0 0 / 80% 80% 0 0;
    z-index: -1;
}

/* 主树：左后角，巨大叶冠完全越过围栏 */
.pet-scene-yard-tree-1 {
    left: -2%;
    bottom: 4%;
    width: 30%;
    max-width: 340px;
    min-width: 150px;
    height: 92%;
}
/* 副树：右后角，稍小但同样高大 */
.pet-scene-yard-tree-2 {
    right: -2%;
    bottom: 4%;
    width: 28%;
    max-width: 320px;
    min-width: 138px;
    height: 88%;
    --t-leaf-base:  #466e22;
    --t-leaf-mid:   #62932f;
    --t-leaf-hi:    #80b54a;
    --t-leaf-lite:  #97c963;
}
.pet-scene-yard-tree-2 .pet-scene-yard-tree-canopy {
    animation-delay: -3.5s;
    animation-duration: 9s;
}

@keyframes petYardTreeSway {
    0%, 100% { transform: rotate(-0.8deg); }
    50%      { transform: rotate(0.8deg); }
}
@media (prefers-reduced-motion: reduce) {
    .pet-scene-yard-tree-canopy { animation: none; }
}

/* 时段调色 */
.pet-scene.is-morning .pet-scene-yard-tree {
    --t-leaf-base: #5e7e30; --t-leaf-mid: #7da840; --t-leaf-hi: #9bc35a; --t-leaf-lite: #b6d680;
}
.pet-scene.is-dusk .pet-scene-yard-tree {
    --t-leaf-base: #3a5b1f; --t-leaf-mid: #4f7a2a; --t-leaf-hi: #6a9540; --t-leaf-lite: #7eaa56;
}
.pet-scene.is-night .pet-scene-yard-tree {
    --t-leaf-base: #1f3018; --t-leaf-mid: #2c4222; --t-leaf-hi: #3c5a30; --t-leaf-lite: #4a6c3c;
    --t-wood: #3a2914; --t-wood-d: #251a0a; --t-wood-hi: #4c3617;
}

/* === 池塘 — 中景 ripple，柔边融入草地 === */
.pet-scene-pond {
    position: absolute;
    left: 64%;
    bottom: 14%;
    width: 96px;
    height: 28px;
    pointer-events: none;
    z-index: 4;
    image-rendering: pixelated;
}
.pet-scene-pond-water {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.45) 0%, transparent 35%),
        linear-gradient(180deg, #6fb6c5 0%, #4d8b9a 60%, #345b66 100%);
    border-radius: 50% / 60%;
    box-shadow:
        0 0 0 1px rgba(58, 42, 28, 0.65),
        inset 0 -3px 0 rgba(0, 0, 0, 0.22),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        0 4px 12px -4px rgba(20, 35, 60, 0.55);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 65%, transparent 100%);
            mask-image: radial-gradient(ellipse at center, #000 65%, transparent 100%);
}
.pet-scene.is-night .pet-scene-pond-water {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(190, 210, 255, 0.4) 0%, transparent 35%),
        linear-gradient(180deg, #2d4a6a 0%, #1d3550 60%, #0e2236 100%);
}
.pet-scene.is-dusk .pet-scene-pond-water {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 220, 200, 0.5) 0%, transparent 35%),
        linear-gradient(180deg, #a07a82 0%, #6f5870 60%, #3e3552 100%);
}
.pet-scene-pond-ripple {
    position: absolute;
    border: 1px solid #cfeaf2;
    border-radius: 50% / 60%;
    opacity: 0;
    animation: pond-ripple 3.6s ease-out infinite;
    pointer-events: none;
}
.pet-scene-pond-ripple-1 { left: 25%; top: 25%; width: 14px; height: 5px; animation-delay: 0s; }
.pet-scene-pond-ripple-2 { left: 55%; top: 50%; width: 12px; height: 4px; animation-delay: 1.8s; }
@keyframes pond-ripple {
    0%   { transform: scale(0.4); opacity: 0; }
    20%  { opacity: 0.85; }
    100% { transform: scale(2.6); opacity: 0; }
}
.pet-scene-pond-leaf {
    position: absolute;
    left: 18%;
    top: 30%;
    width: 6px;
    height: 4px;
    background: #5d8a3c;
    border: 1px solid #3a5a26;
    transform-origin: 50% 50%;
    animation: pond-leaf-float 5s ease-in-out infinite;
}
@keyframes pond-leaf-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50%      { transform: translate(8px, 1px) rotate(20deg); }
}

/* === 萤火虫 — 暮夜显眼 === */
.pet-scene-fireflies {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms ease-out;
    z-index: 7;
}
/* dusk / night 时显示 */
.pet-scene.is-dusk .pet-scene-fireflies,
.pet-scene.is-night .pet-scene-fireflies {
    opacity: 1;
}
.pet-scene-firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffe48a;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 228, 138, 0.9), 0 0 12px 4px rgba(255, 228, 138, 0.45);
    animation: firefly-drift 4.5s ease-in-out infinite, firefly-pulse 1.6s ease-in-out infinite;
    image-rendering: auto;
}
@keyframes firefly-drift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(8px, -10px); }
    50% { transform: translate(-6px, -18px); }
    75% { transform: translate(10px, -8px); }
}
@keyframes firefly-pulse {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

/* === 樱花瓣 — 昼飘落 === */
.pet-scene-petals {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 800ms ease-out;
    z-index: 8;
}
.pet-scene.is-dusk .pet-scene-petals,
.pet-scene.is-night .pet-scene-petals {
    opacity: 0;
}
.pet-scene-petal {
    position: absolute;
    top: -16px;
    width: 8px;
    height: 6px;
    background: #f9c5d4;
    border: 1px solid #c97e96;
    border-radius: 50% 0;
    transform-origin: center;
    animation: petal-fall 7s linear infinite;
    image-rendering: pixelated;
}
@keyframes petal-fall {
    0% {
        transform: translate(0, -10px) rotate(0deg);
        opacity: 0;
    }
    8%  { opacity: 0.9; }
    100% {
        transform: translate(60px, 105vh) rotate(540deg);
        opacity: 0.9;
    }
}

/* === 流星 — 夜间偶发 === */
.pet-scene-shooting-star {
    position: absolute;
    top: 12%;
    left: -10%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #fff 60%, #fff 100%);
    box-shadow: 0 0 6px 1px #fff;
    opacity: 0;
    transform: rotate(-18deg);
    z-index: 7;
    animation: shooting-star 14s linear infinite;
    animation-delay: 4s;
}
@keyframes shooting-star {
    0%, 92%, 100% { opacity: 0; transform: translate(0, 0) rotate(-18deg); }
    93% { opacity: 0.9; transform: translate(0, 0) rotate(-18deg); }
    98% { opacity: 0.9; transform: translate(120vw, 30vh) rotate(-18deg); }
    99% { opacity: 0; transform: translate(120vw, 30vh) rotate(-18deg); }
}
/* 仅夜间显示流星 */
.pet-scene:not(.is-night) .pet-scene-shooting-star { display: none; }

/* === 时段 tint 强化（is-morning / is-day / is-dusk / is-night） === */
.pet-scene.is-morning .pet-scene-tint {
    background: linear-gradient(180deg,
        rgba(255, 200, 180, 0.18) 0%,
        rgba(255, 240, 220, 0.10) 60%,
        transparent 100%);
}
.pet-scene.is-day .pet-scene-tint {
    background: transparent;
}
.pet-scene.is-dusk .pet-scene-tint {
    background: linear-gradient(180deg,
        rgba(255, 130, 80, 0.14) 0%,
        rgba(180, 100, 60, 0.10) 50%,
        rgba(40, 30, 60, 0.08) 100%);
}
.pet-scene.is-night .pet-scene-tint {
    background: linear-gradient(180deg,
        rgba(20, 30, 70, 0.30) 0%,
        rgba(20, 30, 70, 0.18) 60%,
        rgba(10, 15, 35, 0.12) 100%);
}

/* === 软晕环（vignette）— 把视线往中心引 === */
.pet-card.pet-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    background: radial-gradient(ellipse at 50% 55%,
        transparent 35%,
        rgba(20, 25, 50, 0.10) 75%,
        rgba(20, 25, 50, 0.28) 100%);
    transition: background 800ms ease-out;
}
.pet-card.pet-scene.is-night::after {
    background: radial-gradient(ellipse at 50% 55%,
        transparent 30%,
        rgba(10, 15, 35, 0.20) 70%,
        rgba(5, 8, 20, 0.55) 100%);
}
.pet-card.pet-scene.is-dusk::after {
    background: radial-gradient(ellipse at 50% 55%,
        transparent 35%,
        rgba(60, 30, 50, 0.14) 75%,
        rgba(40, 20, 40, 0.32) 100%);
}

/* 夜间氛围由场景遮罩承担；Canvas 保持无滤镜，保障角色动作帧率。 */

/* === 参考图方向：像素童话庭院装扮层（不改左侧信息栏） === */
.pet-scene-sky {
    background:
        linear-gradient(180deg,
            #5f8fbe 0%,
            #8fb8d4 22%,
            #b9d5e7 42%,
            #d6e7d5 58%,
            #a9ca80 74%,
            #84aa5d 100%);
}
.pet-scene-soft-cloud {
    height: 14px;
    background: #eef3e8;
    border-radius: 0;
    box-shadow:
        10px -8px 0 #f4f8ee,
        22px -14px 0 #f4f8ee,
        36px -16px 0 #e5eee2,
        50px -9px 0 #f4f8ee,
        64px -5px 0 #e1eadf,
        78px 0 0 rgba(244, 248, 238, 0.9);
    filter: drop-shadow(0 3px 0 rgba(83, 117, 143, 0.16));
}
.pet-scene-cloud-1.pet-scene-soft-cloud { width: 94px; top: 15%; left: 38%; }
.pet-scene-cloud-2.pet-scene-soft-cloud { width: 120px; top: 18%; right: 9%; opacity: 0.72; }
.pet-scene-cloud-3.pet-scene-soft-cloud { width: 78px; top: 10%; left: 8%; opacity: 0.64; }

.pet-scene-mountains {
    bottom: 54%;
    height: 22%;
    z-index: 1;
    opacity: 0.78;
}
.pet-scene-mountain-far { background: #9db9d1; opacity: 0.56; }
.pet-scene-mountain-mid { background: #7ea1bc; opacity: 0.56; }
.pet-scene-mountain-near { background: #6c955f; opacity: 0.48; filter: blur(0.4px); }

.pet-scene-fence {
    top: 34%;
    height: 13%;
    z-index: 4;
    background:
        linear-gradient(180deg,
            transparent 0,
            transparent 18%,
            #8a6337 18%,
            #8a6337 28%,
            transparent 28%,
            transparent 57%,
            #7b552f 57%,
            #7b552f 67%,
            transparent 67%),
        repeating-linear-gradient(90deg,
            #caa56a 0,
            #caa56a 17px,
            #9f7643 17px,
            #9f7643 21px,
            #d8b77b 21px,
            #d8b77b 39px,
            #8d6538 39px,
            #8d6538 43px);
    filter: drop-shadow(0 4px 0 rgba(64, 42, 24, 0.22));
}
.pet-scene-fence::before {
    top: -13px;
    height: 14px;
    background: repeating-linear-gradient(90deg,
        transparent 0,
        transparent 4px,
        #d9bd83 4px,
        #d9bd83 20px,
        #8e683b 20px,
        #8e683b 24px,
        transparent 24px,
        transparent 30px);
    clip-path: polygon(0 100%, 6px 0, 15px 0, 21px 100%, 100% 100%);
}
.pet-scene-fence-gate {
    top: 28%;
    height: 22%;
    width: 12%;
    z-index: 6;
}
.pet-scene-fence-gate .pet-scene-fence-arch-frame {
    background:
        linear-gradient(90deg, transparent 0 16%, #694927 16% 25%, transparent 25% 75%, #694927 75% 84%, transparent 84%),
        linear-gradient(180deg, #8a6135 0%, #593819 100%);
    border: 4px solid #5e3d1f;
}
.pet-scene-fence-gate .pet-scene-fence-arch-door {
    background:
        linear-gradient(38deg, transparent 0 45%, #5a3a1f 45% 52%, transparent 52%),
        linear-gradient(-38deg, transparent 0 47%, #5a3a1f 47% 54%, transparent 54%),
        repeating-linear-gradient(90deg, #a7773f 0 12px, #7c532c 12px 15px);
}

.pet-scene-ground {
    top: 43%;
    background:
        radial-gradient(ellipse at 15% 30%, rgba(211, 240, 111, 0.45) 0 12%, transparent 28%),
        radial-gradient(ellipse at 82% 22%, rgba(198, 230, 96, 0.40) 0 11%, transparent 30%),
        radial-gradient(ellipse at 52% 68%, rgba(93, 150, 63, 0.28) 0 13%, transparent 34%),
        linear-gradient(180deg, #a7cc62 0%, #8dbc4d 32%, #77a943 68%, #659238 100%);
}

.pet-scene-yard-tree {
    z-index: 5;
}
.pet-scene-yard-tree-1 {
    left: -4%;
    bottom: 5%;
    width: 32%;
    height: 88%;
}
.pet-scene-yard-tree-2 {
    right: -3%;
    bottom: 5%;
    width: 30%;
    height: 86%;
}
.pet-scene-yard-tree-canopy {
    filter:
        drop-shadow(3px 5px 0 rgba(52, 67, 30, 0.30))
        drop-shadow(-2px 0 0 rgba(177, 210, 88, 0.20));
}
.pet-scene-yard-tree-trunk {
    border-radius: 45% 45% 8px 8px / 18% 18% 8px 8px;
}

.pet-scene-feeder {
    position: absolute;
    left: 5%;
    bottom: 11%;
    width: 52px;
    height: 80px;
    z-index: 6;
    pointer-events: none;
    image-rendering: pixelated;
}
.pet-scene-feeder::before {
    content: "";
    position: absolute;
    left: 20px;
    bottom: 0;
    width: 12px;
    height: 56px;
    background: linear-gradient(90deg, #8a5a2f, #bd8750 48%, #6f4425);
    box-shadow: -12px 48px 0 #84552e, 12px 48px 0 #6f4425;
}
.pet-scene-feeder::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    width: 38px;
    height: 26px;
    background:
        radial-gradient(circle at 50% 62%, #4c2d18 0 5px, transparent 6px),
        linear-gradient(180deg, #d8b06d 0 38%, #9a6334 38% 100%);
    border: 3px solid #6b4325;
    box-shadow: 0 -9px 0 #f1e4c8, 0 -12px 0 #6b4325, 3px 4px 0 rgba(44, 28, 18, 0.22);
}

.pet-scene-birdhouse {
    position: absolute;
    right: 4%;
    bottom: 22%;
    width: 46px;
    height: 78px;
    z-index: 6;
    pointer-events: none;
    image-rendering: pixelated;
}
.pet-scene-birdhouse::before {
    content: "";
    position: absolute;
    left: 19px;
    bottom: 0;
    width: 8px;
    height: 46px;
    background: #7a4c2a;
    box-shadow: inset 2px 0 0 #ad7842;
}
.pet-scene-birdhouse::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    width: 36px;
    height: 34px;
    background:
        radial-gradient(circle at 50% 58%, #3c2416 0 6px, transparent 7px),
        linear-gradient(180deg, #c9894d 0 42%, #87502d 42% 100%);
    border: 3px solid #5b341e;
    box-shadow:
        0 -11px 0 #e4c27f,
        0 -14px 0 #5b341e,
        4px 5px 0 rgba(44, 28, 18, 0.24);
}

.pet-scene-fountain {
    position: absolute;
    right: 8%;
    bottom: 5%;
    width: 106px;
    height: 86px;
    z-index: 7;
    pointer-events: none;
    image-rendering: pixelated;
}
.pet-scene-fountain-basin {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 0;
    height: 34px;
    background:
        radial-gradient(ellipse at 50% 35%, #98d1dc 0 34%, #4d8fa4 35% 55%, transparent 56%),
        linear-gradient(180deg, #d9d2c0, #8d8c83);
    border: 4px solid #706c61;
    border-radius: 50% / 44%;
    box-shadow: inset 0 -5px 0 rgba(58, 54, 48, 0.28), 3px 5px 0 rgba(42, 35, 29, 0.22);
}
.pet-scene-fountain-pillar {
    position: absolute;
    left: 42px;
    bottom: 22px;
    width: 24px;
    height: 38px;
    background: linear-gradient(90deg, #88877e, #d8d2c4 48%, #74736b);
    border: 3px solid #68655d;
}
.pet-scene-fountain-water {
    position: absolute;
    left: 38px;
    bottom: 50px;
    width: 32px;
    height: 28px;
    border-radius: 50% 50% 40% 40%;
    background:
        radial-gradient(circle at 50% 18%, #f8ffff 0 4px, transparent 5px),
        linear-gradient(180deg, rgba(170, 225, 238, 0.88), rgba(74, 145, 166, 0.56));
    box-shadow: 0 12px 0 -7px rgba(141, 210, 225, 0.75);
    animation: petFountainPulse 1.8s steps(3) infinite;
}
@keyframes petFountainPulse {
    0%, 100% { transform: translateY(0); opacity: 0.82; }
    50% { transform: translateY(-3px); opacity: 1; }
}

.pet-scene-lantern {
    position: absolute;
    width: 16px;
    height: 30px;
    z-index: 8;
    pointer-events: none;
    image-rendering: pixelated;
}
.pet-scene-lantern::before {
    content: "";
    position: absolute;
    left: 7px;
    top: -15px;
    width: 2px;
    height: 16px;
    background: #4f311a;
}
.pet-scene-lantern::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 0;
    width: 14px;
    height: 20px;
    background:
        radial-gradient(circle at 50% 58%, #ffe28a 0 4px, #b86832 5px 8px, transparent 9px),
        linear-gradient(180deg, #6b3f22, #402414);
    border: 2px solid #2d1a0e;
    border-radius: 7px 7px 4px 4px;
    box-shadow: 0 0 10px rgba(255, 209, 101, 0.36);
}
.pet-scene-lantern-1 { right: 20%; bottom: 39%; }
.pet-scene-lantern-2 { right: 12%; bottom: 46%; transform: scale(0.88); }

.pet-scene-frisbee {
    position: absolute;
    left: 54%;
    bottom: 15%;
    width: 88px;
    height: 24px;
    z-index: 6;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 28% 38%, rgba(255, 255, 255, 0.34) 0 5%, transparent 6%),
        radial-gradient(ellipse at 62% 48%, transparent 0 34%, rgba(229, 204, 239, 0.46) 35% 45%, transparent 46%),
        linear-gradient(180deg, #9b6bae, #735092);
    border: 3px solid #5b3c73;
    border-radius: 50%;
    box-shadow: inset 0 -4px 0 rgba(54, 34, 80, 0.28), 3px 6px 0 rgba(56, 54, 35, 0.18);
    image-rendering: pixelated;
}

.pet-scene-flower-meadow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6;
}
.pet-scene-flower-meadow span {
    position: absolute;
    width: 9px;
    height: 9px;
    background: #f7f2dc;
    border-radius: 50%;
    box-shadow:
        -5px 0 0 #f7f2dc,
        5px 0 0 #f7f2dc,
        0 -5px 0 #f7f2dc,
        0 5px 0 #f7f2dc,
        0 0 0 2px #e0b64c;
}
.pet-scene-flower-meadow span:nth-child(3n) {
    background: #b7c8ff;
    box-shadow: -4px 0 0 #b7c8ff, 4px 0 0 #b7c8ff, 0 -4px 0 #b7c8ff, 0 4px 0 #b7c8ff, 0 0 0 2px #f0c95c;
}
.pet-scene-flower-meadow span:nth-child(4n) {
    background: #f6a4b0;
    box-shadow: -4px 0 0 #f6a4b0, 4px 0 0 #f6a4b0, 0 -4px 0 #f6a4b0, 0 4px 0 #f6a4b0, 0 0 0 2px #ffe18b;
}

@media (max-width: 768px) {
    .pet-scene-feeder { transform: scale(0.78); transform-origin: left bottom; }
    .pet-scene-birdhouse { transform: scale(0.76); transform-origin: right bottom; right: 2%; }
    .pet-scene-fountain { transform: scale(0.72); transform-origin: right bottom; right: 3%; }
    .pet-scene-frisbee { width: 58px; height: 18px; left: 50%; }
    .pet-scene-lantern { display: none; }
}

/* === 减弱动画偏好 === */
@media (prefers-reduced-motion: reduce) {
    .pet-scene-petal,
    .pet-scene-firefly,
    .pet-scene-pond-ripple,
    .pet-scene-pond-leaf,
    .pet-scene-shooting-star { animation: none; }
}

/* ──────────────────────────────────────────────── */
/* 收尾对齐：领养选择器 / 商店 / 登录闸 / emoji 替换  */
/* ──────────────────────────────────────────────── */

/* 领养卡片（10 只猫品种） */
.pet-app .pet-tile.is-selected {
    background: var(--p-warm);
    border-color: var(--p-ink);
    color: var(--p-ink);
    box-shadow: 2px 2px 0 var(--p-ink), inset 0 0 0 2px var(--p-paper);
    transform: translate(-1px, -1px);
}
.pet-app .pet-tile.is-selected:hover { transform: translate(-1px, -1px); }
.pet-app .pet-tile-art {
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    background: var(--p-paper-soft);
    background-image: none;
    margin-bottom: 8px;
    image-rendering: pixelated;
}
.pet-app .pet-tile h3 {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 13px;
    font-weight: normal;
    color: var(--p-ink);
    letter-spacing: 0.04em;
    margin: 4px 0 2px;
}
.pet-app .pet-tile p {
    font-family: 'LXGW WenKai', serif;
    font-size: 12px;
    color: var(--p-ink-soft);
    margin: 0;
}
.pet-app .pet-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* 性别选择 tile */
.pet-app .pet-gender-tile {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--p-ink);
    background-image: none;
}
.pet-app .pet-gender-tile:has(input:checked) {
    background: var(--p-warm);
}
.pet-app .pet-gender-symbol,
.pet-app .pet-gender-label {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    color: var(--p-ink);
}

/* 输入框（领养命名等） */
.pet-app .pet-input {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: inset 2px 2px 0 var(--p-paper-soft);
    color: var(--p-ink);
    font-family: 'Zpix', 'Pixelify Sans', 'LXGW WenKai', sans-serif;
    font-size: 14px;
    padding: 8px 10px;
}
.pet-app .pet-input:focus {
    outline: 2px solid var(--p-accent);
    outline-offset: 2px;
}

/* 登录闸 — 像素方块 bullet 替代 🐾 */
.pet-app .pet-login-features li::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--p-accent);
    border: 2px solid var(--p-ink);
    position: absolute;
    left: 0;
    top: 12px;
    font-size: 0;
    image-rendering: pixelated;
}
.pet-app .pet-login-features li {
    color: var(--p-ink);
    font-family: 'LXGW WenKai', serif;
    font-size: 14px;
    padding-left: 22px;
}
.pet-app .pet-login-dialog {
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 6px 6px 0 var(--p-ink);
    background-image: none;
}
.pet-app .pet-login-game-name {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 24px;
    color: var(--p-ink);
    letter-spacing: 0.06em;
}
.pet-app .pet-login-tagline {
    font-family: 'LXGW WenKai', serif;
    color: var(--p-ink-soft);
}

.pet-app .pet-login-back {
    color: var(--p-ink-soft);
    font-family: 'LXGW WenKai', serif;
}

/* 室内 "猫咪外出探险中" 的 🐾 emoji 改为像素方块 */
.pet-app .pet-indoor-away-note {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    background: var(--p-paper);
    border: 2px solid var(--p-ink);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--p-ink);
    color: var(--p-ink);
    font-size: 12px;
    padding: 8px 12px;
}

/* 商店/相册卡片：商店子标题 */
.pet-app .pet-shop-card h3,
.pet-app .pet-album-card h3 {
    font-family: 'Zpix', 'Pixelify Sans', sans-serif;
    font-size: 12px;
    font-weight: normal;
    color: var(--p-ink);
    margin: 6px 0 2px;
    letter-spacing: 0.04em;
}
.pet-app .pet-shop-card p,
.pet-app .pet-album-card p {
    font-family: 'LXGW WenKai', serif;
    font-size: 11px;
    color: var(--p-ink-soft);
    margin: 0;
}

/* === 移动 / 平板：保持上下堆叠但去多余 padding === */
@media (max-width: 1023px) {
    .pet-app {
        padding: 12px;
    }
    .pet-app .pet-card.pet-scene {
        min-height: 60vh;
    }
    .pet-app .pet-shell {
        gap: 12px;
    }
    .pet-app .pet-action-bar {
        position: sticky;
        bottom: 8px;
        background: var(--p-paper);
        border: 2px solid var(--p-ink);
        box-shadow: 4px 4px 0 var(--p-ink);
        padding: 8px;
        z-index: 30;
    }
    /* 移动主 3 颗占满 */
    .pet-app .pet-action-bar #petownFeedBtn,
    .pet-app .pet-action-bar #petownPlayBtn,
    .pet-app .pet-action-bar #petownExpeditionBtn {
        flex: 1 1 0;
        font-size: 13px;
    }
    /* 移动副 3 颗较小 */
    .pet-app .pet-action-bar #petownShopBtn,
    .pet-app .pet-action-bar #petownAlbumBtn,
    .pet-app .pet-action-bar #petownDiaryBtn {
        font-size: 11px;
        padding: 8px;
    }
}
