:root {
  color-scheme: light;
  --paper: #f1efe9;
  --ink: #35392f;
  --muted: #656c5e;
  --accent: #68715c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; border: 0; background: none; }
a, button { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #727d60; outline-offset: 7px; }
svg { display: block; }
.pocket { position: relative; isolation: isolate; min-height: 800px; height: 100svh; overflow: clip; }

/* Quiet chrome. The rooms and JJ are the main subjects. */
.masthead { position: relative; z-index: 30; height: 100px; margin: 0 5%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; font-size: 13px; font-weight: 500; letter-spacing: .5px; }
.brand svg { width:36px; height:32px; flex:none; }
html[data-pocket-arriving]::after {
  content:""; position:fixed; inset:0; z-index:2147483646; pointer-events:none;
  background:var(--paper); animation:pocket-arrive 360ms cubic-bezier(.22,.61,.36,1) both;
}
@keyframes pocket-arrive { from { opacity:1; } to { opacity:0; } }
html[data-pocket-arriving][data-pocket-return]::after { animation: none; opacity: 1; }
html[data-pocket-arriving][data-pocket-return-ready]::after { animation-duration: 120ms; }
.catalog { position: relative; font-size: 12px; }
.catalog summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; }
.catalog summary::-webkit-details-marker { display: none; }
.catalog summary > span { padding: 3px 7px; border: 1px solid #a4aa9955; border-radius: 10px; font-size: 10px; }
.catalog nav { position: absolute; right: 0; top: 35px; min-width: 280px; padding: 10px; background: #f9f8f3f7; border: 1px solid white; border-radius: 16px; box-shadow: 0 16px 50px #343c2a20; backdrop-filter: blur(16px); }
.catalog nav a { display: flex; align-items: center; gap: 16px; padding: 15px 10px; border-radius: 8px; font-size: 11px; color: var(--muted); }
.catalog nav a:hover { background: #e9ece2; }
.catalog nav a span { flex: 1; font-size: 13px; color: var(--ink); }
.introduction { position: absolute; z-index: 10; left: 0; right: 0; top: 136px; text-align: center; pointer-events: none; }
.introduction h1 { margin: 0; font-size: 36px; font-weight: 450; line-height: 1.4; letter-spacing: 3px; }
.intro-copy { margin: 14px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 1px; }

/* A single soft depth cue, without rings, particles or decorative labels. */
.space { position: absolute; left: 10%; right: 10%; top: 235px; bottom: 175px; }
.portal { position: absolute; inset: -10% -5%; pointer-events: none; background: radial-gradient(ellipse at 51% 50%, #cbd0c965, #deded551 42%, #f1efe900 72%); }
.room-stage { position: absolute; z-index: 9; inset: 0; touch-action: pan-y; perspective: 1200px; }
.room-object { --accent: #a9ad9b; position: absolute; left: 0; top: 0; width: 310px; height: 350px; display: flex; flex-direction: column; border-radius: 24px; transform-style: preserve-3d; will-change: transform; isolation: isolate; user-select: none; cursor: grab; outline-offset: 10px; box-shadow: 0 28px 38px -30px #444e3e65, 4px 4px 0 -1px #c0c3b760, 5px 5px 0 #fff9, 0 0 0 1px #fff; transition: opacity .35s; }
.room-object:active { cursor: grabbing; }
.is-touch-holding #paw-grip-canvas { z-index: 10; }
.room-object::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: linear-gradient(135deg, #ffffffad, #ffffff25 40%, #ffffff85), linear-gradient(160deg, color-mix(in srgb, var(--accent) 13%, transparent), #f7f8f344); backdrop-filter: blur(7px); border: 1px solid #fffa; }
.room-object::after { content: ""; position: absolute; inset: 1px; pointer-events: none; border-radius: 23px; background: linear-gradient(115deg, transparent 16%, #fff3 17%, transparent 34%, transparent 75%, #fff2 76%, transparent 80%); box-shadow: inset 0 0 14px #fff6; opacity: .7; }
.room-object.selected { box-shadow: 0 32px 40px -30px #444e3e80, 4px 4px 0 -1px #c0c3b760, 5px 5px 0 #fffb, 0 0 0 1px #fff; }
.room-miniature { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding-top: 10px; transform: translateZ(25px); pointer-events: none; }
.room-miniature::before { content: ""; position: absolute; width: 62%; height: 22%; left: 19%; bottom: 16%; border-radius: 50%; background: #3e493523; filter: blur(16px); transform: rotate(-15deg); }
.room-miniature img { position: relative; object-fit: contain; width: 112%; height: 108%; max-width: none; filter: drop-shadow(0 12px 7px #373e2d13); pointer-events: none; }
.room-object[data-preview="missing"] .room-miniature::after { content: "影像暂时走丢了\A 房间依然为你敞开"; white-space: pre; text-align: center; line-height: 2; font-size: 12px; color: var(--muted); }
.object-bottom { padding: 4px 22px 22px; position: relative; z-index: 2; transform: translateZ(12px); }
.object-name { display: block; max-width: 85%; font-size: 16px; font-weight: 500; letter-spacing: .3px; }
.object-enter { position: absolute; right: 20px; bottom: 18px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #fffa; border-radius: 50%; font-size: 17px; background: #fff5; transition: background .2s, transform .2s; }
.room-object:hover .object-enter, .room-object:focus-visible .object-enter { background: #fff; transform: rotate(45deg); }
.explore-hint { position: absolute; bottom: -12px; left: 0; right: 0; margin: 0; text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--muted); pointer-events: none; }
.touch-hint { display: none; }
/* Pads face the viewer: the palm belongs behind the glass, above its backdrop. */
#paw-canvas, #paw-grip-canvas { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .6s; }
.has-paw #paw-canvas, .has-paw #paw-grip-canvas { opacity: 1; }

.selection { position: absolute; z-index: 10; left: 15%; right: 15%; bottom: 91px; display: flex; justify-content: center; }
.enter-room { display: inline-flex; align-items: center; gap: 16px; font-size: 13px; padding: 8px; }
.enter-arrow { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; background: var(--ink); color: #fff; transition: transform .25s; }
.enter-room:hover .enter-arrow { transform: rotate(45deg); background: var(--accent); }
.bottom-bar { position: absolute; z-index: 12; bottom: 0; left: 5%; right: 5%; height: 74px; display: flex; justify-content: center; align-items: center; }
.room-controls { display: flex; align-items: center; gap: 24px; }
.room-controls button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #a7ad9b65; font-size: 15px; }
.room-controls button:hover { background: #fff8; }
.room-controls span { font-size: 10px; letter-spacing: 2px; min-width: 51px; text-align: center; color: var(--muted); }
#motion-toggle { position: absolute; right: 0; padding: 12px 0 12px 12px; font-size: 10px; color: var(--muted); }
#motion-toggle > span:first-child { font-size: 15px; margin-right: 4px; }
.room-status { position: absolute; z-index: 20; bottom: 139px; left: 5%; right: 5%; text-align: center; font-size: 11px; line-height: 1.7; color: #80634b; }
.room-status:empty { display: none; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 14px; background: white; }
.skip-link:focus { top: 10px; }
.no-script { position: absolute; z-index: 25; left: 50%; top: 46%; transform: translate(-50%,-50%); width: min(88%, 400px); padding: 28px; border-radius: 18px; background: #fff; font-size: 13px; }
.no-script a { display: block; margin-top: 16px; color: var(--accent); }

/* The selected piece keeps its identity through take-out; links stay usable. */
.journey { position: absolute; inset: 0; pointer-events: none; }
.journey[hidden] { display: none; }
.journey-wash { position: fixed; z-index: 50; inset: 0; background: var(--paper); opacity: 0; transition: opacity .9s ease; }
.journey.arriving .journey-wash { opacity: .94; }
/* The take-out remains the subject. A paper fade keeps the small caption
   legible when the expanding room eventually passes behind it. */
.journey::after { content: ""; position: fixed; z-index: 59; inset: auto 0 0; height: clamp(170px, 26svh, 240px); background: linear-gradient(to top, var(--paper), #f1efe9f7 62%, #f1efe900); opacity: 0; transition: opacity .25s; }
.journey-copy { position: fixed; z-index: 60; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 40px), 440px); display: flex; flex-wrap: wrap; justify-content: center; column-gap: 20px; text-align: center; pointer-events: auto; opacity: 0; transition: opacity .25s; }
.journey.arriving .journey-copy, .journey.arriving::after { opacity: 1; }
.journey:has(:focus-visible) .journey-copy, .journey:has(:focus-visible)::after { opacity: 1; }
.journey-copy h2 { flex-basis: 100%; margin: 0 0 6px; font-size: 16px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.journey-copy p { flex-basis: 100%; margin: 0 0 4px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.journey-copy a, .journey-copy button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 4px; font-size: 12px; line-height: 1.5; }
.journey-copy a { text-decoration: underline; text-decoration-color: #9aa18f; text-underline-offset: 5px; }
.journey-copy button { gap: 8px; color: var(--muted); }
.journey-copy button span { font-size: 11px; }
.journey-copy a:hover, .journey-copy button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.journey-copy :focus-visible { outline-width: 2px; outline-offset: 3px; }
.is-travelling { isolation: auto; }
.is-travelling .room-object:not(.picked) { opacity: 0; pointer-events: none; }
.is-travelling .introduction, .is-travelling .selection, .is-travelling .explore-hint { opacity: 0; transition: opacity .25s; }
.is-travelling .space { z-index: 52; }
.is-travelling #paw-canvas { z-index: 51; }
.is-travelling #paw-grip-canvas { z-index: 53; }
.is-travelling .portal { visibility: hidden; }
.is-travelling .picked { pointer-events: none; }
.is-travelling .masthead, .is-travelling .bottom-bar { pointer-events: none; }
.is-travelling .picked::after { opacity: .3; }
.is-travelling .picked .object-bottom { opacity: var(--label-opacity, 1); }
.motion-paused .room-object { will-change: auto; }

@media (min-width: 1700px) {
  .space { left: 17%; right: 17%; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .space { left: 5%; right: 5%; top: 220px; bottom: 170px; }
  .room-object { width: 270px; height: 310px; }
  .introduction { top: 115px; }
  .introduction h1 { font-size: 32px; }
}
@media (max-width: 900px) {
  .room-object { -webkit-touch-callout: none; }
  .pocket { min-height: 760px; }
  .masthead { height: 82px; margin: 0 7%; }
  .brand { font-size: 11px; gap: 8px; letter-spacing: 0; }
  .brand svg { width:30px; height:27px; }
  .catalog { font-size: 11px; }
  .catalog summary { gap: 8px; }
  .catalog nav { min-width: 260px; }
  .introduction { top: 115px; left: 7%; right: 7%; text-align: left; }
  .introduction h1 { font-size: 29px; letter-spacing: 2px; }
  .intro-copy { margin-top: 13px; font-size: 12px; letter-spacing: .3px; }
  .space { left: 0; right: 0; top: 230px; bottom: 185px; min-height: 320px; }
  .room-object { width: 240px; height: 286px; border-radius: 22px; }
  .room-object::after { border-radius: 21px; }
  .room-miniature { padding-top: 7px; }
  .room-miniature img { width: 110%; height: 107%; }
  .object-bottom { padding: 0 18px 20px; }
  .object-name { font-size: 15px; max-width: 83%; }
  .object-enter { right: 15px; bottom: 16px; width: 27px; height: 27px; }
  .explore-hint { bottom: -15px; font-size: 10px; letter-spacing: .4px; }
  .desktop-hint { display: none; }
  .touch-hint { display: inline; }
  .selection { bottom: 82px; left: 5%; right: 5%; }
  .enter-room { font-size: 12px; gap: 14px; }
  .enter-arrow { width: 32px; height: 32px; font-size: 18px; }
  .bottom-bar { height: 64px; left: 7%; right: 7%; justify-content: flex-start; }
  .room-controls { gap: 19px; }
  .room-controls button { width: 31px; height: 31px; font-size: 14px; }
  .room-controls span { font-size: 9px; min-width: 48px; }
  #motion-toggle { font-size: 9px; }
  .room-status { bottom: 127px; font-size: 10px; }
  .journey-copy { bottom: max(18px, env(safe-area-inset-bottom)); column-gap: 16px; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .pocket { min-height: 900px; }
  .introduction { top: 137px; text-align: center; }
  .introduction h1 { font-size: 34px; }
  .space { top: 270px; bottom: 210px; left: 5%; right: 5%; }
  .room-object { width: 310px; height: 350px; }
  .object-name { font-size: 18px; }
  .object-bottom { padding: 4px 22px 22px; }
  .object-enter { right: 20px; bottom: 20px; }
  .selection { bottom: 100px; }
  .enter-room { font-size: 13px; }
  .bottom-bar { height: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .room-object { will-change: auto; }
}
