:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; color: var(--text-primary); background: var(--neutral-bg); }
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { min-height: 100vh; display: grid; place-items: center; overflow: hidden; background: var(--neutral-bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.pet-phone { position: relative; width: min(100vw, calc(100vh * 393 / 852), 393px); aspect-ratio: 393 / 852; overflow: hidden; background: var(--neutral-surface-raised); box-shadow: 0 24px 70px rgb(0 0 0 / 14%); }
.pet-view { position: absolute; inset: 0; overflow: hidden; }
.room-view { color: #fff; background: #171211; }
.pet-room { position: absolute; inset: 0; background: url("参考图/纯背景.jpg") center / 100% 100% no-repeat; transition: background-image 120ms steps(1); }
.pet-room[data-state="sleeping"] { background-image: url("参考图/宠物吃饭.jpg"); }
.pet-room::before { display: none; }
.pet-room::after { display: none; }
.room-back, .room-message, .room-menu { position: absolute; top: calc(17px + var(--safe-top)); z-index: 6; width: 40px; height: 40px; padding: 8px; display: grid; place-items: center; border: 2px solid rgb(55 42 37 / 72%); border-radius: 6px; color: #342722; background: rgb(246 226 211 / 82%); box-shadow: 2px 2px 0 rgb(55 42 37 / 38%); cursor: pointer; backdrop-filter: blur(2px); }
.room-back { left: 18px; text-decoration: none; }
.room-message { left: 66px; width: auto; min-width: 48px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.room-menu { right: 18px; }
.room-back svg, .room-message svg, .room-menu svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; stroke-linejoin: miter; }
.room-back:active, .room-message:active, .room-menu:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgb(55 42 37 / 38%); }
.role-avatar { position: absolute; top: 0; left: 0; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border: 2px solid #382821; border-radius: 50%; background: #f2d9c8; font-size: 24px; }
.role-avatar img { width: 100%; height: 100%; object-fit: cover; }
.role-bubble { position: absolute; top: calc(5px + var(--safe-top)); left: 50px; min-width: 118px; max-width: 190px; padding: 8px 12px; border: 2px solid #382821; border-radius: 8px; color: #30231f; background: #fffaf1; box-shadow: 2px 2px 0 rgb(55 42 37 / 35%); font-family: "PingFang SC", sans-serif; font-size: 13px; font-weight: 700; line-height: 1.25; text-align: left; white-space: normal; }
.role-bubble::before { content: ""; position: absolute; bottom: -8px; left: 12px; width: 12px; height: 12px; border-right: 2px solid #382821; border-bottom: 2px solid #382821; background: #fffaf1; transform: skewY(28deg) rotate(15deg); }
.room-status { position: absolute; top: calc(18px + var(--safe-top)); right: 18px; z-index: 2; opacity: .02; }
.room-feedback { position: absolute; top: 52%; left: 67%; z-index: 5; min-width: 120px; color: #fff; font-size: 13px; font-weight: 800; line-height: 1.3; text-align: center; text-shadow: 0 2px 3px rgb(55 28 21 / 90%); pointer-events: none; }
.room-feedback:not(:empty) { animation: feedback-pop 1800ms ease both; }
.room-feedback.affection { top: 48%; left: 66%; min-width: 100px; color: #ff6682; font-family: monospace; font-size: 13px; text-shadow: 2px 0 #7c3143, 0 2px #7c3143; image-rendering: pixelated; }
.room-feedback.affection strong { display: block; font-size: 14px; }
.pixel-heart { position: absolute; color: #ff6682; font-style: normal; font-size: 12px; text-shadow: 1px 0 #7c3143; }
.heart-a { left: 8px; top: 17px; animation: pixel-heart-a 1.2s steps(4,end) both; }
.heart-b { left: 47px; top: 11px; animation: pixel-heart-b 1.2s steps(4,end) both; }
.heart-c { left: 76px; top: 24px; animation: pixel-heart-c 1.2s steps(4,end) both; }
.room-feedback.sleep { top: 43%; left: 64%; color: #fff2d8; font-family: monospace; font-size: 12px; }
.poop-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.poop { position: absolute; width: 18px; height: 13px; padding: 0; border: 2px solid #4a2b20; border-radius: 48% 52% 45% 55%; background: #7b4a2d; box-shadow: 2px 2px 0 rgb(45 29 23 / 38%); pointer-events: auto; cursor: pointer; }
.poop::after { content: ""; position: absolute; top: -4px; left: 5px; width: 5px; height: 5px; border-radius: 50%; background: #9d6440; }
.room-pet-hit { position: absolute; top: 45%; left: 57%; z-index: 2; width: 190px; height: 180px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; opacity: 0; }
.room-pet-hit::before { content: ""; position: absolute; right: 3px; bottom: 3px; left: 3px; height: 72px; border: 2px solid rgb(173 128 110 / 22%); border-radius: 50%; background: #ead8cc; box-shadow: inset 0 6px 12px rgb(255 255 255 / 28%); }
.room-pet-hit span { position: relative; z-index: 1; font-size: 76px; line-height: 1; filter: drop-shadow(0 4px 0 rgb(74 49 40 / 20%)); }
.room-home-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; image-rendering: pixelated; }
.sheep-motion { position: absolute; z-index: 3; width: 24%; height: auto; image-rendering: pixelated; pointer-events: none; }
.sheep-motion.home { top: 48%; left: 60%; }
.sheep-motion.coming { top: 70%; left: 46%; width: 23%; }
.sheep-motion.eating { top: 63%; left: 52%; width: 25%; }
.pet-room[data-state="sleeping"] .room-home-canvas, .pet-room[data-state="sleeping"] .sheep-motion { display: none; }
.pet-room.is-playing .sheep-motion { animation: sheep-hop 380ms steps(2, end); }
.pet-dock { position: absolute; right: 8px; bottom: calc(8px + var(--safe-bottom)); left: 8px; z-index: 4; height: 70px; padding: 7px 9px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; opacity: 0; }
.pet-dock button { min-width: 0; padding: 0; display: grid; place-items: center; border: 3px solid #4d555c; border-radius: 50%; color: #24282c; background: #e6eaed; box-shadow: inset 0 0 0 3px #a8b0b6; cursor: pointer; }
.pet-dock button:first-child { color: #b5484a; }
.pet-dock svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.detail-view, .catalog-view, .decorations-view, .achievements-view { overflow-y: auto; padding: calc(30px + var(--safe-top)) 20px calc(28px + var(--safe-bottom)); background: var(--neutral-bg); scrollbar-width: none; }
.catalog-view { padding: calc(30px + var(--safe-top)) 20px calc(28px + var(--safe-bottom)); background: var(--neutral-bg); }
.detail-view::-webkit-scrollbar, .catalog-view::-webkit-scrollbar, .decorations-view::-webkit-scrollbar, .achievements-view::-webkit-scrollbar { display: none; }
.section-heading { position: relative; height: 67px; display: flex; align-items: center; }
.section-heading h1 { margin: 0; font-size: 38px; font-weight: 850; letter-spacing: 0; }
.view-back { width: 40px; height: 40px; margin-right: 8px; padding: 0 0 5px; border: 0; border-radius: 50%; color: var(--text-primary); background: var(--neutral-surface); font-family: Arial, sans-serif; font-size: 36px; line-height: 1; cursor: pointer; }
.detail-tabs { height: 48px; margin: 5px 0 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail-tabs button { min-width: 0; border: 0; border-radius: 24px; color: var(--text-secondary); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.detail-tabs button.active, .detail-tabs button[data-open-view="decorations"] { color: var(--text-primary); background: var(--neutral-surface-raised); box-shadow: 0 8px 24px rgb(0 0 0 / 9%); }
.pet-profile { padding: 22px 18px; border-radius: 8px; background: var(--neutral-surface-raised); box-shadow: 0 10px 34px rgb(0 0 0 / 7%); }
.detail-view { background: var(--neutral-surface-raised); }
.profile-top { display: grid; grid-template-columns: 126px minmax(0, 1fr); gap: 18px; align-items: center; }
.profile-image { width: 126px; height: 126px; display: grid; place-items: center; border-radius: 8px; background: var(--neutral-bg); font-size: 74px; }
.profile-image img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.profile-title { display: flex; align-items: center; justify-content: space-between; }
.profile-title h2 { margin: 0; font-size: 29px; line-height: 1.2; }
.profile-title span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text-secondary); background: var(--neutral-bg); font-weight: 800; }
.profile-copy > strong { display: block; margin-top: 12px; font-size: 25px; }
.level-track { height: 8px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: var(--border); }
.level-track i { display: block; width: 100%; height: 100%; background: var(--accent); }
.pet-stats { margin: 20px 0; display: grid; gap: 13px; }
.pet-stats div { display: flex; align-items: center; justify-content: space-between; }
.pet-stats dt { font-size: 18px; font-weight: 800; }
.pet-stats dd { margin: 0; color: var(--text-secondary); font-size: 18px; }
.status-stat dd { font-weight: 700; }
.profile-status-note { margin-top: 18px; color: var(--text-secondary); font-size: 12px; text-align: center; }
.page-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.page-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }.page-dots i.active { width: 26px; border-radius: 5px; background: var(--accent); }
.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pet-actions button { height: 50px; border: 0; border-radius: 8px; color: var(--text-primary); background: var(--neutral-bg); font-size: 18px; font-weight: 800; cursor: pointer; }
.profile-tools { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profile-tools button { height: 45px; border: 0; border-radius: 8px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 800; cursor: pointer; }
.pet-toast { min-height: 22px; margin: 14px 0 0; color: var(--text-secondary); text-align: center; font-size: 14px; }
.pet-search { height: 48px; margin: 8px 0 22px; padding: 0 14px; display: flex; align-items: center; gap: 10px; border-radius: 8px; background: var(--neutral-bg); }
.pet-search span { color: var(--text-secondary); font-size: 28px; }
.pet-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.pet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; }
.pet-card { min-width: 0; padding: 0 0 12px; border: 2px solid transparent; border-radius: 8px; color: var(--text-primary); background: var(--neutral-surface-raised); box-shadow: 0 8px 24px rgb(0 0 0 / 6%); cursor: pointer; }
.pet-card.selected { border-color: var(--accent); }
.pet-card-image { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px 6px 0 0; background: var(--neutral-bg); font-size: 46px; }
.pet-card-image img { width: 92%; height: 92%; object-fit: contain; image-rendering: pixelated; }
.pet-card > strong, .pet-card > span:not(.pet-card-image) { display: block; overflow: hidden; padding: 0 4px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pet-card > strong { margin-top: 9px; font-size: 14px; }
.pet-card > span:not(.pet-card-image) { margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
.decorations-view { background: var(--accent-tint); }
.decoration-note { margin: -5px 0 18px; color: var(--text-secondary); font-size: 13px; }
.decoration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.decoration-card { min-width: 0; padding: 0 0 11px; overflow: hidden; border: 2px solid transparent; border-radius: 9px; color: var(--text-primary); background: var(--neutral-surface-raised); box-shadow: 0 7px 20px rgb(76 48 34 / 10%); cursor: pointer; }
.decoration-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 7px 20px rgb(76 48 34 / 13%); }
.decoration-image { display: block; aspect-ratio: 393 / 852; overflow: hidden; background: var(--neutral-bg); }
.decoration-image img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.decoration-card strong, .decoration-card small { display: block; text-align: center; }
.decoration-card strong { margin-top: 9px; font-size: 14px; }
.decoration-card small { margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
.achievement-heading { height: 62px; display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; }
.achievement-heading h1 { margin: 0; text-align: center; font-size: 23px; }
.achievement-progress { width: 42px; height: 42px; display: grid; place-items: center; border: 4px solid var(--accent); border-radius: 50%; font-size: 10px; font-weight: 800; }
.achievement-grid { margin-top: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.achievement-card { min-width: 0; padding: 12px 12px 16px; border-radius: 8px; background: var(--neutral-surface-raised); box-shadow: 0 8px 26px rgb(0 0 0 / 6%); }
.achievement-card.locked { filter: grayscale(1); opacity: .45; }
.achievement-icon { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; background: var(--neutral-bg); font-size: 56px; }
.achievement-card strong, .achievement-card span { display: block; text-align: center; }
.achievement-card strong { margin-top: 10px; font-size: 16px; }
.achievement-card span { margin-top: 5px; color: var(--text-secondary); font-size: 12px; }
[hidden] { display: none !important; }
.pet-modal { position: absolute; inset: auto 12px 12px; z-index: 20; max-height: 78%; overflow: auto; padding: 14px 16px 16px; border: 2px solid #4d3a32; border-radius: 10px; color: #30231f; background: #fff8f2; box-shadow: 4px 5px 0 rgb(55 42 37 / 35%); }
.pet-modal::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgb(20 15 13 / 30%); }
.pet-modal header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pet-modal h2 { margin: 0; font-size: 19px; }
.pet-modal header button { width: 30px; height: 30px; border: 0; border-radius: 50%; color: #4d3a32; background: #eadbd1; font-size: 22px; cursor: pointer; }
.pet-modal-context, .pet-modal-note { margin: 6px 0 12px; color: #806d64; font-size: 12px; line-height: 1.5; }
.pet-modal-note.is-error { color: #9e3434; }
.pet-modal button:disabled { opacity: .5; cursor: default; }
#pet-message-context { display: none; }
.pet-message-log { min-height: 52px; max-height: 150px; overflow: auto; margin-bottom: 10px; padding: 10px; border-radius: 7px; background: #f3e5dc; font-size: 14px; line-height: 1.55; }
.pet-message-log:empty::before { content: "还没有角色消息"; color: #a18d82; }
.pet-message-item { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid #e1cdc0; }
.pet-message-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.pet-message-item small { display: block; margin-bottom: 3px; color: #a18d82; font-size: 10px; }
.pet-primary { width: 100%; min-height: 40px; border: 0; border-radius: 6px; color: #fff; background: #6d4d40; font-weight: 700; cursor: pointer; }
.pet-message-form { display: flex; gap: 7px; margin-top: 9px; }
.pet-message-form input { min-width: 0; flex: 1; height: 40px; border: 1px solid #d8c4b8; border-radius: 6px; padding: 0 10px; background: #fff; outline: 0; }
.pet-message-form button { width: 42px; border: 0; border-radius: 6px; color: #fff; background: #6d4d40; font-size: 20px; cursor: pointer; }
.pet-setting-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eadbd1; font-size: 14px; font-weight: 700; }
.pet-segment { display: flex; padding: 3px; border-radius: 6px; background: #eadbd1; }
.pet-segment button { min-width: 48px; height: 28px; border: 0; border-radius: 4px; color: #806d64; background: transparent; cursor: pointer; }
.pet-segment button.active { color: #fff; background: #6d4d40; }
.pet-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #eadbd1; cursor: pointer; }
.pet-toggle-row span { display: grid; gap: 3px; font-size: 14px; }.pet-toggle-row small { color: #917c71; font-size: 11px; font-weight: 400; }.pet-toggle-row input { position: absolute; opacity: 0; }.pet-toggle-row i { position: relative; width: 42px; height: 24px; border-radius: 12px; background: #cbbab0; }.pet-toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .16s ease; }.pet-toggle-row input:checked + i { background: #6d4d40; }.pet-toggle-row input:checked + i::after { transform: translateX(18px); }
.pet-care-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 12px; }.pet-care-grid button { min-height: 48px; border: 1px solid #d8c4b8; border-radius: 6px; color: #5e493f; background: #fff; font-size: 12px; cursor: pointer; }.pet-care-grid b { display: block; margin-top: 3px; font-size: 11px; color: #a18d82; }
@keyframes pet-hop { 50% { transform: translateY(-12px) scale(1.04); } }
@keyframes sheep-hop { 0%, 100% { transform: translateY(0) scaleX(var(--pet-flip, 1)); } 50% { transform: translateY(-7px) scaleX(var(--pet-flip, 1)); } }
@keyframes feedback-pop { 0% { opacity: 0; transform: translateY(7px) scale(.86); } 14%, 78% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-11px) scale(.96); } }
@keyframes pixel-heart-a { 0% { opacity: 0; transform: translate(7px, 8px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-3px, -22px); } }
@keyframes pixel-heart-b { 0% { opacity: 0; transform: translate(0, 10px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(2px, -29px); } }
@keyframes pixel-heart-c { 0% { opacity: 0; transform: translate(-3px, 7px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -18px); } }
@media (max-width: 480px) { :root, body { background: var(--neutral-bg); } .pet-phone { width: 100vw; height: 100vh; aspect-ratio: auto; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
