html, body {
  --plate: rgba(255, 252, 248, 0.94);
  height: 100%;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: #8ec8f2;
  color: #2c2926;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#view {
  display: block;
  width: 100%;
  height: 100%;
  cursor: auto;
  /* 逼画布单独合成一层：幕布那块「洞」靠的是"画布透明、底下的嵌播器透出来"。不单独成层，
     有的浏览器会把 iframe 那一层排到画布前面，视频就整块不见了。真遇到画布发糊再删这行。 */
  will-change: transform;
}

#view:focus {
  outline: none;
}

/* 画布和幕布那一层要分先后：屏幕画面是画布底下的一层 DOM（#screen-mount，负 z-index）。
   把 body 变成层叠上下文，那一层才压在页面底色之上、画布之下；不这么做它会掉到 body
   自己的背景后面，视频就露出不来了。它只管层叠，不影响 fixed 的定位参照。 */
body {
  isolation: isolate;
}

#boot {
  box-sizing: border-box;
  width: min(440px, calc(100% - 32px));
  padding: 18px 20px 16px;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.08);
  pointer-events: none;
}

body.opening {
  background: #c5e2f2;
}

body.opening #corner,
body.opening #where,
body.opening #crosshair,
body.opening #lift-hint,
body.opening #lower,
body.opening #hover,
body.opening #panel,
body.opening #guestbook,
body.opening #chat-bar,
body.opening #tab-hint,
body.opening #seat-hint,
body.opening #touch-pad {
  display: none;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  pointer-events: none;
  color: #f7edd8;
  background: #070b16;
  opacity: 1;
  transition: opacity 0.9s ease;
}

#loading.is-leaving { opacity: 0; }

#loading[hidden] { display: none; }

#loading-sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 38% 28% at 74% 18%, rgba(212, 170, 86, 0.2), transparent 70%),
    radial-gradient(ellipse 34% 26% at 18% 24%, rgba(96, 112, 176, 0.16), transparent 72%),
    radial-gradient(ellipse 46% 18% at 48% 62%, rgba(196, 154, 72, 0.1), transparent 70%),
    #070b16;
}

#loading-sky::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  top: 34%;
  height: 24%;
  background: radial-gradient(ellipse at center, rgba(232, 196, 120, 0.14), transparent 68%);
  transform: rotate(-8deg);
}

.load-earth {
  position: absolute;
  top: 12%;
  left: 74%;
  width: 168px;
  height: 168px;
  margin-left: -84px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 236, 206, 0.62), transparent 24%),
    radial-gradient(circle at 60% 44%, #8ea86a 0 8%, transparent 9%),
    radial-gradient(circle at 44% 60%, #c4a15c 0 6%, transparent 7%),
    radial-gradient(circle at 66% 64%, #6d8f58 0 7%, transparent 8%),
    radial-gradient(circle at 40% 48%, #2f6ea8 0 16%, transparent 17%),
    radial-gradient(circle at 42% 40%, #1c528c, #0c2748 58%, #07111f 100%);
  box-shadow:
    0 0 0 8px rgba(156, 190, 230, 0.16),
    0 0 28px rgba(176, 206, 240, 0.38),
    0 0 72px rgba(212, 170, 80, 0.32),
    inset -26px -12px 30px rgba(0, 0, 0, 0.58),
    inset 12px 8px 18px rgba(255, 226, 170, 0.32);
  animation: earth-drift 16s ease-in-out infinite alternate;
}

.load-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 8% 16%, rgba(255, 220, 150, 0.95), transparent 70%),
    radial-gradient(1.2px 1.2px at 16% 42%, rgba(255, 244, 220, 0.75), transparent 70%),
    radial-gradient(2px 2px at 24% 22%, rgba(244, 206, 120, 0.9), transparent 70%),
    radial-gradient(1px 1px at 31% 68%, rgba(255, 236, 200, 0.55), transparent 70%),
    radial-gradient(1.4px 1.4px at 38% 14%, rgba(255, 228, 170, 0.85), transparent 70%),
    radial-gradient(1px 1px at 44% 36%, rgba(255, 248, 230, 0.6), transparent 70%),
    radial-gradient(2.2px 2.2px at 52% 20%, rgba(255, 214, 130, 0.95), transparent 70%),
    radial-gradient(1px 1px at 58% 74%, rgba(255, 236, 196, 0.5), transparent 70%),
    radial-gradient(1.3px 1.3px at 63% 28%, rgba(255, 220, 150, 0.8), transparent 70%),
    radial-gradient(1px 1px at 71% 48%, rgba(255, 244, 220, 0.55), transparent 70%),
    radial-gradient(1.8px 1.8px at 78% 12%, rgba(244, 206, 120, 0.9), transparent 70%),
    radial-gradient(1px 1px at 84% 38%, rgba(255, 236, 200, 0.65), transparent 70%),
    radial-gradient(1.4px 1.4px at 90% 22%, rgba(255, 220, 150, 0.85), transparent 70%),
    radial-gradient(1px 1px at 12% 78%, rgba(255, 244, 220, 0.5), transparent 70%),
    radial-gradient(1.6px 1.6px at 28% 86%, rgba(255, 214, 140, 0.75), transparent 70%),
    radial-gradient(1px 1px at 48% 82%, rgba(255, 236, 200, 0.45), transparent 70%),
    radial-gradient(2px 2px at 86% 70%, rgba(244, 206, 120, 0.8), transparent 70%),
    radial-gradient(1.2px 1.2px at 68% 8%, rgba(255, 228, 170, 0.7), transparent 70%),
    radial-gradient(3px 3px at 20% 30%, rgba(232, 190, 110, 0.55), transparent 70%),
    radial-gradient(3.5px 3.5px at 82% 26%, rgba(255, 210, 130, 0.5), transparent 70%),
    radial-gradient(2.6px 2.6px at 40% 58%, rgba(244, 206, 140, 0.4), transparent 70%);
  background-repeat: no-repeat;
  animation: star-twinkle 4.8s ease-in-out infinite alternate;
}

@keyframes earth-drift {
  from { margin-top: 0; }
  to { margin-top: 14px; }
}

@keyframes star-twinkle {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

#loading-center {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 800px;
  max-width: calc(100% - 48px);
  text-align: center;
}

#loading-title,
#loading-credit,
#loading-label {
  color: #f7edd8;
  text-shadow:
    0 0 8px rgba(255, 228, 170, 0.95),
    0 0 18px rgba(232, 190, 96, 0.8),
    0 0 36px rgba(196, 148, 62, 0.5);
}

#loading-title {
  margin: 0;
  font-family: "Palatino Linotype", "Songti SC", "SimSun", serif;
  font-size: 60px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  line-height: 1.35;
}

#loading-credit {
  margin: 16px 0 0;
  font-family: "Palatino Linotype", "Songti SC", "SimSun", serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  line-height: 1.6;
}

#loading a { pointer-events: auto; }

#loading-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 237, 216, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

#loading-credit a:hover {
  color: #ffe6a8;
  border-bottom-color: #ffe6a8;
}

#loading-intro {
  max-width: 620px;
  margin: 24px auto 0;
  color: rgba(247, 237, 216, 0.82);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.04em;
  text-wrap: balance;
  text-shadow: 0 1px 12px rgba(7, 11, 22, 0.85);
}

#loading-hint {
  max-width: 620px;
  margin: 10px auto 0;
  color: rgba(247, 237, 216, 0.55);
  font-size: 12.5px;
  line-height: 1.8;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
}

/* 展品数跟着清单变，等宽数字让换数字时这一行不跟着跳。 */
#loading-count { font-variant-numeric: tabular-nums; }

#loading-nojs {
  max-width: 600px;
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(212, 170, 86, 0.32);
  background: rgba(255, 248, 230, 0.06);
  color: rgba(247, 237, 216, 0.9);
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

#loading-nojs a {
  color: #ffe6a8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#loading-foot {
  box-sizing: border-box;
  margin-top: 28px;
  text-align: center;
}

#loading.name-hold #loading-label,
#loading.name-hold #loading-meter {
  display: none;
}

#loading-label {
  margin: 0 0 16px;
  font-family: "Palatino Linotype", "Songti SC", "SimSun", serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  line-height: 1.6;
}

#loading-meter {
  width: 800px;
  max-width: 100%;
  margin: 0 auto;
}

#loading-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(243, 234, 220, 0.22);
  box-shadow: 0 0 16px rgba(212, 175, 90, 0.28);
}

#loading-track::before,
#loading-track::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 2px;
  height: 18px;
  background: rgba(247, 237, 216, 0.9);
  box-shadow: 0 0 8px rgba(255, 220, 150, 0.8);
}

#loading-track::before { left: 0; }
#loading-track::after { right: 0; }

#loading-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  transform: scaleX(0.06);
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(232, 214, 176, 0.2), #f4e6c4 22%, #f7edd2);
  box-shadow: 0 0 12px rgba(244, 214, 140, 0.85), 0 0 28px rgba(212, 168, 74, 0.45);
}

#lower {
  position: fixed;
  left: 22px;
  bottom: 22px;
  /* 高于 #screen-mount。放映厅播视频时，说明卡留在画面上面。 */
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: min(560px, calc(100vw - 44px));
  pointer-events: none;
  transition: left 0.32s ease, width 0.32s ease;
}

#lower #boot { width: 100%; }

/* 放映厅大屏卡（#screen-gate）一开，左边整条从上到下都被卡片占住：卡片 z-index 8、这摞只有 3，
   系统消息和聊天就整个藏在卡片后面。卡片开着时把这摞推到卡片右边，卡片收走再回来。
   判据是「卡片没 hidden、也没在收（.gate-out）」：收的时候卡片往左退，这摞跟着同步往左滑回原位，
   两者都走 0.32s ease，卡片右沿和这摞左沿一路差着 4–16px，不会互相盖住。
   18 / 338 就是 #screen-gate 的 left 与 --gate-w，动那两处时把这里一起改。 */
body:has(#screen-gate:not([hidden]):not(.gate-out)) #lower {
  left: calc(18px + 338px + 16px);
  width: min(560px, calc(100vw - 18px - 338px - 16px - 22px));
}

/* 手机档卡片 left 12、宽 min(338px, 100vw - 24px)（见下面 @media (max-width:720px) 那条），
   推过去的落点和剩下的宽度都得跟着换算式：右边界留 12px。 */
@media (max-width: 720px) {
  body:has(#screen-gate:not([hidden]):not(.gate-out)) #lower {
    left: calc(12px + min(338px, calc(100vw - 24px)) + 12px);
    width: calc(100vw - min(338px, calc(100vw - 24px)) - 36px);
  }
}

/* 竖屏手机：卡片基本占满整宽，右边剩不下能读的一列。这一档先把这摞收起来，
   同样的系统消息和聊天在右上菜单「消息」页里；卡片一关就回来。 */
@media (max-width: 600px) {
  body:has(#screen-gate:not([hidden]):not(.gate-out)) #lower { display: none; }
}

/* 机器人留言卡（#guestbook）也占住左下角：桌面固定 472，把系统消息和聊天推到卡片右边。
   落点 18 + 472 + 16，宽度按右边界留 22 算；.guest-out 退场时同大屏卡一样先退回去，
   卡片收走再归位。 */
body:has(#guestbook:not([hidden]):not(.guest-out)) #lower {
  left: calc(18px + 472px + 16px);
  width: min(560px, calc(100vw - 18px - 472px - 16px - 22px));
}

/* 手机档留言卡是 left/right 12 的满宽卡，右边没有一列可放；和 #screen-gate 的窄屏档一样收起来，
   消息改从右上菜单「消息」页看，卡片一关就回来。 */
@media (max-width: 720px) {
  body:has(#guestbook:not([hidden]):not(.guest-out)) #lower { display: none; }
}

#boot h2, #where strong, #panel h2, #guestbook-tabs button {
  font-family: "Palatino Linotype", "Songti SC", "SimSun", serif;
  font-weight: 500;
}

#boot h2 {
  margin: 0 0 2px;
  font-size: 28px;
  letter-spacing: 0.12em;
}

#boot p.boot-sub {
  margin: 0 0 12px;
  color: #5c574f;
  font-size: 15px;
  letter-spacing: 0.08em;
}

#boot p, #legend, #place {
  margin: 0;
  color: #6f6a64;
  font-size: 13px;
  line-height: 1.65;
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

#crosshair span {
  position: absolute;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #1a1816;
}

#crosshair span:nth-child(1) { left: 7px; top: 0; width: 4px; height: 7px; }
#crosshair span:nth-child(2) { left: 7px; bottom: 0; width: 4px; height: 7px; }
#crosshair span:nth-child(3) { left: 0; top: 7px; width: 7px; height: 4px; }
#crosshair span:nth-child(4) { right: 0; top: 7px; width: 7px; height: 4px; }

body.walking #crosshair { opacity: 0.95; }
body.video-aim #crosshair { opacity: 0; }
body.video-aim #view { cursor: none; }
body.walking #boot,
body.chatting #boot,
body.reading #boot,
body.reading #map-card,
body.reading #hud-row,
body.reading #lift-pad,
body.esc-card #sys-peek,
body.esc-card #chatter { display: none; }

body.esc-card #boot { pointer-events: auto; }

#where, #legend {
  text-shadow: 0 0 3px rgba(255, 252, 248, 0.95), 0 0 1px rgba(255, 252, 248, 0.95);
}

#where {
  position: fixed;
  top: 22px;
  left: 22px;
  /* 高于 #screen-mount。放映厅播视频时，楼层字留在画面上面。 */
  z-index: 3;
  pointer-events: none;
}

#day {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  max-width: 230px;
  margin-top: 12px;
  pointer-events: auto;
}

#day button {
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: #6f6a64;
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
}

#day button.on {
  color: #2c2926;
  text-shadow:
    0 0 2px rgba(255, 252, 248, 1),
    0 0 8px rgba(255, 252, 248, 0.98),
    0 0 16px rgba(255, 252, 248, 0.92);
}
#day button:focus-visible { outline: 1px solid #2c2926; outline-offset: 2px; }

body.dark-sky #where strong,
body.dark-sky #place {
  color: #f6f1ea;
  text-shadow: 0 1px 2px rgba(8, 16, 28, 0.85), 0 0 8px rgba(8, 16, 28, 0.55);
}

body.dark-sky #boot #legend,
body.dark-sky #boot #legend li,
body.dark-sky #boot #legend li.on {
  color: #6f6a64;
  text-shadow: none;
}

body.dark-sky #boot #legend li.on { color: #2c2926; }

body.dark-sky #day button { color: rgba(246, 241, 234, 0.68); }
body.dark-sky #day button.on {
  color: #fff;
  text-shadow:
    0 0 2px rgba(255, 252, 248, 0.95),
    0 0 10px rgba(255, 252, 248, 0.85);
}

#where strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0.14em;
}

#place { margin-top: 4px; }

#legend {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0 14px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-shadow: none;
  pointer-events: none;
  overflow-x: auto;
}

#legend li { opacity: 0.72; white-space: nowrap; }
#legend li.on { opacity: 1; color: #2c2926; }

/* 左下角聊天记录：不带底的发光字。系统消息排在它上面，同一套字号与行距。 */
#sys-peek,
#chatter {
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}

/* 没有系统消息时不占位置，免得聊天上面永远空出一道缝。 */
#sys-peek:empty { display: none; }

#sys-peek li,
#chatter li {
  box-sizing: border-box;
  /* 一行最多 20 个汉字宽：20 个字 + 字距（.06em×20）。 */
  max-width: 21.2em;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.06em;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: opacity 0.28s linear;
}

/* 聊天也做成同一张深色聊天条；不带“系统”签，人名加粗。
   保留换行：聊天比系统消息长，裁成一行会把话截掉。 */
#chatter li {
  padding: 4px 9px 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  /* 不加 backdrop-filter（用户 m00549 报滑动卡顿）：这摞在卡片开合时整条要横移 356px，
     每条带 blur(5px) 的聊天条都会在移动的每一帧重新采样身后的场景，十几条一起就把帧吃光了。
     深色底本来就压得住，0.63 提到 0.72 补回一点对比，肉眼几乎看不出差别。 */
  background: rgba(26, 18, 14, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  color: #f7f0e4;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  white-space: normal;
  overflow-wrap: anywhere;
}

#chatter li b {
  font-weight: 700;
}

/* 人名五色：色号由 js/presence.js 的 nameTint 按第一次出现的顺序发，同一个人固定一色。
   五色都从馆里的陶土、赭金、苔绿、雾蓝、藕紫里提亮，压得住 0.63 的深底；
   正文仍是上面的暖白 #f7f0e4，不跟着人名变色。 */
#chatter {
  --say-0: #f2ae96;
  --say-1: #efcb86;
  --say-2: #c8d7b0;
  --say-3: #b3cfe5;
  --say-4: #e0c7de;
}
#chatter li b[data-tint="0"] { color: var(--say-0); }
#chatter li b[data-tint="1"] { color: var(--say-1); }
#chatter li b[data-tint="2"] { color: var(--say-2); }
#chatter li b[data-tint="3"] { color: var(--say-3); }
#chatter li b[data-tint="4"] { color: var(--say-4); }

/* 系统消息：左下角的一行“聊天条”。深色半透底 + 砖红“系统”签，字用暖白；
   只留两条，各占一行（长了末尾省略，全文在抽屉里），约一分钟自己消失。
   签用 ::before 画，不改 pushSysPeek 的 textContent；不再用文字描边，
   12px 上描边会压掉笔画芯。 */
#sys-peek li {
  padding: 4px 9px 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  /* 同 #chatter li：不挂 blur，靠把深色底从 0.63 提到 0.72 找回对比，横向滑动才不掉帧。 */
  background: rgba(26, 18, 14, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  color: #f7f0e4;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sys-peek li::before {
  content: "系统";
  display: inline-block;
  margin-right: 7px;
  padding: 1px 5px 1.5px;
  border-radius: 3px;
  background: #a8452f;
  color: #f8ecdf;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
  vertical-align: middle;
  text-shadow: none;
}

/* 从上到下五档，从最上面 1 匀着降到最下面 0.6，每档差 0.1。
   行号由脚本按当前所在的一档写上，不按 DOM 序号，最下面到期下移后才对得上。 */
#chatter li.fade-0 { opacity: 1; }
#chatter li.fade-1 { opacity: 0.9; }
#chatter li.fade-2 { opacity: 0.8; }
#chatter li.fade-3 { opacity: 0.7; }
#chatter li.fade-4 { opacity: 0.6; }

#lift-pad {
  box-sizing: border-box;
  position: relative;
  display: none;
  flex-direction: column;
  gap: 4px;
  width: var(--map-w);
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 8px 8px 61px;
  overflow: hidden;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.12);
  color: #2c2926;
  box-shadow: 0 10px 28px rgba(44, 41, 38, 0.08);
}

#lift-pad:not([hidden]) { display: flex; }

#lift-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#lift-pad p {
  margin: 0 0 4px;
  color: #6f6a64;
  font-size: 12px;
}

#lift-pad button {
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 6px 8px;
  color: #2c2926;
  text-align: left;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.14);
  cursor: pointer;
}

#lift-pad button:hover,
#lift-pad button:focus-visible {
  border-color: #2c2926;
  outline: none;
}

#lift-pad button.chosen,
#lift-pad button.chosen:hover,
#lift-pad button.chosen:focus-visible {
  background: #3e3a36;
  border-color: #3e3a36;
  color: #fff;
}

#lift-pad button.passing,
#lift-pad button.passing:hover,
#lift-pad button.passing:focus-visible {
  background: #e4e1dc;
  border-color: #c8c4be;
  color: #2c2926;
}

#lift-pad button.chosen.passing,
#lift-pad button.chosen.passing:hover,
#lift-pad button.chosen.passing:focus-visible {
  background: #e4e1dc;
  border-color: #3e3a36;
  color: #2c2926;
}

#lift-hint {
  position: fixed;
  left: 50%;
  top: calc(50% + 36px);
  transform: translateX(-50%);
  z-index: 3;
  padding: 4px 8px;
  background: var(--plate);
  color: #2c2926;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
}



#hover {
  position: fixed;
  left: 50%;
  top: calc(50% + 22px);
  transform: translateX(-50%);
  z-index: 9;
  max-width: min(520px, calc(100% - 40px));
  padding: 4px 8px;
  /* 和大屏卡那批白卡同一个白度：原来是 --plate 的 0.8，压在画框上看字有点飘，2026-11-25 提到 92%。 */
  background: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#panel {
  position: fixed;
  top: 50%;
  /* 2026-11-28 桌面右距 28px → 128px → 178px（用户先后要求左移 100px、再左移 50px）；
     手机档见下面 720px 那条，仍贴右下角。 */
  right: 178px;
  /* 竖向居中故意用 translate 而不是 transform：transform 整条留给下面的开合动画（keyframes 要写
     translate3d，写在 transform 里会把居中顶掉）。两个属性互不覆盖，各管各的。 */
  translate: 0 -50%;
  width: min(380px, calc(100% - 36px));
  padding: 26px 26px 20px;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.1);
  box-shadow: 0 18px 50px rgba(44, 41, 38, 0.08);
  transition: right 0.32s ease, width 0.32s ease;
}

/* 抽屉从右边展开时，画框卡跟地图一样让出菜单的宽度。 */
body:has(#corner.nav-open) #panel {
  right: calc(178px + 260px + 8px);
  width: min(380px, calc(100vw - 178px - 260px - 8px - 22px));
}

/* 画框卡开合：跟汉堡菜单卡（.drawer-body.drawer-in / .drawer-out）同一套——0.32s、
   cubic-bezier(.35,.5,.35,1)、整张淡入淡出 + 从右侧 60px 处滑到位，退场原路退回，进退同一条曲线。
   类由 js/museum.js 的 openFrame() / closePanel() 挂摘：入场放完就摘，退场要等 animationend
   才把 hidden 置上。参数、坑和复用写法见 交接.md「卡片开合动画（入场 / 退场，可复用）」。 */
#panel.panel-in { animation: panel-fade-in 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both; }

@keyframes panel-fade-in {
  from { opacity: 0; transform: translate3d(60px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 动起来这 0.32s 先关掉糊底、单独声明一层（理由同 #screen-gate / .drawer-body）：卡片带
   backdrop-filter，逐帧挪会重采身后的场景。 */
#panel.panel-in, #panel.panel-out {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform, opacity;
}

#panel.panel-out {
  opacity: 1;
  pointer-events: none;
  animation: panel-fade-out 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both;
}

@keyframes panel-fade-out {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(60px, 0, 0); }
}

#panel p { margin: 0; }
#panel-hall { color: #8a847c; font-size: 12px; letter-spacing: 0.16em; }
#panel h2 { margin: 10px 0 12px; font-size: 26px; line-height: 1.35; }
#panel-blurb { color: #3d3935; font-size: 15px; line-height: 1.75; }
#panel-down { margin-top: 10px; color: #8a847c; font-size: 13px; }
#panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#panel a, #panel button {
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid #2c2926;
  padding: 8px 12px;
  background: transparent;
  color: #2c2926;
  cursor: pointer;
}
#panel-portal { background: #2c2926; color: #fffcf8; }
#panel a:focus, #panel button:focus { outline: 1px solid #2c2926; outline-offset: 2px; }

/* 四边跟放映厅大屏卡 #screen-gate 同一条线：左 18、上 62（#corner 的 18 + 汉堡按钮 36 + 间距 8）、
   下 18（#corner 的 bottom）。62 就是 fitGate() 量到的 #dock 顶边；按钮在 3143 行是 36 高，别再按
   1102 行那条旧的 32 算成 58。位置全在这里定死，js/museum.js 不再每帧写 top / bottom。
   卡片一开就占住左下角；下面 body:has(#guestbook…) 那条把系统消息和聊天推到卡右，
   手机档卡片满宽时直接收起（消息在右上菜单），别改这里的边距。 */
#guestbook {
  position: fixed;
  top: 62px;
  left: 18px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* 宽度固定 472：原来按楼层说明实宽收到 462，用户 m01015 要「当前的宽度再加 10px」。
     不再跟着字宽变；最多不越过屏幕右边 18px。 */
  width: min(472px, calc(100% - 36px));
  height: auto;
  overflow: hidden;
  padding: 16px 22px 12px;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.1);
  box-shadow: 0 18px 50px rgba(44, 41, 38, 0.08);
}
#guestbook[hidden] { display: none; }

/* 展厅机器人（留言板）卡的开合，照放映厅大屏卡那套参数（0.32s、同一条缓动、
   整张淡入淡出 + 从停位侧面 60px 处滑到位、退场不反演）。卡片贴在屏幕左边，
   所以和大屏卡一样从左侧进、往左侧退。类由 js/museum.js 的 openGuestbook() /
   closeGuestbook() 挂摘；退场期间 hidden 仍是 false，等 animationend 才收。 */
#guestbook.guest-in { animation: guest-fade-in 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both; }

@keyframes guest-fade-in {
  from { opacity: 0; transform: translate3d(-60px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 动起来这 0.32s 先关掉糊底、声明卡片单开一层（理由同 #screen-gate / .drawer-body）：
   卡片自带 backdrop-filter，逐帧挪会重采身后场景；类一摘，「白卡只此一套」那条自己回来。 */
#guestbook.guest-in, #guestbook.guest-out {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform, opacity;
}

#guestbook.guest-out {
  pointer-events: none;
  animation: guest-fade-out 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both;
}

@keyframes guest-fade-out {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(-60px, 0, 0); }
}
#guestbook p { margin: 0; }
#guestbook-tabs {
  display: flex;
  gap: 18px;
  flex: none;
  margin: 0;
  border-bottom: 1px solid rgba(44, 41, 38, 0.1);
}
#guestbook-tabs button {
  margin: 0 0 -1px;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #8a847c;
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
}
#guestbook-tabs button[aria-selected="true"] {
  color: #2c2926;
  border-bottom-color: #2c2926;
}
#guestbook-plan,
#guestbook-notes {
  flex: 1 1 auto;
  min-height: 0;
}
#guestbook-plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding-top: 10px;
}
#guestbook-plan-key {
  flex: none;
  color: #8a847c;
  font-size: 16px;
  line-height: 1.5;
}
#guestbook-plan-scroll {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(44, 41, 38, 0.35) transparent;
}
#guestbook-plan-scroll svg {
  display: block;
  flex: none;
  max-width: 100%;
  height: auto;
  /* 图比可视区矮时，上下 auto 外边距把整张示意图（含楼层说明）居中；
     图比可视区高时 auto 边距归零，仍从顶部开始滚，不会把顶上的楼层切掉。 */
  margin-block: auto;
}
#guestbook-plan[hidden],
#guestbook-notes[hidden] { display: none; }
#guestbook-notes {
  display: flex;
  flex-direction: column;
}
#guestbook #guestbook-hint {
  margin: 64px 0;
  color: #3d3935;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}
#guestbook-hint,
#guestbook-form,
#guestbook-pages { flex: none; }
#guestbook-form { margin-top: 0; text-align: right; }
#guestbook #guestbook-replying {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}
#guestbook #guestbook-replying[hidden] { display: none; }
#guestbook-reply-cancel {
  font: inherit;
  font-size: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6f6a64;
  cursor: pointer;
}
#guestbook-list #guestbook-form { margin-top: 8px; }
#guestbook textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 96px;
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid rgba(44, 41, 38, 0.18);
  background: #fff;
  color: #2c2926;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  resize: none;
}
#guestbook-send {
  margin-top: 10px;
  font: inherit;
  font-size: 14px;
  border: 1px solid #2c2926;
  padding: 8px 14px;
  background: #2c2926;
  color: #fffcf8;
  cursor: pointer;
}
#guestbook-list {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
#guestbook-list li {
  padding: 12px 16px;
  border-top: 1px solid rgba(44, 41, 38, 0.08);
}
#guestbook-list > li:last-child:not(.note-empty) {
  border-bottom: 1px solid rgba(44, 41, 38, 0.08);
}
#guestbook-list .note-empty { color: #8a847c; font-size: 14px; }
.note-meta { color: #8a847c; font-size: 14px; }
.note-text { margin-top: 4px; color: #3d3935; font-size: 16px; line-height: 1.7; }
.note-reply {
  display: block;
  width: fit-content;
  margin: 6px 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: #6f6a64;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: right;
}
.note-reply[hidden] { display: none; }
.note-replies {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
}
.note-replies li { border-top: 0; padding: 10px 16px 0 0; }
#guestbook-pages {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
#guestbook-page { color: #6f6a64; font-size: 13px; }
#guestbook-pages button {
  font: inherit;
  font-size: 14px;
  border: 1px solid transparent;
  padding: 8px 0;
  background: transparent;
  color: #6f6a64;
  cursor: pointer;
}
#guestbook-pages button:disabled { opacity: 0.35; cursor: default; }

/* 右上角那颗 ×，位置和样式跟画框卡的 #panel-close 一模一样：
   卡片本身 fixed，它就是定位框，所以绝对定位贴右上 6px。留在最后一个子元素，
   绝对定位不占 flex 位，又画在 tabs 上面，不会被 tab 行截走点击。 */
#guestbook #guestbook-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--mu-ink-soft);
  cursor: pointer;
}
#guestbook #guestbook-close:hover { background: rgba(157, 64, 48, 0.1); color: var(--mu-ink); }
#guestbook #guestbook-close:focus-visible { outline: 2px solid rgba(157, 64, 48, 0.45); outline-offset: 2px; }
#guestbook button:focus, #guestbook textarea:focus { outline: 1px solid #2c2926; outline-offset: 2px; }
#guestbook-tabs button:focus,
#guestbook-tabs button:focus-visible { outline: none; }

#corner {
  --nav-w: 260px;
  --map-w: 214px;
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 36px);
}

#corner-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

#lag,
#fps {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #6f6a64;
  pointer-events: none;
  white-space: nowrap;
}

#fps { min-width: 3.4em; }

body.dark-sky #lag,
body.dark-sky #fps { color: rgba(246, 241, 234, 0.86); }

#rail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: stretch;
  gap: 8px;
  flex: none;
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

#hud-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  width: var(--map-w);
  box-sizing: border-box;
}

#lift-toggle,
#online {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

#online,
#lift-toggle,
#drawer-toggle,
#map-card,
.drawer-body {
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.12);
  color: #2c2926;
  box-shadow: 0 10px 28px rgba(44, 41, 38, 0.08);
}

#online,
#lift-toggle,
#drawer-toggle {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 6px 10px;
  cursor: pointer;
  color: #6f6a64;
}

#lift-toggle,
#online { text-align: center; }

#drawer-toggle {
  position: relative;
  box-sizing: border-box;
  width: 36px;
  height: 32px;
  padding: 0;
  letter-spacing: 0;
}

#drawer-toggle span,
#drawer-toggle span::before,
#drawer-toggle span::after {
  position: absolute;
  width: 16px;
  height: 2px;
  background: currentColor;
}

#drawer-toggle span { left: 9px; top: 15px; }

#drawer-toggle span::before,
#drawer-toggle span::after {
  content: "";
  left: 0;
}

#drawer-toggle span::before { top: -5px; }
#drawer-toggle span::after { top: 5px; }

#online[aria-expanded="true"],
#lift-toggle[aria-expanded="true"],
#drawer-toggle[aria-expanded="true"] { color: #2c2926; }

#hud-row,
#drawer-toggle { flex: none; }

#dock {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-end;
  min-height: 0;
  overflow: hidden;
}

.toast,
#chat-input,
#name-gate {
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.1);
  color: #2c2926;
}

#map-card {
  box-sizing: border-box;
  width: var(--map-w);
  flex: none;
  padding: 8px;
}
#map { display: block; width: 100%; height: auto; }
#map-card.map-off { display: none; }

#online:focus-visible,
#lift-toggle:focus-visible,
#lift-pad button:focus-visible,
#drawer-toggle:focus-visible,
#project-link:focus-visible,
#chat-input:focus-visible,
#name-input:focus-visible,
#nav-name:focus-visible,
#name-form button:focus-visible,
#name-gate button:focus-visible,
#sort-switch input:focus-visible { outline: 1px solid #2c2926; outline-offset: 2px; }

#drawer {
  display: flex;
  flex-direction: column;
  width: 0;
  min-width: 0;
  max-height: none;
  flex: none;
  align-self: stretch;
  min-height: 0;
  /* 卡片（.drawer-body）现在绝对定位钉在右缘，关着时靠它自己的 opacity / visibility 收着，
     不再靠这里的 overflow 裁。所以这里要放开：宽度 0 → 260 的那 0.32s 里，卡片不能被抽屉
     的临时宽度一格格裁开——那样看着还是「从右往左长出来」，不是整张淡进来（用户 m00001 要的是
     大屏卡那套）。放开之后卡片自己的投影也不再被切平，跟其它白卡一样露出来。 */
  position: relative;
  overflow: visible;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  /* 缓动跟卡片那 0.32s 用同一条曲线（见下面「汉堡卡的开合动画」）：左边地图卡、画框卡都是
     跟着这道宽度让位的，两条曲线不一样，卡片自己淡自己的、旁边那几块各走各的，看着就散了。 */
  transition: width 0.32s cubic-bezier(0.35, 0.5, 0.35, 1), margin-left 0.32s cubic-bezier(0.35, 0.5, 0.35, 1);
}

#corner.nav-open #drawer {
  width: var(--nav-w);
  margin-left: 8px;
  pointer-events: auto;
  box-sizing: border-box;
  padding: 0;
  scrollbar-width: thin;
}

.drawer-body {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: var(--nav-w);
  min-width: var(--nav-w);
  max-width: var(--nav-w);
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
  margin: 0;
  padding: 20px;
  /* 卡片本身不滚：页签钉在顶上，滚动条只出现在页签下面那块内容上（见下一条）。
     滚整张卡片的话滑块会从页签旁边就开始，右边还要多占 8px，三个页签看着右宽左窄。 */
  overflow: hidden;
  /* 滚动条的样式在下面「滚动条全项目只此一套」那一块里，分浏览器各写一条。 */
  /* 钉在抽屉右缘、上下撑满（父 #drawer 是 position: relative）：抽屉宽度 0 → 260 的那段里
     卡片不跟着变宽变窄，停在最终位置上整张淡进来。关着时靠下面这几种收起来——它是绝对定位，
     不占布局、不推挤地图卡，所以也不吃抽屉那道 width 的缓动。 */
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  /* 入场从右侧屏幕边缘进来：收着的时候卡片往右偏 60px（右边那截在屏幕外），滑回来才到位。 */
  opacity: 0;
  visibility: hidden;
  transform: translate3d(60px, 0, 0);
}

/* 开着的时候就是最终停位：不透明、不偏。入场动画放完把 .drawer-in 摘掉，落回这一条。 */
#corner.nav-open .drawer-body {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* 汉堡卡的开合动画：跟放映厅大屏卡（#screen-gate 的 gate-in / gate-out）同一套做法，参数照
   `交接.md`「卡片开合动画（入场 / 退场，可复用）」那一节：0.32s、cubic-bezier(.35,.5,.35,1)、
   整张淡入淡出 + 从右往左挪 60px（入场自右侧屏幕边缘进来，退场原路退回）、进退同一条曲线
   （不做时间反演）、透明度只跟位移走同一条曲线。
   类由 js/presence.js 的 setDrawer() 挂摘：先摘类 → void offsetWidth 强制回流 → 再挂，
   关掉重开才从第 0 帧放；放完 animationend 摘掉，别让 fill 的 opacity / transform 一直挂着。 */
.drawer-body.drawer-in { animation: drawer-fade-in 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both; }

@keyframes drawer-fade-in {
  from { opacity: 0; transform: translate3d(60px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 动起来这 0.32s 先关掉糊底、并声明这卡自己单开一层（理由同 #screen-gate 那组，用户 m00523）：
   卡片带 backdrop-filter，每挪一寸身后的场景就要重新采样、重新糊一遍；0.92 白底下这点糊底
   基本看不出来，关掉不亏，类一摘下面「白卡只此一套」那条自己回来。 */
.drawer-body.drawer-in, .drawer-body.drawer-out {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform, opacity;
}

/* 退场：同一条缓动、方向反过来，透明度跟位移共用曲线、不插帧（到右边 60px 时一起归零）。
   这会儿 .nav-open 已经摘了（抽屉自己宽回去、地图卡跟着归位），卡片先靠 .drawer-out 撑着不消失：
   它是绝对定位、#drawer 又放开了 overflow，所以收这一路不会被缩窄的抽屉裁掉。 */
.drawer-body.drawer-out {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
  animation: drawer-fade-out 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both;
}

@keyframes drawer-fade-out {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(60px, 0, 0); }
}

/* 页签条不跟着内容滚；两块内容各占标签条以下的整块高度，谁长谁自己滚。
   scrollbar-gutter 留在内容块上（不是卡片上）：设置、项目两页切换时内容不横跳，
   而页签条永远没有滚动条，左右留白才一样宽。 */
#drawer-tabs { flex: none; }

.drawer-main,
.drawer-foot {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  /* 滑块不贴着卡片右边的描边：留 6px。负右外边距把这层顶出去、等量的右内边距再把字推回来，
     内容右边界不动，只把滑块往里挪 6px——设置、项目两页都是这个口径，不再一页贴边一页缩进。
     手机上卡片右内边距是 14px，见文件末尾那档跟着让 8px，仍是 6px。 */
  margin-right: -12px;
  padding-right: 12px;
}

#name-form {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}

#name-form input,
#name-gate input {
  font: inherit;
  color: #2c2926;
  background: rgba(255, 252, 248, 0.86);
  border: 1px solid rgba(44, 41, 38, 0.16);
}

#name-form input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 4px 6px;
}

#name-form button,
#name-gate button {
  font: inherit;
  cursor: pointer;
}

#name-form button {
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid #2c2926;
  background: transparent;
  color: #2c2926;
}

#drawer-switches {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 2px 0 4px;
}

/* 页签条下面那第一行：label 自带 8px 上边距，别让它顶进来，「设置」「项目」两页才和「消息」页一样紧贴页签条 */
.drawer-body > .drawer-label:first-child,
.drawer-main > .drawer-label:first-child,
.drawer-foot > .drawer-label:first-child,
.menu-head + .drawer-label { margin-top: 0; }

#map-switch,
#music-switch,
#solo-switch,
#sort-switch label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #3d3935;
  cursor: pointer;
}

#sort-switch {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 2px 0 4px;
}

#project-line { margin: 0 0 8px; }

#project-link {
  color: #3d3935;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-all;
}

#credit,
#music-credit {
  margin: 2px 0 0;
  color: #6f6a64;
  font-size: 12px;
  line-height: 1.55;
}

#help-keys {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

#help-keys li {
  margin: 0 0 8px;
  color: #3d3935;
  font-size: 13px;
  line-height: 1.75;
}

#help-keys kbd,
#tab-hint kbd,
#seat-hint kbd {
  display: inline-block;
  box-sizing: border-box;
  min-width: 1.55em;
  margin: 0 1px;
  padding: 0 0.38em;
  border: 1px solid rgba(44, 41, 38, 0.55);
  border-bottom-width: 3px;
  border-radius: 4px;
  background: #fffcf8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #2c2926;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  vertical-align: 1px;
  white-space: nowrap;
}

#tab-hint,
#seat-hint {
  position: fixed;
  left: 50%;
  bottom: 52px;
  z-index: 4;
  width: max-content;
  max-width: calc(100vw - 44px);
  margin: 0;
  transform: translateX(-50%);
  color: #2c2926;
  font-size: 18px;
  line-height: 1.75;
  text-align: center;
  pointer-events: none;
  text-shadow:
    0 0 2px rgba(255, 252, 248, 1),
    0 0 8px rgba(255, 252, 248, 0.98),
    0 0 16px rgba(255, 252, 248, 0.92);
  animation: tab-hint-pulse 2.8s ease-in-out infinite;
}

#tab-hint kbd,
#seat-hint kbd {
  font-size: 15px;
}

@keyframes tab-hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

body.dark-sky #tab-hint,
body.dark-sky #seat-hint {
  color: #f6f1ea;
  text-shadow: 0 1px 2px rgba(8, 16, 28, 0.85), 0 0 8px rgba(8, 16, 28, 0.55);
}

.drawer-label {
  margin: 8px 0 4px;
  color: #8a847c;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.menu-head {
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(44, 41, 38, 0.22);
  color: #2c2926;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.drawer-body > .menu-head:first-child,
.drawer-main > .menu-head:first-child,
.drawer-message-list > .menu-head:first-child { margin-top: 0; }

#people,
#sys-log,
#chat-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

#people li,
#sys-log li,
#chat-log li {
  font-size: 13px;
  line-height: 1.55;
  color: #3d3935;
  word-break: break-word;
}


#chat-log li { margin: 0 0 12px; }
#chat-log li:last-child { margin-bottom: 0; }

#chat-log .chat-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

#chat-log .chat-meta b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

#chat-log .chat-time {
  flex: none;
  color: #8a847c;
  font-size: 12px;
  font-weight: 400;
}

#chat-log .chat-text {
  margin: 2px 0 0;
  white-space: normal;
}

#chat-log .sys { color: #8a847c; }

/* 「消息」页底部的发话条：三段记录在它上面滚，它自己固定在抽屉底部，
   记录再长也够得着，也不会有字从它底下透出来。 */
#drawer-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(124, 71, 48, 0.14);
}

#drawer-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 13px;
  font: inherit;
  font-size: 13.5px;
  color: var(--mu-ink);
  background: #fffdf7;
  border: 1px solid rgba(124, 71, 48, 0.28);
  border-radius: 999px;
}

#drawer-chat-input:focus-visible,
#drawer-chat-send:focus-visible { outline: 1px solid #2c2926; outline-offset: 2px; }

#drawer-chat-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #fdf7ea;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

#toasts {
  position: fixed;
  top: 148px;
  left: 22px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.toast {
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
}

#chat-bar {
  position: fixed;
  left: 50%;
  bottom: 14vh;
  transform: translateX(-50%);
  z-index: 7;
  width: min(440px, calc(100% - 48px));
}

#chat-input {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
}

#panel { z-index: 5; }

/* 开始页：整块米白「展签」立在左边，右边留给南立面远景。
   配色从大楼身上取：石材米白、腰线砖红、画框草金。手机直向时改到底部一片。 */
:root,
html,
body {
  --mu-cream: #f7eedc;
  --mu-cream-hi: #fdf7ea;
  --mu-brick: #9d4030;
  --mu-brick-deep: #7c2f22;
  --mu-brass: #c99a4b;
  --mu-brass-hi: #e6bd76;
  --mu-ink: #33231c;
  --mu-ink-soft: #6d5b4d;
  --mu-ink-faint: #9c8877;
  --mu-line: rgba(124, 71, 48, 0.16);
  --mu-shadow: 0 22px 46px rgba(58, 33, 24, 0.18);
}

#name-gate {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 8;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(560px, 47vw);
  min-width: 432px;
  padding: 26px 34px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(-18px);
  pointer-events: none;
  color: var(--mu-ink);
  /* 底色留透明：底下那层渐变才透得出楼来。 */
  background-color: transparent;
  /* 面色抄羽毛球首页那片留白（--veil: 251,248,241）：左侧八成、贴楼那侧化到全透。 */
  background-image:
    linear-gradient(90deg,
      rgba(251, 248, 241, 0.8) 0%,
      rgba(251, 248, 241, 0.64) 42%,
      rgba(251, 248, 241, 0.34) 76%,
      rgba(251, 248, 241, 0) 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: 0;
  /* 右侧那道边由渐变自己收：不画线、不投影，四角都是直角。 */
  border-radius: 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

#name-gate.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* 上面写了 display:flex，hidden 属性就不再自动收起来了。 */
#name-gate[hidden] { display: none; }

/* 内容整体收窄、居中：卡片加宽了，字不用跟着拉满。 */
.gate-head, .gate-body, .gate-foot {
  width: 100%;
  max-width: 384px;
  margin-left: auto;
  margin-right: auto;
}

.gate-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.gate-mark {
  display: flex;
  flex: none;
  color: var(--mu-brick);
}
.gate-mark svg { width: 24px; height: 24px; }

.gate-brand {
  display: flex;
  flex: none;
  flex-direction: column;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.3;
  color: var(--mu-ink);
}

.gate-brand em {
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--mu-ink-faint);
}

.gate-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--mu-line);
}

/* 底子薄了，字下面补一圈白（羽毛球面板里也是这么处理的），压住背后的楼和窗。 */
.gate-kicker, .gate-lead, .gate-label, .gate-foot {
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.92);
}

.gate-body {
  /* 内容整体上移 40px：只用相对偏移，页头和页脚不动。 */
  position: relative;
  top: -40px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: 18px 0 4px;
}

.gate-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--mu-brick);
}

.gate-title {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.16;
  color: var(--mu-ink);
}

.gate-title span {
  position: relative;
  display: inline-block;
  padding: 0 0.08em 0.04em 0.02em;
}

/* 标题后面那道斜的笔触，取画框的金。 */
.gate-title span::after {
  content: "";
  position: absolute;
  left: -0.05em;
  right: -0.1em;
  bottom: 0.12em;
  z-index: -1;
  height: 0.34em;
  border-radius: 2px;
  background: linear-gradient(92deg, rgba(230, 189, 118, 0.9), rgba(201, 154, 75, 0.62) 62%, rgba(201, 154, 75, 0.18));
  transform: skewX(-11deg);
  /* 两头收干，别在字尾留一个方头。 */
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, #000 14%, #000 72%, rgba(0, 0, 0, 0.1) 100%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.3) 0%, #000 14%, #000 72%, rgba(0, 0, 0, 0.1) 100%);
}

.gate-lead {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--mu-ink-soft);
}

.gate-lead #gate-count {
  font-weight: 700;
  color: var(--mu-ink);
}

.gate-label {
  display: block;
  margin: 24px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--mu-ink-faint);
}

#name-gate input {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 14px;
  color: var(--mu-ink);
  background: #fffdf7;
  border: 1.5px solid rgba(124, 71, 48, 0.28);
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(74, 44, 26, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#name-gate input::placeholder {
  color: #b8a894;
  font-weight: 400;
}

#name-gate input:focus {
  border-color: var(--mu-brick);
  box-shadow: 0 0 0 3px rgba(157, 64, 48, 0.16);
}

#name-gate input:focus-visible {
  outline: none;
}

/* 昵称框和右边的骰子按钮并排，按钮高度跟着输入框走。 */
.gate-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gate-field input {
  flex: 1 1 auto;
  min-width: 0;
}

.gate-dice {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  padding: 0;
  color: var(--mu-brick);
  background: #fffdf7;
  border: 1.5px solid rgba(124, 71, 48, 0.28);
  border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(74, 44, 26, 0.06);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.gate-dice svg {
  width: 26px;
  height: 26px;
}

.gate-dice:hover {
  background: #fff5e3;
  border-color: var(--mu-brick);
}

.gate-dice:active {
  transform: scale(0.93);
}

.gate-dice:focus-visible {
  outline: none;
  border-color: var(--mu-brick);
  box-shadow: 0 0 0 3px rgba(157, 64, 48, 0.16);
}

.gate-enter {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 12px;
  box-sizing: border-box;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px 12px 20px;
  font: inherit;
  text-align: left;
  color: #fdf7ea;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(126, 48, 34, 0.28), inset 0 1px 0 rgba(255, 220, 180, 0.22);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.gate-enter-main {
  grid-column: 1;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.gate-enter-sub {
  grid-column: 1;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(253, 240, 220, 0.76);
}

.gate-chev {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  opacity: 0.9;
}

.gate-enter:hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 30px rgba(126, 48, 34, 0.32), inset 0 1px 0 rgba(255, 220, 180, 0.28);
}

.gate-enter:active { transform: translateY(1px); }

.gate-enter:focus-visible {
  outline: 2px solid var(--mu-brick-deep);
  outline-offset: 3px;
}

.gate-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.gate-card {
  position: relative;
  display: flex;
  box-sizing: border-box;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font: inherit;
  text-align: left;
  color: var(--mu-ink);
  background: rgba(255, 252, 244, 0.72);
  border: 1px solid rgba(124, 71, 48, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.gate-card:hover {
  background: #fffdf6;
  border-color: rgba(157, 64, 48, 0.45);
  transform: translateY(-1px);
}

.gate-card:active { transform: none; }

.gate-card:focus-visible {
  outline: 2px solid var(--mu-brick-deep);
  outline-offset: 2px;
}

.gate-card-icon {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--mu-brick);
}

.gate-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.gate-card-text b {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gate-card-text small {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--mu-ink-faint);
}

.gate-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0483a;
  box-shadow: 0 0 0 3px rgba(208, 72, 58, 0.16);
}

.gate-dot[hidden] { display: none; }

.gate-foot {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 16px 0 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mu-ink-faint);
}

.gate-foot span:not(:first-child)::before {
  content: "·";
  margin-right: 8px;
  color: rgba(156, 136, 119, 0.6);
}

/* 手机上换成触屏的说法。 */
.gate-foot-touch { display: none; }
body.touch-play .gate-foot-keys { display: none; }
body.touch-play .gate-foot-touch { display: flex; }

/* 公告：开始页上唯一的一个浮层，样式跟面板同一套。 */
#notice {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 15, 10, 0.42);
  backdrop-filter: blur(3px);
}

#notice[hidden] { display: none; }

#notice-card {
  box-sizing: border-box;
  width: min(520px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 24px 28px 20px;
  color: var(--mu-ink);
  background: linear-gradient(180deg, #fdf7ea, #f3e8d4);
  border: 1px solid var(--mu-line);
  border-top: 4px solid var(--mu-brick);
  border-radius: 18px;
  box-shadow: var(--mu-shadow);
}

#notice-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--mu-brick);
}

#notice-title {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

#notice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#notice-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mu-ink-soft);
}

#notice-list b {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--mu-brick);
}

#notice-list kbd {
  display: inline-block;
  box-sizing: border-box;
  min-width: 1.55em;
  margin: 0 1px;
  padding: 0 0.38em;
  border: 1px solid rgba(124, 71, 48, 0.4);
  border-bottom-width: 3px;
  border-radius: 4px;
  background: #fffdf7;
  color: var(--mu-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

#notice-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

#notice-close {
  margin-left: auto;
  padding: 11px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fdf7ea;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 10px 22px rgba(126, 48, 34, 0.26);
  cursor: pointer;
}

#notice-close:hover { filter: brightness(1.06); }

#notice-close:focus-visible {
  outline: 2px solid var(--mu-brick-deep);
  outline-offset: 3px;
}

#notice-link {
  font-size: 13px;
  color: var(--mu-ink-soft);
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  /* 手机上不用底部抽拉那一套了：整屏铺一层七成透明的米白，楼还看得见但不跟字抢，内容摆在画面正中。 */
  #name-gate {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    min-width: 0;
    max-height: none;
    /* 品牌顶格、页脚贴底，正文靠上下两个 auto 外边距落在正中。 */
    justify-content: space-between;
    padding: 26px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateY(14px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* 平铺一层，不渐变。 */
    background-color: rgba(251, 248, 241, 0.7);
    background-image: none;
  }

  #name-gate.is-shown { transform: none; }

  .gate-head { padding-top: 0; }
  /* 只给上下留 auto，左右继续沿用上面那条居中规则。 */
  .gate-body { flex: 0 0 auto; margin-top: auto; margin-bottom: auto; padding: 0; }
  .gate-body .gate-kicker { margin-bottom: 12px; text-align: center; }
  .gate-title { font-size: 40px; text-align: center; }
  .gate-lead { margin-top: 10px; font-size: 13.5px; }
  .gate-label { margin-top: 18px; }
  #name-gate input { font-size: 16px; padding: 11px 12px; }
  .gate-enter { margin-top: 10px; padding: 10px 14px 10px 16px; }
  .gate-enter-main { font-size: 16.5px; }
  .gate-cards { gap: 8px; margin-top: 10px; }
  .gate-card { min-height: 48px; padding: 8px 10px; }
  .gate-foot { margin-top: 12px; }
  #notice-card { padding: 22px 20px 16px; border-radius: 16px; }
  #notice-list li { grid-template-columns: 52px 1fr; gap: 8px; font-size: 13.5px; }
  #notice-title { font-size: 21px; }
}

/* 手机横屏（高度很矮）时把纵向留白和内边距压一压，一屏能放下，不用滚。 */
@media (max-width: 860px) and (max-height: 520px) {
  #name-gate { padding: 11px 22px calc(9px + env(safe-area-inset-bottom, 0px)); }
  .gate-body { padding: 6px 0 0; top: 0; }
  .gate-title { font-size: 28px; }
  .gate-lead { margin-top: 8px; font-size: 13px; }
  .gate-label { margin-top: 12px; }
  #name-gate input { padding: 9px 12px; }
  .gate-enter { margin-top: 8px; padding: 8px 13px 8px 15px; }
  .gate-cards { margin-top: 8px; }
  .gate-card { min-height: 44px; }
  .gate-foot { margin-top: 8px; }
}

@media (max-height: 720px) and (min-width: 861px) {
  #name-gate { padding-top: 18px; padding-bottom: 16px; }
  .gate-body { padding-top: 10px; }
  .gate-title { font-size: 36px; }
  .gate-lead { margin-top: 10px; font-size: 13.5px; }
  .gate-label { margin-top: 16px; }
  .gate-enter { margin-top: 10px; padding: 9px 14px 9px 18px; }
  .gate-enter-main { font-size: 16.5px; }
  .gate-cards { margin-top: 9px; }
  .gate-card { min-height: 46px; }
  .gate-foot { margin-top: 10px; }
}

#kick-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 41, 38, 0.28);
}
#kick-gate[hidden] { display: none; }
#kick-card {
  width: min(360px, calc(100% - 32px));
  padding: 18px 20px 16px;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.1);
  color: #2c2926;
}
#kick-card p {
  margin: 0 0 10px;
  color: #6f6a64;
  font-size: 14px;
  line-height: 1.6;
}
#kick-card strong { color: #2c2926; }
#kick-back {
  font: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid #2c2926;
  background: #2c2926;
  color: #fffcf8;
}

@media (max-width: 720px) {
  #loading-title { font-size: 40px; letter-spacing: 0.16em; text-indent: 0.16em; }
  #loading-credit { font-size: 14px; letter-spacing: 0.28em; text-indent: 0.28em; }
  #loading-intro { margin-top: 18px; font-size: 14px; line-height: 1.75; }
  #loading-hint { font-size: 11.5px; letter-spacing: 0.08em; text-indent: 0.08em; }
  #loading-nojs { margin-top: 14px; font-size: 12.5px; }
  #loading-foot { margin-top: 18px; }
  #loading-label { font-size: 13px; letter-spacing: 0.22em; text-indent: 0.22em; }
  .load-earth {
    top: 6%;
    left: 50%;
    width: 112px;
    height: 112px;
    margin-left: -56px;
  }
  /* 手机档不跟着左移：390px 宽的屏上卡片本来就占满宽度，再往左推会顶出屏幕左边。
     居中靠的是上面的 translate，这里一并归零（不是 transform——那条留给开合动画）。
     box-sizing 必须是 border-box：上面 width 是 min(380px, 100% - 36px)，按 content-box 算
     的只是内容区，再加上 20×2 内边距和 1.5×2 描边，390 屏上卡实宽 397、左沿落到屏外 -19；
     改 border-box 后宽度含内边距与描边，左沿回到 24。 */
  #panel { right: 12px; top: auto; bottom: 12px; translate: none; box-sizing: border-box; }
  body:has(#corner.nav-open) #panel {
    right: calc(12px + 260px + 8px);
    width: min(380px, calc(100vw - 12px - 260px - 8px - 12px));
  }
  /* 跟手机档 #screen-gate 同一组边距：左 12、上 安全区+56、下 12（#corner 的 12/12）。 */
  #guestbook {
    left: 12px;
    right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    bottom: 12px;
    width: auto;
  }
  #corner { --nav-w: 260px; --map-w: 168px; top: 12px; right: 12px; bottom: 12px; }
  .toast { white-space: normal; }
}

@media (max-width: 480px) {
  #loading-title { font-size: 34px; letter-spacing: 0.12em; text-indent: 0.12em; }
  #loading-intro { font-size: 13.5px; }
  #loading-hint { font-size: 11px; }
  #loading-nojs { font-size: 12px; }
}

@media (max-height: 620px) {
  #loading-title { font-size: 38px; }
  #loading-intro { margin-top: 12px; font-size: 13px; line-height: 1.6; }
  #loading-hint { display: none; }
  #loading-foot { margin-top: 12px; }
  .load-earth {
    top: 4%;
    width: 92px;
    height: 92px;
    margin-left: -46px;
  }
}

#screen-mount {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* 压在画布底下：幕布画面和嵌播器都在画布后面，画布只在幕布那块「洞」里透明，
     视频才透得出来（洞在 `js/meshes.js` 的 `art-screen-hole`）。楼层字、说明卡和
     电梯提示仍是 z-index 3 以上，照旧留在这两层上面。 */
  z-index: -1;
}

#screen-mount[hidden] { display: none; }

/* 手机：幕布上的画面得能用手指点。iOS 的自动播放规矩只认「嵌播器自己页面里」的那一次
   点按，父页面的播放键、在手势里换 src 都不算数，B 站和 YouTube 就停在封面那个播放键上。
   所以手机开演时给这一层加 `.live`（`js/arthall.js` 的 liveMount）：抬到画布上面，
   画面矩形接住手指，播放器自己的播放键和声音开关才点得到。画面以外仍是画布，拖动看
   四周不受影响。那圈 10px 垫底的黑边只在画布底下有意义，抬上来就得摘掉。 */
#screen-mount.live { z-index: 2; }
#screen-mount.live #screen-plane { box-shadow: none; }
#screen-mount.live #screen-frame { pointer-events: auto; }

/* 看片时（`body.watching`，只有手机上挂片源才有）画面铺满整块屏幕，右上角 HUD 的几个
   容器盒子虽然透明，但仍是命中目标：`#rail` 宽 168px 通高、`#day` 的楼层条一整块、`#dock`
   同理。手指落在这些空白处就被它们吃掉，传不到底下的播放器——「有时点不到视频里的播放键」
   就是这么来的。容器放行，真按钮照旧能点；画面以外的拖动、转视角不受影响。 */
body.watching #corner,
body.watching #dock,
body.watching #rail,
body.watching #where,
body.watching #day { pointer-events: none; }
body.watching #corner button,
body.watching #corner a,
body.watching #corner input,
body.watching #day button { pointer-events: auto; }

#screen-view {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

#screen-plane {
  position: absolute;
  left: 0;
  top: 0;
  width: 711px;
  height: 400px;
  overflow: hidden;
  transform-style: preserve-3d;
  pointer-events: none;
  background: #07080c;
  /* 幕布那块「洞」和画面矩形严丝合缝，这一圈理论上永远露不出来；留着是给浏览器把 CSS3D
     矩阵取整时可能差的那一个像素垫底，不然边缘会漏出一条页面底色。 */
  box-shadow: 0 0 0 10px #07080c;
}

#screen-frame,
#screen-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  pointer-events: none;
}

#screen-video {
  object-fit: contain;
}

#screen-frame { background: #07080c; }

/* 幕布上那两层「像投上去的」，`index.html` 里紧跟在 <video> 后面、`#screen-veil` 前面：
   都在 `#screen-plane` 里，所以只在画面矩形以内——画布上那块白板 DOM 够不着，画面外那圈
   溢出光得在 `js/meshes.js` 里做。位置全是 auto 的，按文档顺序画，颗粒自然压在视频上，
   暂停遮罩（z-index 1）又压在颗粒上，别再给它们加 z-index。
   `pointer-events` 必须是 none：手机看片时这一整片就贴在播放器画面上，吃了手指就点不到
   播放键了（`#screen-mount.live` 那条链路的坑，见交接.md）。 */
#screen-wash,
#screen-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 一层是静的：中间一点点暖、四角一点点暗。放映机把光打到幕上，中间是正着吃满的，越往边
   上越斜、四角更斜，所以四角本来就比中间暗；显示器反过来，整块一样亮。这一层只干这件
   事，不改色相、不加扫描线、不做 RGB 分离——那些一眼就能认出是滤镜。
   半径写成 78% / 82% 是为了让四角落在渐变 88% 附近：写成 120% / 96% 时对角只走到 67%，
   暗角等于没有。强度按「站在厅里说不上哪里变了、只是不像一块显示器」配，改它之前先拿
   `?grain=0` 的对照看一眼。
   2026-11-23 用户：「画面纯黑色的地方有点亮（上面有一层暖色），改成不要太明显」——整层给
   0.4 的透明度：黑位被抬起的量从 +6.3 阶降到 +2.4（`rgb(7,8,12)` → `rgb(9.9,10.7,14.4)`），
   128 灰只暖 +1 阶。代价是暗角也一起淡了（四角从 −4.7% 到约 −1.9%），要留暗角就把末两档
   的 alpha 单独补回 2.5 倍，别动 opacity。
   再一手（用户「把暖色部分再淡点」）：只把三档暖色停点的 alpha 减半（0.03/0.02/0.01 →
   0.015/0.01/0.005），暗角那三档一个数没动——暖色在纯黑上只剩 +1.2 阶上下，128 灰中心
   127.94（几乎是纯中性，偏蓝的那点底子回到 0 附近），四角仍是 −2.3%。要再淡就再折这前
   三档，别再动 opacity，否则暗角跟着一起没。
   又一手（用户 m00561「暖色透明度再降」）：再三档减半到 0.0075/0.005/0.0025，暖色在黑位上
   只剩 +0.4 阶、128 灰 127.5（比中性还低半阶，基本等于「只留暗角」），四角 −1.8% 没法再弱
   到哪去。**这一层到头了**：现在纯黑 `rgb(7,8,12)` → `rgb(15,16,20)` 里那 +8 阶几乎全是颗粒
   的，想再压黑得动 `#screen-grain` 的 alpha（`js/arthall.js:432`），别再折暖色了。 */
#screen-wash {
  opacity: 0.4;
  background: radial-gradient(78% 82% at 50% 47%,
      rgba(255, 242, 224, 0.0075) 0%,
      rgba(255, 240, 221, 0.005) 28%,
      rgba(252, 238, 218, 0.0025) 52%,
      rgba(20, 16, 13, 0.04) 70%,
      rgba(10, 9, 8, 0.1) 86%,
      rgba(8, 7, 6, 0.14) 100%);
}

/* 另一层是颗粒。贴图不落盘，`js/arthall.js` 的 `grainTile()` 现搓一张 128×128：一半像素
   偏白、一半偏黑，alpha 压到 7–28（均值约 6.9%），铺上去黑位抬一点、中间调抖一点，是幕布
   织纹混着片基灰的那种绒面，不是「加了颗粒滤镜」。
   **一格多大是唯一能调「密」的旋钮**：屏幕上每颗照样铺满、没有空隙，所以「密」只能靠把
   一颗做小（`background-size` 占比小）或多加几颗（把 `grainTile()` 的 128 加大，等效）。但
   `#screen-plane` 在座位上看只有 562×316 像素（21.33 米的幕布十几米外，3D 矩阵缩到 0.26 倍），
   颗粒一细就跌破一个屏幕像素、被合成器摊平——同一块 128 灰，量出来的抖幅是：
   一格 4.5 像素（27%）7.1 阶 / 2.9（17%）7.0 / 1.8（11%）5.7 / 1.33（8%）3.1 / 1.0（6%）3.0。
   到 4%（一格 0.67）座位只剩 1.6 阶，3% 往下连 1:1 都糊（贴图在亚像素处就被平均掉）。
   所以「再密」和「再淡」在座位视距上是同一件事；又密又浓得靠加 alpha 补，但补不回被摊平的锐度。
   反过来再粗（一格 4.5 像素往上）凑近幕布能看见一颗颗方块。
   整张图是一层静态绒面，刻意不做动画——`background-position` 每动一步要
   重绘整块 2133×1200，换成 transform + will-change 又会在手机 `.live` 那条 3D 链路上多一层
   合成，换那点闪烁不值。
   尺寸写成百分比而不是死像素：手机看片时 `js/arthall.js` 的 `presentFlat()` 会把
   `#screen-plane` 重设成屏幕上那块的实际像素（七百来像素），写死 576px 在那条路上
   一格就是 4.5 个屏幕像素、能看见一颗颗点；按比例走，两条路的粗细心才一样。
   2026-11-23 用户五轮：密一点（alpha 4–22 → 8–36）→ 细两档（27% → 17%）→ 再细两档
   （17% → 11%）→ 又大又强、再密一点（11% → 8%，alpha 8–36 → 6–24）→ 再细一档
   （8% → 6%，alpha 7–28 补浓度）。 */
#screen-grain {
  background-repeat: repeat;
  background-size: 6% auto;
}

/* `?grain=0` 的对照开关（`js/arthall.js` 的 `createArtHall` 往 mount 上挂这个类）。 */
#screen-mount.no-grain #screen-wash,
#screen-mount.no-grain #screen-grain {
  display: none;
}

/* 桌面 B 站嵌播器带 ctrl=0 时，常规控件收了，但它自己另画一条 2px 的
   .bpx-player-shadow-progress-area（贴 iframe 最底、颜色 #00a1d6）。B 站没有参数关它，
   父页又进不去跨域 iframe，只能在画面最下沿压一条 3px 的幕布同色黑边：
   2px 条 + 1px 抗锯齿，颜色和 `#screen-plane`、外圈 10px 黑边一致，看着就是幕布下沿。
   只在 player.bilibili.com 且 URL 带 ctrl=0 时显示；直链 <video> 和触屏完整控件都不盖，
   因为那两路本来就没有这条 shadow 进度条。 */
#screen-bar-mask {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: #07080c;
  pointer-events: none;
  z-index: 0;
}

#screen-frame:not([hidden])[src*="player.bilibili.com"][src*="ctrl=0"] ~ #screen-bar-mask {
  display: block;
}

/* 暂停时 B 站那条要把播放器整个重装一遍，一秒多里播放器自己是全黑的。
   这层盖在上面：半透明黑打底、当秒的秒数、一条来回扫的细线，读起来像「停在这一秒」。
   换 src 之前就亮起来，iframe 的 load 一到就淡出，画面接上时是渐变不是硬切。 */
#screen-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: radial-gradient(118% 92% at 50% 46%, rgba(22, 24, 31, 0.46), rgba(6, 7, 11, 0.8));
  color: var(--mu-cream-hi);
  opacity: 1;
  transition: opacity 260ms ease;
  pointer-events: none;
}

#screen-veil[hidden] { display: none; }

#screen-veil-time {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

#screen-veil-hint {
  font-size: 13px;
  letter-spacing: 0.2em;
  color: rgba(247, 238, 220, 0.7);
}

#screen-veil-bar {
  position: relative;
  width: 104px;
  height: 2px;
  margin-top: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(247, 238, 220, 0.14);
}

#screen-veil-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  border-radius: inherit;
  background: rgba(247, 238, 220, 0.7);
  animation: screen-veil-sweep 1080ms ease-in-out infinite;
}

@keyframes screen-veil-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(263%); }
}

@media (prefers-reduced-motion: reduce) {
  #screen-veil-bar::after { animation: none; }
}

#screen-plane [hidden] { display: none; }

/* 放映厅卡片：贴在画面左侧，顶边和底边都跟右上菜单对齐，宽是菜单的 130%（260×1.3 = 338）。
   上下两条线之间是撑满的固定高度（高度由 JS 的 fitGate() 现量现写，这里只留个兜底）；
   中间的播放列表是唯一会长大的那一块——内容少时多出来的地方全归它，播放键及以下贴着底边。 */
#screen-gate {
  --gate-w: 338px;
  position: fixed;
  /* 顶边不贴屏幕顶（18px），而是跟右上角那张汉堡卡同一条线：胶囊下面那条。
     62 = #corner 的 18 + 汉堡按钮 36（#drawer-toggle 在 3143 行的 height）+ #corner 的间距 8；
     JS 里的 fitGate() 会量 #dock 的顶边再盖一次，值相同。早先按按钮 32 写成 58，短了 4px。 */
  left: 18px;
  top: 62px;
  z-index: 8;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: var(--gate-w);
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  padding: 18px 18px 16px;
  background: var(--plate);
  border: 1px solid rgba(44, 41, 38, 0.1);
  box-shadow: 0 18px 50px rgba(44, 41, 38, 0.16);
}

#screen-gate > * { flex: none; }
/* [hidden] 的 UA 规则是 display:none，但压不过上面那条 id 选择器里的 display:flex，
   不补这一行，卡片一进页面就一直挂在那儿。 */
#screen-gate[hidden] { display: none; }

/* 打开时淡进来：透明度 0 → 1，同时从停位左边 60px 处往右挪 60px 落到位（用户 m00391 / m00420 / m00441 要的效果），
   不再从屏幕最左边缘横扫过来。停位 left:18px 不动，位移只用 transform
   （宽度是 --gate-w 定的，动 left 会先触发 #lower 那条 :has 判定跳一下）。
   收尾要「快停下的时候速度变慢、缓缓停下」（用户 m00612 / m00660）：曲线从 ease 换成
   cubic-bezier(.35,.5,.35,1)——走到一半已走完 83% 行程，剩下那 10px 摊在最后一半时间里，
   越接近停位越慢、末速≈0.02，不会到点就戛然而止。0.32s 没动（用户只说改加速度）。
   透明度跟着位移走同一条曲线、不再单独插帧（用户 m00702）：0 → 1 也是前快后慢，
   快停住那一下才缓缓到 100%，和滑动同一口气，不会出现「位置停了、透明度还在追」。
   整段只有首尾两帧，**别在中途插帧写 transform**：CSS 的关键帧缓动是逐段的，
   中间帧一写位移，60px 就被切成两段、每段各走一遍缓动，到 40px 处刹停再重新加速
   （用户 m00593 见过的「顺滑、停一下、又猛地到位」）。真要插帧，那帧只能写 opacity。
   起点 left 在 -42px，左边会探出屏幕一点，透明度从 0 起所以看不出来。
   类由 js/arthall.js 的 open() 挂上（先摘、强制回流、再挂，关掉重开才从头放），
   放完 animationend 再摘掉，别让 fill 的 opacity/transform 一直挂着。 */
#screen-gate.gate-in { animation: gate-fade-in 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both; }

@keyframes gate-fade-in {
  from { opacity: 0; transform: translate3d(-60px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 动起来这 0.32s 先把糊底关掉、并声明这卡自己单开一层（用户 m00523 说滑动不顺畅）：
   #screen-gate 在第 3547 行那组白卡里带 backdrop-filter，卡片每挪一寸，身后的场景都要重新
   采样、重新糊一遍；同时左下角那摞又在改 width（文字重排）。两件事撞一帧就掉帧。
   卡片是 92% 白，糊底在 0.32s 里几乎看不出来，关掉不亏；类一摘，3547 那条自己回来。
   translate3d 而不是 translateX，是为了让浏览器走合成层，不留在主线程重绘。 */
#screen-gate.gate-in, #screen-gate.gate-out {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform, opacity;
}

/* 收起跟入场用**同一条**缓动，只是方向反过来（用户 m00732：镜像那版「效果不好」，
   除了透明度不改，速度曲线和透明度曲线都跟入场一样）。所以这里直接抄
   cubic-bezier(.35,.5,.35,1)，不做时间反演：起步快、越走越慢，到左边 60px 处
   速度收到≈0 才消失；透明度同样跟位移共用这条曲线、不插帧，1 → 0 一并收尾。
   行程 t25/50/75 = 44% / 83% / 97%，和入场一模一样，只是从停位往外走。
   别改回反演版 (.65,0,.65,.5)：那版起步几乎不动、最后猛退，用户已否掉。
   时长 0.32s 跟入场一致；JS 的 380ms 兜底仍大于它，不用改。
   退场期间卡片还挂在屏幕上，所以先掐掉点击，别让人点中一张正在退场的卡；
   gate-in 先摘掉，两段动画不会叠在同一个元素上。 */
#screen-gate.gate-out {
  pointer-events: none;
  animation: gate-fade-out 0.32s cubic-bezier(0.35, 0.5, 0.35, 1) both;
}

@keyframes gate-fade-out {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(-60px, 0, 0); }
}
#screen-gate h2 { margin: 0 0 8px; font-size: 20px; }
#screen-lead { margin: 0 0 12px; color: var(--mu-ink-soft); font-size: 13.5px; line-height: 1.6; }
/* 手机上才说的一句：为什么要亲手点画面里那个播放键。桌面自动就播，说了反而奇怪。 */
#screen-tap-hint { display: none; }
body.touch-play #screen-tap-hint {
  display: block;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-left: 2px solid #2c2926;
  background: rgba(44, 41, 38, 0.05);
  color: #3d3935;
  font-size: 12.5px;
  line-height: 1.55;
}

/* 播放列表外面套的那层（index.html 的 .clips-scroll）：列表上下还有没露出来的内容时，
   那一头把内容本身擦淡。注意这里用的是 mask（擦内容），不是往上盖一层白/白渐变——
   卡片是 0.92 半透白、底下压着场景，盖上去的那层是叠在已经合成好的画面上，
   再怎么调都比卡片本身亮，一眼能看出是块白。擦淡才露出卡片自己的底色，接得上。
   哪一头还有内容，由 js/arthall.js 的 paintClipsFade() 按 scrollTop 挂
   .more-top / .more-bottom；滚到头那一头就还原成硬边。 */
#screen-gate > .clips-scroll {
  /* #screen-gate > * 给的是 flex: none，那一条带 id，只有同样带 id 的选择器才盖得回来。 */
  flex: 1 1 auto;
  min-height: 0;
}
.clips-scroll {
  --clip-fade: 20px;
  /* 两头各淡多少：高度 0 + 实色 1 = 这一头到头了，不淡；高度 --clip-fade + 透明 0 = 这一头还有内容。 */
  --fade-top-h: 0px;
  --fade-top-a: 1;
  --fade-bottom-h: 0px;
  --fade-bottom-a: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* 两层 mask 默认就是叠在一起相加：
     第一层管上下渐隐，位置和实心值都走上面四个变量；
     第二层把最右 8px——滚动条占的那一条——整个留成不透明，滑块的两头就不跟着一起淡掉。 */
  -webkit-mask-image:
    linear-gradient(to bottom, rgba(0, 0, 0, var(--fade-top-a)) 0, #000 var(--fade-top-h), #000 calc(100% - var(--fade-bottom-h)), rgba(0, 0, 0, var(--fade-bottom-a)) 100%),
    linear-gradient(to right, transparent calc(100% - 8px), #000 calc(100% - 8px));
  mask-image:
    linear-gradient(to bottom, rgba(0, 0, 0, var(--fade-top-a)) 0, #000 var(--fade-top-h), #000 calc(100% - var(--fade-bottom-h)), rgba(0, 0, 0, var(--fade-bottom-a)) 100%),
    linear-gradient(to right, transparent calc(100% - 8px), #000 calc(100% - 8px));
}
.clips-scroll.more-top {
  --fade-top-h: var(--clip-fade);
  --fade-top-a: 0;
}
.clips-scroll.more-bottom {
  --fade-bottom-h: var(--clip-fade);
  --fade-bottom-a: 0;
}

/* 播放列表：一行一个圆角方框，框里是圆圈播放键 + 标题 + 时长/作者，右上角 × 删。
   右侧那条滚动条跟汉堡菜单「设置 / 项目」的抽屉是同一套（8px、透明轨道、圆头滑块、不带箭头），
   规则不写在这里，在文件后面「滚动条全项目只此一套」那一块，改样式去那里改。
   行和滑块之间那道缝就是下面的 padding-right（现在 8px，跟滑块一样宽），要加宽/收窄动这一个值，
   别用 margin 给行让位——margin 管不到滑块，只会让行歪。 */
#screen-clips {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 8px 0 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#screen-clips .clip {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 0 0 8px;
  border: 1px solid var(--mu-line);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.72);
}
#screen-clips .clip:last-child { margin-bottom: 0; }
#screen-clips .clip.on { border-color: rgba(157, 64, 48, 0.55); background: rgba(157, 64, 48, 0.07); }
#screen-clips .clip-pick {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 9px 30px 9px 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--mu-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#screen-clips .clip-pick:hover { background: rgba(124, 71, 48, 0.06); }
#screen-clips .clip-play {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--mu-ink);
  color: var(--mu-cream-hi);
}
#screen-clips .clip.on .clip-play { background: linear-gradient(178deg, #ac4a35, #8f3626 88%); }
#screen-clips .clip-play svg { width: 13px; height: 13px; margin-left: 2px; }
#screen-clips .clip-copy { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
#screen-clips .clip-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--mu-ink);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
#screen-clips .clip-meta {
  display: block;
  overflow: hidden;
  color: var(--mu-ink-faint);
  font-size: 11.5px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#screen-clips .clip-del {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mu-ink-faint);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
#screen-clips .clip-del:hover { background: rgba(138, 58, 50, 0.12); color: #8a3a32; }
#screen-clips button:focus { outline: none; }
#screen-clips button:focus-visible { outline: 2px solid var(--mu-brick); outline-offset: -2px; }
#screen-empty { margin: 0 0 10px; color: var(--mu-ink-faint); font-size: 12.5px; line-height: 1.6; }

#screen-error { margin: 8px 0 0; color: #8a3a32; font-size: 13px; line-height: 1.5; }
#screen-transport {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
#screen-gate button {
  font: inherit;
  font-size: 13.5px;
  border: 1px solid #2c2926;
  border-radius: 8px;
  padding: 8px 12px;
  background: transparent;
  color: #2c2926;
  cursor: pointer;
}
#screen-transport button { flex: 1 1 auto; padding: 7px 8px; font-size: 13px; white-space: nowrap; }
#screen-play, #screen-pause { background: #2c2926; color: #fffcf8; }
#screen-volume-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--mu-ink-soft);
  font-size: 12.5px;
}
#screen-volume { flex: 1 1 78px; width: auto; min-width: 64px; margin: 0; }
#screen-autonext {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
  cursor: pointer;
}
#screen-autonext input { margin: 0; }
#screen-add { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#screen-url {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid #2c2926;
  border-radius: 8px;
  background: #fff;
  color: #2c2926;
}
#screen-add-btn { padding: 9px 12px; }
#screen-close { margin-top: 10px; width: 100%; }
#screen-transport button:focus,
#screen-add-btn:focus,
#screen-close:focus,
#screen-url:focus,
#screen-volume:focus,
#screen-autonext-box:focus { outline: 1px solid #2c2926; outline-offset: 2px; }

@media (max-width: 720px) {
  #screen-gate {
    left: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    width: min(338px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 68px);
  }
}

.help-touch { display: none; }
body.touch-play .help-touch { display: list-item; }

html.touch-play,
html.touch-play body {
  touch-action: none;
  overscroll-behavior: none;
}
html.touch-play #view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  overscroll-behavior: none;
}
/* 准星和画面提示都跟着可见区域的中心走：手机地址栏占掉的高度不算在画面中心，
   摆 50%/50% 会偏低，而且跟取景射线打出去的那一点对不上。 */
html.touch-play #crosshair {
  left: var(--aim-x, 50%);
  top: var(--aim-y, 50%);
}
html.touch-play #hover {
  left: var(--aim-x, 50%);
  top: calc(var(--aim-y, 50%) + 22px);
}
html.touch-play #guestbook,
html.touch-play #panel,
html.touch-play #screen-gate,
html.touch-play #drawer,
html.touch-play #lift-list,
html.touch-play #chat-bar,
html.touch-play #name-gate,
html.touch-play textarea {
  touch-action: pan-y;
}

body.touch-play #lift-hint,
body.touch-play #seat-hint,
body.touch-play #tab-hint { display: none; }

body.touch-play #corner {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
}
body.touch-play #where {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
}
body.touch-play #chat-bar {
  bottom: calc(192px + env(safe-area-inset-bottom, 0px));
}
/* 手机上聊天栏浮在底部，消息页的最后几行要能滚到它上面去。 */
body.touch-play #drawer-message-list { padding-bottom: 120px; }

body.touch-play #hud-row { justify-content: flex-end; }

body.touch-play #lift-toggle {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 50%;
  padding-left: 4px;
  padding-right: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 选层卡片离开右上角，竖向卡在时辰和摇杆之间，左右留白。 */
body.touch-play #lift-pad {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 12px + 124px);
  bottom: calc(52px + 128px + 14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 5;
  width: min(280px, calc(100vw - 48px));
  flex: none;
  padding-bottom: 61px;
}

body.touch-play:has(#guestbook:not([hidden])) #touch-pad,
body.touch-play:has(#screen-gate:not([hidden])) #touch-pad,
body.touch-play:has(#name-gate:not([hidden])) #touch-pad,
body.touch-play:has(#kick-gate:not([hidden])) #touch-pad { display: none; }

#touch-pad {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  user-select: none;
}
#touch-pad[hidden] { display: none; }

#stick {
  position: fixed;
  left: calc(34px + env(safe-area-inset-left, 0px));
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  width: 128px;
  height: 128px;
  box-sizing: border-box;
  border-radius: 50%;
  /* 大圆比上一档再透 30%：底 0.42→0.294，边 0.92→0.644。旋钮不跟着透。 */
  border: 2px solid rgba(138, 142, 148, 0.644);
  background: rgba(42, 44, 48, 0.294);
  box-shadow: none;
  pointer-events: auto;
  touch-action: none;
}
#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #3a3e44;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#stick-knob::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid rgba(198, 202, 208, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

#touch-cluster {
  position: fixed;
  right: calc(36px + env(safe-area-inset-right, 0px));
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  width: 76px;
  height: 76px;
  pointer-events: none;
}
#touch-orbit { position: absolute; inset: 0; }
#touch-jump {
  position: absolute;
  inset: 0;
  width: 76px;
  height: 76px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #3a3e44;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  color: #e8eaee;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#touch-jump svg path { stroke: currentColor; }
#touch-jump:active { transform: scale(0.96); }
.touch-act {
  position: absolute;
  z-index: 1;
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(48, 52, 60, 0.84);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  color: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: manipulation;
}
.touch-act:active { filter: brightness(1.12); }

@media (max-width: 380px) {
  #stick { width: 112px; height: 112px; }
  #stick-knob { width: 48px; height: 48px; }
  body.touch-play #lift-pad {
    bottom: calc(52px + 112px + 14px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── 进馆之后的界面：跟开始页同一套米白展签、砖红按钮、草金细节 ── */
html, body { --plate: rgba(255, 255, 255, 0.8); }

/* 顶左：只留当前楼层，做成和右边延迟、帧数同一排的小胶囊。 */
#where {
  top: max(18px, env(safe-area-inset-top, 0px) + 12px);
  left: max(18px, env(safe-area-inset-left, 0px) + 12px);
  height: 36px;
  display: flex;
  align-items: center;
}

/* #where 自己带了 display，[hidden] 的 UA 规则压不住，得自己让路。 */
#where[hidden] { display: none; }

#where, #legend { text-shadow: none; }

/* 白半透的卡底下有时是深色的墙，字下面补一圈白，跟羽毛球面板里的字一个处理。 */
#lift-toggle, #people li, #sys-log li, #chat-log li,
.drawer-body .menu-head, .drawer-label, #help-keys li, #project-link,
#credit, #music-credit {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.92);
}
#day button.on { text-shadow: none; }

#place {
  margin: 0;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fdf7ea;
  background: rgba(51, 35, 28, 0.44);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* 时辰挪进汉堡菜单，摆在声音、单人模式下面。六个时辰排成一行，字号和胶囊都收小。 */
#day { flex-wrap: nowrap; gap: 4px; margin: 2px 0 4px; max-width: 100%; }

#day button {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  padding: 3px 2px;
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--mu-ink-soft);
  border: 1px solid rgba(124, 71, 48, 0.3);
  border-radius: 9px;
  text-shadow: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

#day button:hover { background: rgba(157, 64, 48, 0.08); color: var(--mu-ink); }

#day button.on {
  color: #fdf7ea;
  background: var(--mu-brick);
  border-color: var(--mu-brick);
  text-shadow: none;
}

body.dark-sky #place { color: #fdf7ea; text-shadow: none; }
body.dark-sky #day button { color: var(--mu-ink-soft); }
body.dark-sky #day button.on { color: #fdf7ea; text-shadow: none; }

/* 顶右：在线人数、延迟、帧数、汉堡。 */
#online-count, #lag, #fps {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fdf7ea;
  background: rgba(51, 35, 28, 0.44);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#fps { min-width: 0; }

body.dark-sky #online-count,
body.dark-sky #lag,
body.dark-sky #fps { color: #fdf7ea; }

/* 这几张卡和大浮层（画框介绍、欢迎、留言板、放映厅、踢人）现在同一套，以大屏卡 #screen-gate
   为准：0.92 白底、1.5px 白描边、16 圆角、深而散的投影、blur(10px) saturate(1.25)——
   原来是 80% 白配 0 6px 16px 的小软影。具体声明只写在文件末尾「进馆之后所有白卡只此一套」
   那一条，这里只留文字用色和各自的尺寸，免得同一套参数两处各写一遍、以后改一处漏一处。 */
#lift-toggle, #map-card, #lift-pad, .drawer-body, #drawer-toggle {
  color: var(--mu-ink);
}

#drawer-toggle {
  width: 40px;
  height: 36px;
}

#drawer-toggle[aria-expanded="true"] { color: var(--mu-brick); }

#lift-toggle {
  padding: 9px 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border-radius: 16px;
  color: var(--mu-ink);
}

#lift-toggle[aria-expanded="true"],
#drawer-toggle[aria-expanded="true"] {
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border-color: transparent;
  color: #fdf7ea;
  box-shadow: 0 10px 22px rgba(126, 48, 34, 0.3);
}

#map-card { padding: 7px; overflow: hidden; }
#map { border-radius: 8px; }

/* 卡片贴着右上角，外阴影左右两边会被 #dock / #rail 的 overflow:hidden 切平；
   放开它们。汉堡那张卡收起时也不再靠 #drawer 的 overflow 裁了（它自己 opacity/visibility 收着），
   三个 overflow 都放开，卡片的投影才和别的白卡一样整圈都在。 */
#dock, #rail { overflow: visible; }

.drawer-body {
  padding: 18px 18px 61px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}

/* 「消息」页：系统消息、在线、聊天三段自己滚，发话框一直落在抽屉底部，
   滚过去的字不会从发话框底下透出来。外面那层 .drawer-main 也带滚动，
   这一页不能再让 8px 的槽占进来，否则列表和滑块会多缩一截。 */
#drawer-pane-messages {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  scrollbar-gutter: auto;
  /* 滑块要跟项目页落在同一条线上：这层先顶出去 12px，右内边距再把字和发话框推回 1387；
     列表自己也顶出去 12px（见下），滑块才到 1391–1399，不会被这层的 overflow 裁掉。 */
  margin-right: -12px;
  padding-right: 12px;
}

/* 设置页的滚动体就是它自己（.drawer-main），6px 的口径在 `.drawer-main, .drawer-foot` 那条里定；
   项目页同理（.drawer-foot）。消息页的滚动体是里面的列表（#drawer-message-list），见下。 */
#drawer-message-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* 滚动体是它自己：得比页的内容盒再宽 12px，滑块才落到项目页那条线上（1391–1399）；
     右内边距补回 12px，文字仍然停在 1379。 */
  margin-right: -12px;
  padding-right: 12px;
}
/* 页签换了内容，但 #drawer-pane-messages 自己有 display:flex，
   会盖掉 [hidden] 默认的 display:none；不写这一条，设置页滚到底会露出消息页的发话框。 */
#drawer-pane-messages[hidden] { display: none; }
#drawer-compose { flex: none; margin-top: 10px; }

/* 滚动条全项目只此一套，抽屉、消息页的记录列表和大屏卡的播放列表共用：8px 细条、透明轨道、
   圆头滑块、不带上下箭头。
   抽屉那条挂在页签下面两块内容（.drawer-main 设置页、.drawer-foot 项目页）上，不挂在整张卡片上：
   滑块从「设置 / 消息 / 项目」下面 12px 才开始，不会顶到那一排；这两块用负右外边距顶到卡片描边内侧，
   再用同量右内边距把字推回页签那条线，所以滑块贴着卡片最右边、文字宽度不变（项目页和消息页例外，
   滑块离卡片右边留 6px：项目页见下面的 #drawer-pane-project，消息页见 #drawer-pane-messages
   和 #drawer-message-list）。滚动体顶在页签下、
   底在卡片下内边距之上，离卡片圆角还有一段，轨道不用再上下让 18px，滑块走满内容块。
   消息页滚的是里面那段记录列表（#drawer-message-list），发话框留在列表外面，不跟着滚；
   列表跟着页一起顶出去 6px，滑块才跟项目页落在同一条线上。
   大屏卡的播放列表（#screen-clips）滚的是卡片里的一块，轨道同样不让，
   滑块走满整条；细条、透明轨道、圆头滑块、悬停加深都跟抽屉一样。
   注意：这些滚动体上都不能写 scrollbar-width，一写非 auto，Chrome 就改回系统细条（带上下箭头），
   下面的 ::-webkit-scrollbar 只吃进去一部分，箭头仍会从角上戳出来；
   所以标准属性那条放进 @supports not 里，只给没有这套伪元素的浏览器（Firefox）。 */
.drawer-main::-webkit-scrollbar,
.drawer-foot::-webkit-scrollbar,
#drawer-message-list::-webkit-scrollbar,
#screen-clips::-webkit-scrollbar { width: 8px; background: transparent; }
.drawer-main::-webkit-scrollbar-track,
.drawer-foot::-webkit-scrollbar-track { background: transparent; margin: 0; }
#drawer-message-list::-webkit-scrollbar-track,
#screen-clips::-webkit-scrollbar-track { background: transparent; }
.drawer-main::-webkit-scrollbar-thumb,
.drawer-foot::-webkit-scrollbar-thumb,
#drawer-message-list::-webkit-scrollbar-thumb,
#screen-clips::-webkit-scrollbar-thumb { background: rgba(44, 41, 38, 0.28); border-radius: 999px; }
.drawer-main::-webkit-scrollbar-thumb:hover,
.drawer-foot::-webkit-scrollbar-thumb:hover,
#drawer-message-list::-webkit-scrollbar-thumb:hover,
#screen-clips::-webkit-scrollbar-thumb:hover { background: rgba(44, 41, 38, 0.42); }

@supports not selector(::-webkit-scrollbar) {
  .drawer-main,
  .drawer-foot,
  #drawer-message-list,
  #screen-clips { scrollbar-width: thin; scrollbar-color: rgba(44, 41, 38, 0.3) transparent; }
}

/* 抽屉里的次要文字（小标题、署名、未选中的标签）统一深一档，
   取 --mu-ink-faint 和 --mu-ink-soft 的中间值，暖白卡上更好认。 */
#drawer { --mu-ink-faint: #847262; }

/* 抽屉顶上的四个标签：设置 / 消息 一排，帮助 / 项目 一排（帮助在项目左边），两个都按 1fr 分半；
   默认停「设置」，第一次进馆的新玩家默认停「帮助」（见 js/presence.js 的 setDrawer）。
   只留按钮自己的细边，底下不再垫一条底色。 */
#drawer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 4px;
  margin: 0 0 12px;
}

.drawer-tab {
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--mu-ink-faint);
  background: transparent;
  border: 1px solid rgba(124, 71, 48, 0.3);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.drawer-tab:hover { color: var(--mu-ink); background: rgba(157, 64, 48, 0.07); }

.drawer-tab.on {
  color: var(--mu-cream-hi);
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(126, 48, 34, 0.22);
}

.drawer-tab:focus-visible { outline: 1px solid #2c2926; outline-offset: 2px; }

/* 「消息」里有没看过的内容时，页签右上角亮一颗砖红小点。 */
.drawer-tab-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mu-brick);
  box-shadow: 0 0 0 2px rgba(255, 253, 247, 0.98);
}
.drawer-tab-dot[hidden] { display: none; }

.menu-head {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(124, 71, 48, 0.22);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--mu-brick);
}

/* 「消息」页的系统消息、在线默认只露最新 5 条（多出来的 li 由 .is-folded 压掉），
   标题右边的箭头表示还能展开：有第 6 条才出现，点一下全展开、再点收起。
   折叠状态和箭头显隐都在 js/presence.js 的 paintFold()；聊天（#chat-log）不折。 */
.menu-head.has-fold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.menu-fold {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -4px 0;
  padding: 0;
  font: inherit;
  color: var(--mu-ink-faint);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.menu-fold:hover { color: var(--mu-brick); background: rgba(157, 64, 48, 0.09); }
.menu-fold:focus-visible { outline: 1px solid #2c2926; outline-offset: 2px; }
.menu-fold[hidden] { display: none; }
.menu-fold svg { display: block; transition: transform 0.18s ease; }
.menu-fold[aria-expanded="true"] svg { transform: rotate(180deg); }

#sys-log.is-folded li:nth-child(n + 6),
#people.is-folded li:nth-child(n + 6) { display: none; }

.drawer-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mu-ink-faint);
}

/* 「设置」页的时辰、展厅趣站排序：跟同一页的「操作说明」(.menu-head) 一个样——砖红字 +
   底下那道细线，线下面空 8px 再放控件。颜色、线色、粗细、留白都照抄上面 `.menu-head`
   那条（它是 margin-bottom 8px），两边要一起改。 */
#day-label,
#sort-label {
  color: var(--mu-brick);
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(124, 71, 48, 0.22);
  margin-bottom: 8px;
}

#name-form input {
  padding: 7px 9px;
  font-size: 13.5px;
  color: var(--mu-ink);
  background: #fffdf7;
  border: 1px solid rgba(124, 71, 48, 0.28);
  border-radius: 9px;
}

#name-form button {
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fdf7ea;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 1px solid transparent;
  border-radius: 9px;
}

/* 「显示地图 / 声音 / 单人模式」不用原生方框，也不再占排序那对圆点（排序仍是 radio）。 */
#sort-switch input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--mu-brick);
}

#map-switch, #music-switch, #solo-switch, #sort-switch label {
  font-size: 14px;
  color: var(--mu-ink-soft);
}

/* 「显示地图 / 声音 / 单人模式」这三行的字跟上面「聊天昵称」(.drawer-label) 一个样：
   700 字重、.14em 字距、颜色 --mu-ink-faint（字号 14px 本来就一样，不再重复写）。
   只点这三行——下面排序那对 radio（#sort-switch label）不动。 */
#map-switch, #music-switch, #solo-switch {
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mu-ink-faint);
}

/* 只有右边那枚滑块能点：文字点下去不再切换。label 整体让开指针事件，input 自己再收回来，
   所以滑块照常点、键盘也照常 Tab 进去按空格——只是文字不再是热区。 */
#map-switch, #music-switch, #solo-switch { pointer-events: none; }
#map-switch input, #music-switch input, #solo-switch input { pointer-events: auto; }

/* 「时辰」那一排到「展厅趣站排序」标题的净空，跟它到「操作说明」一样是 16px
   （.menu-head 的 margin-top）；#day 自带 margin-bottom 4px，跟这里的 16px 合并后取 16。 */
#sort-label { margin-top: 16px; }

/* 设置里「显示地图 / 声音 / 单人模式」是圆球左右滑的开关：一条一行，字在左、开关在右。
   底下仍是 input[type=checkbox]——js/presence.js 的 mapToggle / soloToggle、
   js/ambience.js 的 music-on 都只读 .checked，换成按钮要连带改 JS，所以只换皮。
   尺寸只认这一处：轨道 38×22、球 16、球内缩 3、行程 38 - 16 - 3×2 = 16px。 */
#drawer-switches {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

#drawer-switches #map-switch,
#drawer-switches #music-switch,
#drawer-switches #solo-switch {
  flex-direction: row-reverse;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

#drawer-switches #map-visible,
#drawer-switches #music-on,
#drawer-switches #solo-mode {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #ded6c9;
  box-shadow: inset 0 1px 2px rgba(124, 71, 48, 0.24);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.18s ease;
}

#drawer-switches #map-visible::after,
#drawer-switches #music-on::after,
#drawer-switches #solo-mode::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 1px 3px rgba(60, 40, 30, 0.35);
  transition: transform 0.18s cubic-bezier(0.35, 0.5, 0.35, 1);
}

#drawer-switches #map-visible:checked,
#drawer-switches #music-on:checked,
#drawer-switches #solo-mode:checked {
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  box-shadow: inset 0 1px 2px rgba(90, 32, 22, 0.3);
}

#drawer-switches #map-visible:checked::after,
#drawer-switches #music-on:checked::after,
#drawer-switches #solo-mode:checked::after {
  transform: translateX(16px);
}

/* 键盘聚焦：上面那条「馆内输入控件聚焦时不再画黑色外圈」会连它一起 outline:none，
   这里用更高特异度补一道砖红细环，别让开关没有焦点提示。 */
#drawer-switches #map-visible:focus-visible,
#drawer-switches #music-on:focus-visible,
#drawer-switches #solo-mode:focus-visible {
  outline: 2px solid rgba(143, 54, 38, 0.55);
  outline-offset: 2px;
}

#help-keys li {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mu-ink-soft);
}

#help-keys kbd, #tab-hint kbd, #seat-hint kbd {
  border: 1px solid rgba(124, 71, 48, 0.36);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #fffdf7;
  color: var(--mu-ink);
  font-size: 11.5px;
  font-weight: 800;
  box-shadow: none;
}

#help-keys kbd { font-size: 11.5px; font-weight: 500; }
#tab-hint kbd, #seat-hint kbd { font-size: 14px; }

/* 项目页的更新日志：跟「操作说明」同一套字号和行距，日期压在前头当小标。 */
#changelog {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

#changelog li {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mu-ink-soft);
}

#changelog .log-date {
  display: inline-block;
  margin-right: 8px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--mu-brick);
}

#project-link { color: var(--mu-ink-soft); }
#credit, #music-credit { color: var(--mu-ink-faint); }

#people li, #sys-log li, #chat-log li { color: var(--mu-ink-soft); }
/* 自己在名单里只加粗，不染砖红。 */
#people li.me { font-weight: 700; }
#sys-log li { color: var(--mu-ink-faint); }
#chat-log .chat-time, #chat-log .sys { color: var(--mu-ink-faint); }

/* 画框介绍卡。底边留 61px，给底下那道光带让位——光带容器贴着卡底往上 16px、
   高 20px，图标顶在离卡底 45px 处，所以这 61px 里正好 16px 是按钮与图标之间的空
   （用户 m01050 定的死数；按钮到光带顶部约 25px）。手机档同为 61px，光带几何一样。
   底色、描边、圆角、投影以 3930 那条「所有白卡只此一套」为准（0.92 白），这里不另写。 */
#panel {
  padding: 26px 26px 61px;
}

/* 画框卡底部一段暖香槟色的光：中间给图标留断口，两侧化进卡面。
   色是「米金抬明度」第二档——色相 30°、饱和度 34%、明度 71%（取样亮度 216，卡底 249）。
   想再淡就往上一档 #d7c2ad（L76，几乎只剩一道暖影）；想更实就往回走
   #c6a88b（L66）/ #c09e7e（L62.4）。派生色只跟着色芯走：soft = 同色 α .54、
   glow = 各通道 +（19,29,39）α .42、halo = +（9,15,19）α .20；alpha 别动。
   汉堡、大屏、机器人、电梯、ESC 五张卡也共用这一组（用户 m00001）：几何一律照画框卡，
   宽度靠两侧渐隐光线来调——每张卡在下面定自己的 --ph-inset（横向内边距 + 5px），
   中间的博物馆图标始终 50% 居中、24px 不动，所以改宽只动两侧，不碰图标。 */
.p-light {
  position: absolute;
  left: var(--ph-inset, 7%);
  right: var(--ph-inset, 7%);
  bottom: 16px;
  height: 20px;
  pointer-events: none;
  --ph-core: #ceb59c;
  --ph-hot: rgba(255, 249, 240, 0.88);
  --ph-soft: rgba(206, 181, 156, 0.54);
  --ph-glow: rgba(225, 210, 195, 0.42);
  --ph-halo: rgba(215, 196, 175, 0.2);
}

.p-light i { position: absolute; left: 0; right: 0; display: block; }

.p-light .halo {
  top: 6px;
  height: 5px;
  background: linear-gradient(90deg, transparent 0%, var(--ph-halo) 42%, transparent 46%, transparent 54%, var(--ph-halo) 58%, transparent 100%);
  filter: blur(2.5px);
  opacity: 0.5;
}

.p-light .glow {
  top: 6px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--ph-glow) 36%, transparent 45%, transparent 55%, var(--ph-glow) 64%, transparent 100%);
  filter: blur(1.5px);
  opacity: 0.66;
}

.p-light .core {
  top: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--ph-soft) 18%, var(--ph-core) 42%, transparent 46%, transparent 54%, var(--ph-core) 58%, var(--ph-soft) 82%, transparent 100%);
}

.p-light .hot {
  top: 5px;
  height: 1px;
  opacity: 0.7;
  background: linear-gradient(90deg, transparent 24%, var(--ph-hot) 38%, transparent 45%, transparent 55%, var(--ph-hot) 62%, transparent 76%);
}

.p-light .p-icon {
  position: absolute;
  left: 50%;
  top: -9px;
  z-index: 1;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ph-core);
  background: radial-gradient(circle at 50% 50%, var(--ph-halo) 0%, transparent 46%);
  filter: drop-shadow(0 0 1px var(--ph-halo)) drop-shadow(0 0 3px var(--ph-halo));
}

.p-light svg { width: 16px; height: 16px; }

/* 光带宽度：按各卡横向内边距 + 5px 收，跟画框卡（26px 内边距、7% 约 31px）同一个口径。
   只改两侧光线起点，图标仍是 50% 居中那枚，不跟着移动或缩放。 */
.drawer-body .p-light { --ph-inset: 23px; }
#screen-gate .p-light { --ph-inset: 23px; }
#guestbook .p-light { --ph-inset: 25px; }
#lift-pad .p-light { --ph-inset: 13px; }
#boot .p-light { --ph-inset: 27px; }

#panel-hall {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--mu-brick);
}

#panel h2 {
  font-family: inherit;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--mu-ink);
}

#panel-blurb { font-size: 14.5px; line-height: 1.8; color: var(--mu-ink-soft); }
#panel-down { font-size: 12.5px; color: var(--mu-ink-faint); }

#panel a, #panel button {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid rgba(124, 71, 48, 0.3);
  border-radius: 10px;
  color: var(--mu-ink);
}

#panel a:hover, #panel button:hover { background: rgba(157, 64, 48, 0.07); }

/* 后面这几条带 #panel 前缀：上面 #panel a / #panel button 带上了元素名，
   单写 #panel-portal 选择器权重不够，会被那条的 background:transparent 压掉。 */
#panel #panel-portal {
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border-color: transparent;
  color: #fdf7ea;
  box-shadow: 0 10px 20px rgba(126, 48, 34, 0.24);
}

#panel #panel-portal:hover { filter: brightness(1.06); background: linear-gradient(178deg, #ac4a35, #8f3626 88%); }

/* 右上角那颗 ×。卡片本身 fixed，它就是定位框，所以绝对定位贴在卡片右上 6px；
   带的两个 id 是为了压过上面 #panel a / #panel button 的 padding 和描边。 */
#panel #panel-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--mu-ink-soft);
  cursor: pointer;
}

#panel #panel-close:hover { background: rgba(157, 64, 48, 0.1); color: var(--mu-ink); }
#panel #panel-close:focus-visible { outline: 2px solid rgba(157, 64, 48, 0.45); outline-offset: 2px; }

/* 厅名那一行跟 × 同一高度，右边留出它的宽度，名字长了也不会钻到叉底下。 */
#panel-hall { padding-right: 26px; }

/* 欢迎卡。 */
#boot {
  width: min(460px, calc(100% - 32px));
  padding: 20px 22px 61px;
  background: rgba(250, 243, 230, 0.95);
  border: 1px solid var(--mu-line);
  border-radius: 18px;
  box-shadow: var(--mu-shadow);
}

#boot h2 {
  margin: 0 0 5px;
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--mu-ink);
}

#boot p.boot-sub { font-size: 12px; letter-spacing: 0.16em; color: var(--mu-brick); }
#boot p, #legend { font-size: 12.8px; line-height: 1.78; color: var(--mu-ink-soft); }

/* 留言板。 */
#guestbook {
  padding: 16px 20px 61px;
  background: rgba(250, 243, 230, 0.96);
  border: 1px solid var(--mu-line);
  border-radius: 18px;
  box-shadow: var(--mu-shadow);
  backdrop-filter: blur(9px);
}

#guestbook-tabs { gap: 20px; border-bottom-color: var(--mu-line); }

#guestbook-tabs button {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--mu-ink-faint);
}

#guestbook-tabs button[aria-selected="true"] { color: var(--mu-ink); border-bottom-color: var(--mu-brick); }

#guestbook textarea {
  border: 1px solid rgba(124, 71, 48, 0.28);
  border-radius: 10px;
  background: #fffdf7;
  color: var(--mu-ink);
}

#guestbook-send {
  padding: 9px 16px;
  font-weight: 700;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 0;
  border-radius: 9px;
  color: #fdf7ea;
}

#guestbook-list li { border-top-color: rgba(124, 71, 48, 0.12); }
#guestbook-list > li:last-child:not(.note-empty) { border-bottom-color: rgba(124, 71, 48, 0.12); }
.note-meta { font-size: 13px; color: var(--mu-ink-faint); }
.note-text { font-size: 15px; color: var(--mu-ink-soft); }

/* 放映厅设置卡。 */
#screen-gate {
  padding: 18px 18px 61px;
  background: rgba(250, 243, 230, 0.96);
  border: 1px solid var(--mu-line);
  border-radius: 16px;
  box-shadow: var(--mu-shadow);
}

#screen-gate h2 { font-family: inherit; font-size: 20px; font-weight: 800; letter-spacing: 0.04em; }
#screen-gate button { border: 1px solid rgba(124, 71, 48, 0.3); border-radius: 9px; color: var(--mu-ink); }
#screen-gate #screen-play { background: linear-gradient(178deg, #ac4a35, #8f3626 88%); border-color: transparent; color: #fdf7ea; }
#screen-gate #screen-pause { background: rgba(157, 64, 48, 0.1); border-color: rgba(157, 64, 48, 0.28); color: var(--mu-brick); font-weight: 700; }
#screen-volume { accent-color: var(--mu-brick); }
#screen-url { border: 1px solid rgba(124, 71, 48, 0.28); border-radius: 9px; background: #fffdf7; }

/* 聊天、提示、飘字。 */
#chat-input {
  padding: 11px 14px;
  font-size: 15px;
  color: var(--mu-ink);
  background: rgba(250, 243, 230, 0.96);
  border: 1px solid var(--mu-line);
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(58, 33, 24, 0.16);
}

.toast {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mu-ink);
  background: rgba(250, 243, 230, 0.96);
  border: 1px solid var(--mu-line);
  border-left: 3px solid var(--mu-brick);
  border-radius: 11px;
  box-shadow: 0 12px 26px rgba(58, 33, 24, 0.16);
}

#hover, #lift-hint {
  padding: 6px 10px;
  font-size: 13.5px;
  border-radius: 9px;
  box-shadow: 0 10px 22px rgba(58, 33, 24, 0.14);
}

#tab-hint, #seat-hint { color: var(--mu-ink); }
body.dark-sky #tab-hint, body.dark-sky #seat-hint { color: var(--mu-ink); text-shadow: 0 0 2px rgba(255, 252, 248, 1), 0 0 8px rgba(255, 252, 248, 0.95); }

/* 聊天和系统消息的胶囊壳子在上半截就定好了：深色半透底、暖白字，跟右上角延迟一致，
   这里不再改字色和字号，否则会被这行的 --mu-ink 压成深字、看不见。 */

#lift-pad button {
  border: 1px solid rgba(124, 71, 48, 0.2);
  border-radius: 9px;
  background: rgba(255, 253, 247, 0.8);
  color: var(--mu-ink);
}

#lift-pad button:hover, #lift-pad button:focus-visible { border-color: var(--mu-brick); }

#lift-pad button.chosen,
#lift-pad button.chosen:hover,
#lift-pad button.chosen:focus-visible {
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border-color: transparent;
  color: #fdf7ea;
}

#lift-pad button.passing, #lift-pad button.passing:hover { background: rgba(157, 64, 48, 0.1); border-color: rgba(157, 64, 48, 0.24); color: var(--mu-ink); }

#kick-card {
  padding: 22px 24px 18px;
  background: rgba(250, 243, 230, 0.98);
  border: 1px solid var(--mu-line);
  border-radius: 18px;
  box-shadow: var(--mu-shadow);
}

#kick-back {
  padding: 9px 16px;
  font-weight: 700;
  background: linear-gradient(178deg, #ac4a35, #8f3626 88%);
  border: 0;
  border-radius: 9px;
  color: #fdf7ea;
}

/* 进馆之后所有白卡只此一套，以大屏卡 #screen-gate 为准：0.92 白底、1.5px 白描边、16 圆角、
   深而散的投影、blur(10px) saturate(1.25)。大浮层（介绍、欢迎、留言板、放映厅、踢人）和
   汉堡菜单那一列（抽屉、汉堡按钮、地图、电梯、在线名单）全走这一条，别再各写一套。 */
#panel, #boot, #guestbook, #screen-gate, #kick-card,
#drawer-toggle, #lift-toggle, #map-card, #lift-pad, .drawer-body {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(18, 26, 59, 0.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  backdrop-filter: blur(10px) saturate(1.25);
}

.toast { background: rgba(255, 255, 255, 0.92); }

/* 欢迎卡挪到画面正中。 */
#lower #boot {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 40px));
  margin: 0;
  transform: translate(-50%, -50%);
}

#boot p.boot-exit {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--mu-ink);
}

@media (max-width: 720px) {
  /* 手机上顶左的楼层和顶右那排都往画面边收，保持同一行；刘海屏照样让开。 */
  #where {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    height: 36px;
  }
  #panel { padding: 22px 20px 61px; border-radius: 16px; }
  #boot { padding: 16px 18px 61px; border-radius: 16px; }
  #boot h2 { font-size: 19px; }
  #guestbook { padding: 14px 16px 61px; border-radius: 16px; }
  .drawer-body { padding: 14px 14px 61px; }
  /* 手机档内边距收窄，光带两侧跟着内收同样的口径（横向内边距 + 5px）。 */
  #boot .p-light { --ph-inset: 23px; }
  #guestbook .p-light { --ph-inset: 21px; }
  .drawer-body .p-light { --ph-inset: 19px; }
  /* 手机上卡片右内边距是 14px，跟着改，滑块照样离描边 6px。 */
  .drawer-main,
  .drawer-foot { margin-right: -8px; padding-right: 8px; }
  /* 消息页里面的列表再顶出去 8px，滑块跟设置、项目两页落在同一条竖线上。 */
  #drawer-message-list { margin-right: -8px; padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #drawer, #panel, #lower, #sys-peek li, #chatter li, #loading, #name-gate,
  .gate-enter, .gate-card, #drawer-toggle, #online, #day button,
  .menu-fold, .menu-fold svg { transition: none; }
  #tab-hint, #seat-hint, .load-earth, .load-stars,
  #screen-gate.gate-in, #screen-gate.gate-out,
  .drawer-body.drawer-in, .drawer-body.drawer-out,
  #guestbook.guest-in, #guestbook.guest-out,
  #panel.panel-in, #panel.panel-out { animation: none; }
}

/* 馆内输入控件聚焦时不再画黑色外圈。开始页的昵称框本来就没有黑圈，
   用砖红描边和柔光表示聚焦，保持原样；后台登录页是独立样式，也不受影响。 */
#corner input:focus,
#corner input:focus-visible,
#name-gate input:focus,
#name-gate input:focus-visible,
#chat-input:focus,
#chat-input:focus-visible,
#drawer-chat-input:focus,
#drawer-chat-input:focus-visible,
#guestbook textarea:focus,
#guestbook textarea:focus-visible,
#screen-gate input:focus,
#screen-gate input:focus-visible {
  outline: none;
}
