/* 溜猫广场：纸箱 + 印章 + 手写标签
   颜色：纸板 #d6b07a / 深纸板 #b98d55 / 标签纸 #fffaf0 / 墨 #2b2420 / 印泥红 #c8372d / 天空 #cfe6ef / 草 #9fc76d */

:root {
  color-scheme: light;
  --kraft: #d6b07a;
  --kraft-d: #b98d55;
  --kraft-dd: #8a6d4b;
  --paper: #fffaf0;
  --ink: #2b2420;
  --ink-2: #6d5f52;
  --seal: #c8372d;
  --seal-d: #a52a22;
  --sky: #cfe6ef;
  --grass: #9fc76d;
  --good: #4f8a3c;
  --display: 'ZCOOL KuaiLe', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.6 var(--body);
  color: var(--ink);
  background: var(--sky);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.35em; margin: 0 0.1em;
  font: 600 11px/1.6 var(--body); text-align: center;
  background: var(--paper); border: 1px solid var(--kraft-d); border-bottom-width: 2px; border-radius: 4px;
}

/* ---------- 纸板质感 ---------- */
.kraft {
  background-color: var(--kraft);
  background-image: repeating-linear-gradient(90deg, rgba(91, 61, 31, 0.07) 0 3px, transparent 3px 9px);
  color: var(--ink);
}

/* ---------- 印章字：2×2 方块 ---------- */
.logo {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: 1fr 1fr;
  direction: rtl;               /* 印章从右往左读：右列“溜猫”，左列“广场” */
  gap: 0;
  margin: 0;
  padding: 0.12em;
  font: 400 clamp(44px, 9vw, 72px)/1 var(--display);
  color: var(--paper);
  background: var(--seal);
  border-radius: 0.08em;
  box-shadow: inset 0 0 0 0.05em var(--seal), inset 0 0 0 0.085em var(--paper);
  transform: rotate(-4deg);
}
.logo span { display: block; padding: 0.04em 0.06em; direction: ltr; }
.logo.small { font-size: 26px; transform: rotate(-4deg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 2px solid var(--ink);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 0.08s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.seal { background: var(--seal); color: var(--paper); border-color: var(--seal-d); box-shadow: 0 3px 0 var(--seal-d); }
.btn.seal:active:not(:disabled) { box-shadow: 0 2px 0 var(--seal-d); }
.btn.ghost { background: var(--paper); }
.btn.big { min-height: 54px; padding: 0 34px; font-size: 18px; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn input[type='file'], label.btn input[type='file'] { display: none; }
.link { background: none; border: 0; padding: 8px 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 4px; }
.link.small { font-size: 13px; }
.ibtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; border: 2px solid var(--ink); background: var(--paper);
}
.ibtn.small { width: 32px; height: 32px; border-radius: 50%; border-width: 1.5px; }
.ibtn.kraft { background-color: var(--kraft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- 启动 ---------- */
.screen { position: fixed; inset: 0; }
.boot { display: grid; place-content: center; justify-items: center; gap: 28px; text-align: center; padding: 24px; }
.boot-msg { margin: 0; color: var(--ink-2); max-width: 30em; }
.boot-msg.err { color: var(--seal-d); font-weight: 600; }

/* ---------- 登记 ---------- */
.create { display: grid; grid-template-columns: 1fr minmax(380px, 460px); background: var(--sky); }
.create-stage { position: relative; min-height: 0; }
.create-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage-hint { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0; text-align: center; color: var(--ink-2); font-size: 13px; pointer-events: none; }
.create-panel { display: flex; flex-direction: column; min-height: 0; border-left: 3px solid var(--ink); }
.create-head { padding: 22px 28px 6px; display: flex; align-items: center; gap: 16px; }
.create-head .sub { margin: 0; font-weight: 600; }
.steps { list-style: none; display: flex; gap: 6px; margin: 14px 28px 0; padding: 0; }
.steps li { flex: 1; }
.steps button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 6px; border: 0; border-radius: 10px 10px 0 0;
  background: rgba(255, 250, 240, 0.35); font-weight: 600; font-size: 14px;
}
.steps .num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; }
.steps button[aria-selected='true'] { background: var(--paper); }
.steps button.done .num { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step-body { flex: 1; overflow-y: auto; margin: 0 28px; padding: 20px 20px 24px; background: var(--paper); border-radius: 0 0 12px 12px; }
.create-foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 28px calc(18px + var(--safe-b)); }
.lead { margin: 0 0 14px; }
.hint { color: var(--ink-2); font-size: 13px; margin: 8px 0; }
.err { color: var(--seal-d); font-weight: 600; }

.photo-box {
  position: relative; border: 2px dashed var(--kraft-d); border-radius: 12px; background: #f5ecdc;
  min-height: 200px; display: grid; place-items: center; overflow: hidden; margin-bottom: 10px;
}
.photo-box.over { border-color: var(--seal); }
.photo-box canvas { display: none; max-width: 100%; max-height: 52vh; touch-action: none; cursor: crosshair; }
.photo-box.has { border-style: solid; background: var(--ink); }
.photo-box.has canvas { display: block; }
.photo-drop { display: grid; justify-items: center; gap: 10px; padding: 40px 20px; cursor: pointer; font-weight: 700; }
.photo-drop input { display: none; }
.drop-ico {
  width: 54px; height: 54px; border-radius: 50%; background: var(--seal);
  -webkit-mask: radial-gradient(circle at 50% 62%, #000 34%, transparent 35%), radial-gradient(circle at 22% 34%, #000 11%, transparent 12%), radial-gradient(circle at 41% 20%, #000 11%, transparent 12%), radial-gradient(circle at 60% 20%, #000 11%, transparent 12%), radial-gradient(circle at 78% 34%, #000 11%, transparent 12%);
  mask: radial-gradient(circle at 50% 62%, #000 34%, transparent 35%), radial-gradient(circle at 22% 34%, #000 11%, transparent 12%), radial-gradient(circle at 41% 20%, #000 11%, transparent 12%), radial-gradient(circle at 60% 20%, #000 11%, transparent 12%), radial-gradient(circle at 78% 34%, #000 11%, transparent 12%);
}
.photo-result { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #f5ecdc; }
.res-guess { margin: 0 0 6px; }
.res-guess b { font: 22px var(--display); margin-left: 6px; }
.res-colors { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.res-colors i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 5px; vertical-align: -2px; border: 1px solid rgba(0, 0, 0, 0.2); }

.grp { margin-bottom: 22px; }
.grp h3 { margin: 0 0 10px; font: 20px var(--display); }
.ctl { margin-bottom: 14px; }
.ctl-label { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ctl-val { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 6px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 600;
}
.preset i { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 55%, var(--b) 55%); border: 1px solid rgba(0, 0, 0, 0.25); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(43, 36, 32, 0.25); background: var(--c); padding: 0; }
.sw[aria-checked='true'] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.seg { display: flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { flex: 1; min-height: 36px; border: 0; background: var(--paper); font-size: 13px; font-weight: 600; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-checked='true'] { background: var(--ink); color: var(--paper); }
.slider { position: relative; padding-bottom: 2px; }
input[type='range'] { width: 100%; height: 28px; margin: 0; background: transparent; accent-color: var(--seal); }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-weight: 600; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { width: 42px; height: 24px; border-radius: 999px; background: #e3d6c2; border: 2px solid var(--ink); position: relative; flex: none; transition: background 0.15s; }
.toggle-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform 0.15s; }
.toggle input:checked + .toggle-ui { background: var(--seal); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); background: var(--paper); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--seal); outline-offset: 2px; }

.voice-opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 8px; border: 2px solid #e3d6c2; border-radius: 12px; }
.voice-opt.on { border-color: var(--ink); }
.voice-main { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.voice-main input { accent-color: var(--seal); width: 18px; height: 18px; }
.voice-text { display: grid; }
.voice-text small { color: var(--ink-2); }
.voice-tools { width: 100%; display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.rec-level { flex: 1; height: 8px; border-radius: 4px; background: #e3d6c2; overflow: hidden; }
.rec-level i { display: block; height: 100%; background: var(--seal); transform-origin: left; transform: scaleX(0); }

.field { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.field input { min-height: 46px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-size: 17px; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 6px 0 0; padding: 14px; background: #f5ecdc; border-radius: 10px; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 600; }

/* ---------- 通行证 ---------- */
.pass { display: grid; place-items: center; padding: 20px; background: var(--sky); overflow: auto; }
.pass-wrap { display: grid; justify-items: center; gap: 26px; width: min(760px, 100%); }
.pass-card-holder { position: relative; width: 100%; }
.pass-card-holder canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 0 rgba(43, 36, 32, 0.18)); }
.pass-seal { position: absolute; right: 6%; bottom: 8%; font-size: clamp(30px, 6.4vw, 54px); opacity: 0; }
.pass-seal.stamped { opacity: 0.94; transform: rotate(-8deg); }
.pass-seal.stamp { animation: stamp 0.55s cubic-bezier(0.3, 0, 0.2, 1) forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-20deg); }
  65% { opacity: 1; transform: scale(0.94) rotate(-7deg); }
  100% { opacity: 0.94; transform: scale(1) rotate(-8deg); }
}
.pass-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- 广场 ---------- */
.plaza canvas#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute; left: 0; top: 0; display: grid; justify-items: center;
  font-size: 12px; line-height: 1.3; white-space: nowrap; will-change: transform;
}
.tag b {
  padding: 1px 8px; border-radius: 6px; background: rgba(255, 250, 240, 0.9); color: var(--ink);
  font-weight: 700; box-shadow: 0 1px 0 rgba(43, 36, 32, 0.25);
}
.tag.me b { background: var(--ink); color: var(--paper); }
.tag.friend b::before { content: '♥ '; color: var(--seal); }
.tag.stray b { background: var(--kraft); }
.tag small { margin-top: 2px; padding: 0 6px; border-radius: 4px; background: rgba(43, 36, 32, 0.6); color: var(--paper); font-size: 11px; }
.bubble {
  order: -1; margin-bottom: 4px; padding: 4px 10px; border-radius: 12px; background: #fff; border: 2px solid var(--ink);
  font-weight: 700; font-size: 14px; position: relative; animation: pop 0.22s ease-out;
}
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; background: #fff; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.hud-top {
  position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 12px; font-weight: 700; }
.me-chip { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.2; }
.me-name { font: 18px var(--display); }
.me-line { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.fish-chip b { font-size: 18px; min-width: 1.5em; }
.fish-chip.bump { animation: bump 0.4s; }
@keyframes bump { 40% { transform: scale(1.15); } }
.fish-ico {
  width: 26px; height: 14px; background: #f2a446; border: 2px solid var(--ink);
  border-radius: 50% 40% 40% 50% / 50%; position: relative; margin-right: 4px;
}
.fish-ico::after { content: ''; position: absolute; right: -9px; top: 0; border: 5px solid transparent; border-left: 7px solid var(--ink); }
.clock { margin-left: 4px; padding: 4px 10px; border-radius: 8px; background: rgba(255, 250, 240, 0.75); font-weight: 700; font-size: 13px; }
.hud-nav { margin-left: auto; display: flex; gap: 8px; }

.stray-tag {
  position: absolute; left: 12px; top: calc(70px + var(--safe-t)); width: min(300px, calc(100vw - 24px));
  padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px; font-size: 13px;
}
.stray-tag h3 { margin: 0; font: 22px/1.2 var(--display); }
.st-desc { margin: 2px 0 8px; color: var(--ink); opacity: 0.8; }
.st-tip { margin: 8px 0 0; }
.trust { display: flex; align-items: center; gap: 8px; }
.trust-name { font-weight: 700; min-width: 2.5em; }
.trust-num { font-weight: 700; min-width: 2em; text-align: right; }
.trust-bar { flex: 1; position: relative; height: 10px; border-radius: 5px; background: var(--paper); border: 1.5px solid var(--ink); overflow: hidden; }
.trust-bar > i { position: absolute; inset: 0; background: var(--seal); transform-origin: left; transition: transform 0.6s; }
.trust-bar > b { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--ink); opacity: 0.35; }

.sun-meter {
  position: absolute; left: 50%; top: calc(72px + var(--safe-t)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px;
  background: #fff3c4; border: 2px solid var(--ink); font-weight: 700; font-size: 13px;
}
.sun-meter .bar { display: block; width: 90px; height: 8px; border-radius: 4px; background: #fff; overflow: hidden; border: 1px solid var(--ink); }
.sun-meter .bar i { display: block; height: 100%; background: #f2a446; transform-origin: left; }

.prompt { position: absolute; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 10px; }
.act-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font-weight: 700; white-space: nowrap;
  box-shadow: 0 3px 0 var(--ink);
}
.act-btn small { font-weight: 400; color: var(--ink-2); }
.act-btn kbd { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.toasts { position: absolute; left: 50%; bottom: calc(170px + var(--safe-b)); transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600; animation: pop 0.2s ease-out; pointer-events: auto; max-width: 100%;
}
.toast.good { background: var(--good); }
.toast.fish { background: #e69339; color: var(--ink); }
.toast.bad { background: var(--seal); }
.toast.out { opacity: 0; transition: opacity 0.35s; }
.toast-act { border: 2px solid currentColor; background: transparent; border-radius: 999px; padding: 2px 12px; font-weight: 700; white-space: nowrap; }

.sniff-req { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); padding: 16px 18px; border: 2px solid var(--ink); border-radius: 14px; text-align: center; }
.sniff-req p { margin: 0 0 12px; font: 20px var(--display); }
.conn { position: absolute; left: 50%; top: calc(72px + var(--safe-t)); transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; display: grid; gap: 10px; justify-items: center; text-align: center; }
.conn p { margin: 0; }

.keys-hint {
  position: absolute; left: 12px; bottom: calc(12px + var(--safe-b)); display: flex; flex-wrap: wrap; gap: 4px 14px;
  max-width: 560px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 250, 240, 0.8); font-size: 12px; color: var(--ink-2);
  transition: opacity 1s 4s;
}
.keys-hint.fade { opacity: 0.25; }
.keys-hint.fade:hover { opacity: 1; transition-delay: 0s; }

.touch { display: none; }
.is-touch .keys-hint { display: none; }
.is-touch .touch { display: block; }
.joy {
  position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%;
  border: 2px solid rgba(43, 36, 32, 0.5); background: rgba(255, 250, 240, 0.35); pointer-events: none; opacity: 0;
  left: 90px; top: calc(100% - 120px);
}
.is-touch .joy { opacity: 0.55; }
.joy.on { opacity: 1; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.tbtns { position: absolute; right: 14px; bottom: calc(16px + var(--safe-b)); display: grid; grid-template-columns: repeat(2, auto); gap: 10px; justify-items: end; align-items: end; }
.tbtn { min-width: 58px; height: 58px; padding: 0 12px; border-radius: 29px; border: 2px solid var(--ink); background: var(--paper); font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--ink); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tbtn.big { width: 74px; height: 74px; border-radius: 50%; background: var(--seal); color: var(--paper); border-color: var(--seal-d); box-shadow: 0 3px 0 var(--seal-d); }
.tbtn.act { grid-column: 1 / -1; height: 46px; font-size: 14px; background: var(--kraft); }
.is-touch .prompt { display: none; }

.emote-wheel {
  position: absolute; right: 14px; bottom: calc(170px + var(--safe-b)); display: grid; gap: 6px; padding: 10px;
  border-radius: 14px; background: var(--paper); border: 2px solid var(--ink);
}
.emote-wheel button { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; text-align: left; }
.emote-wheel button:hover, .emote-wheel button:focus-visible { background: #f5ecdc; }

/* 拍照模式：除了取景，其他都收起来 */
.photo-mode .hud-top, .photo-mode .stray-tag, .photo-mode .prompt, .photo-mode .toasts, .photo-mode .touch, .photo-mode .keys-hint, .photo-mode .sun-meter { display: none !important; }
.photo-mode canvas#gl { outline: 10px solid var(--paper); outline-offset: -10px; }
.photo-ui { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: grid; justify-items: center; gap: 10px; }
.photo-tip { margin: 0; padding: 4px 12px; border-radius: 8px; background: rgba(255, 250, 240, 0.8); font-size: 13px; }
.photo-bar { display: flex; align-items: center; gap: 22px; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid var(--paper); background: var(--seal); box-shadow: 0 0 0 2px var(--ink); }
.flash { position: absolute; inset: 0; background: #fff; animation: flash 0.45s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }

/* ---------- 弹出面板 ---------- */
.sheet {
  width: min(560px, calc(100vw - 20px)); max-height: min(86vh, 860px); padding: 0; border: 3px solid var(--ink); border-radius: 18px;
  overflow: hidden; display: none; flex-direction: column;
}
.sheet[open] { display: flex; animation: sheet 0.22s ease-out; }
.sheet.wide { width: min(820px, calc(100vw - 20px)); }
.sheet::backdrop { background: rgba(43, 36, 32, 0.45); }
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 22px; }
.sheet-head h2 { margin: 0; font: 26px var(--display); }
.sheet-close { width: 40px; height: 40px; }
.sheet-body { overflow-y: auto; margin: 0 12px 12px; padding: 18px; background: var(--paper); border-radius: 12px; }
.sec { margin: 0 0 10px; font: 20px var(--display); }
.sheet-body section + section { margin-top: 22px; }
.intro p { margin: 0 0 12px; }
.intro .btn { margin-top: 6px; }
.me-sheet { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.me-sheet .row { grid-column: 1 / -1; }
.me-portrait { width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--sky); }
.stray-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1.5px dashed var(--kraft-d); }
.stray-card img { width: 110px; height: 110px; border-radius: 12px; background: var(--sky); }
.stray-card h3 { margin: 0 0 6px; font: 22px var(--display); display: flex; align-items: baseline; gap: 10px; }
.stray-card h3 small { font: 13px var(--body); color: var(--ink-2); }
.sc-tip { margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.stories { margin: 6px 0 0; padding-left: 1.4em; font-size: 14px; }
.stories li { margin-bottom: 6px; }
.stories li.locked { color: #a9998a; }
.spots { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.spots li { padding: 6px 10px; border-radius: 8px; background: #f5ecdc; font-size: 13px; }
.spots li.done { text-decoration: line-through; color: #a9998a; }
.rules p { margin: 0 0 8px; font-size: 14px; }
.dev { padding: 12px; border-radius: 10px; background: #eef4f6; }
.friend { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1.5px dashed var(--kraft-d); }
.friend img { width: 56px; height: 56px; border-radius: 50%; background: var(--sky); }
.friend b { display: block; font: 18px var(--display); }
.friend small { color: var(--ink-2); }
.empty { color: var(--ink-2); }
.shop-fish { margin: 0 0 12px; font-weight: 600; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.item { display: grid; justify-items: center; gap: 6px; padding: 10px; border-radius: 12px; border: 2px solid #e3d6c2; text-align: center; }
.item.worn { border-color: var(--seal); }
.item img { width: 110px; height: 110px; border-radius: 50%; background: var(--sky); }
.story { display: grid; justify-items: center; gap: 12px; text-align: center; }
.story img { width: 200px; height: 200px; border-radius: 50%; background: var(--sky); }
.story p { margin: 0; font-size: 17px; line-height: 1.8; max-width: 26em; text-align: left; }

/* ---------- 小屏 ---------- */
@media (max-width: 860px) {
  .create { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .create-panel { border-left: 0; border-top: 3px solid var(--ink); }
  .create-head { padding: 12px 16px 0; }
  .create-head .logo { display: none; }
  .steps { margin: 10px 16px 0; }
  .steps button { font-size: 13px; }
  .step-body { margin: 0 16px; padding: 16px 14px; }
  .create-foot { padding: 12px 16px calc(12px + var(--safe-b)); }
  .stage-hint { bottom: 8px; }
}
@media (max-width: 600px) {
  .hud-top { flex-wrap: wrap; }
  .clock { order: 5; }
  .hud-nav { gap: 6px; }
  .ibtn { width: 40px; height: 40px; }
  .stray-tag { top: auto; bottom: calc(230px + var(--safe-b)); }
  .sun-meter { top: calc(118px + var(--safe-t)); }
  .me-sheet { grid-template-columns: 1fr; }
  .me-portrait { width: 60%; justify-self: center; }
  .stray-card { grid-template-columns: 80px 1fr; }
  .stray-card img { width: 80px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
