/* ---------------------------------------------------------------
   寻彩空间 · 门厅 + 作品墙
   暗场里照片缓慢上滚 -> ENTER MY ZONE -> 定住、亮起、可点开
   --------------------------------------------------------------- */

/* iOS：去掉点击时的灰色高亮块，滚动容器加上惯性 */
html {
  -webkit-tap-highlight-color: transparent;
}
.world,
.catview-scroll,
.board-list-wrap,
.brain {
  -webkit-overflow-scrolling: touch;
}

:root {
  --bg: #08080a;
  --bg-gate: #050507;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #e9e7e4;
  --text-dim: #a3a09b;
  --text-faint: #6e6b67;
  --hint: rgba(163, 160, 155, 0.55);

  /* 转场与灰阶空间 */
  --soft: #b8b5ae;
  --deep: #000000;
  --deep-fg: #f2efe9;
  --deep-line: rgba(242, 239, 233, 0.22);

  /* 灯箱 */
  --lb-bg: #050507;
  --lb-img-bg: #111114;
  --lb-nav-bg: rgba(20, 20, 22, 0.55);
  --lb-nav-bg-hover: rgba(32, 32, 35, 0.8);

  /* 滚动条 */
  --scroll: #2a2a2d;

  --sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  /* 小字标签统一用正文字体，不再用等宽/像素感的字体 */
  --label: var(--sans);

  --pad: clamp(18px, 4.2vw, 64px);
  /* 内容最大宽度：普通屏幕上还是 1680，超宽屏（4K/5K）才会跟着放大，填满屏幕 */
  --maxw: clamp(1680px, 92vw, 3000px);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 日间模式：只作用于进入之后的展示界面，门厅永远是暗场 */
html[data-theme="light"] {
  --bg: #f4f2ee;
  --line: rgba(18, 18, 22, 0.12);
  --line-strong: rgba(18, 18, 22, 0.26);
  --text: #121216;
  --text-dim: #4f4d49;
  --text-faint: #7d7a74;
  --hint: rgba(79, 77, 73, 0.62);

  --deep: #ffffff;
  --deep-fg: #121216;
  --deep-line: rgba(18, 18, 22, 0.16);

  --lb-bg: #f7f5f1;
  --lb-img-bg: #e7e4de;
  --lb-nav-bg: rgba(255, 255, 255, 0.66);
  --lb-nav-bg-hover: rgba(255, 255, 255, 0.94);

  --scroll: #c9c5be;
}

* { box-sizing: border-box; }

/* 点击 / 聚焦后不出现任何选中框：去掉所有 outline，改用不显眼的反馈 */
*:focus,
*:focus-visible { outline: none; }

button,
a,
img,
.tile,
.hud,
.foot,
.gate-ui,
.world,
.lb,
.theme-toggle {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
.hud,
.foot,
.gate-ui,
.tile {
  -webkit-user-select: none;
  user-select: none;
}

html {
  -webkit-text-size-adjust: 100%;
  /* 预留滚动条位置：门厅与作品墙宽度一致，交接时不会横向抖动 */
  scrollbar-gutter: stable;
  background: var(--bg);
  transition: background-color 0.5s var(--ease);
}
html.locked { overflow: hidden; }
html.lb-open { overflow: hidden; }
html.world-open { overflow: hidden; }
html.cat-open { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(216, 180, 140, 0.28); }

* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 9px; }
*::-webkit-scrollbar-track { background: transparent; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  line-height: 1.9;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--bg);
}

/* --------------------------------------------------------------- 门厅 */

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg-gate);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.55s var(--ease);
}
.gate.bye { opacity: 0; pointer-events: none; }

.field-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* 门厅：黑白 + 压暗，但靠对比度保住暗部层次；进入后回到彩色 */
  filter: grayscale(1) brightness(0.72) contrast(1.1);
  transition: filter 0.55s var(--ease);
}
.gate.lit .field-clip {
  filter: grayscale(0) brightness(1) contrast(1);
}

.field-frame {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* 内容做两份首尾相接，整体上移一份的高度，接缝刚好对上 */
.field {
  position: relative;
  width: 100%;
  --h: 0px;
  --dur: 120s;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  animation: rise var(--dur, 120s) linear infinite;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.field.ready { opacity: 1; }
.gate.lit .field {
  animation-play-state: paused;
}

@keyframes rise {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, calc(-1 * var(--h)), 0); }
}

.gate-dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    120% 100% at 50% 45%,
    rgba(6, 6, 8, 0.16) 0%,
    rgba(5, 5, 7, 0.52) 60%,
    rgba(4, 4, 6, 0.82) 100%
  );
  transition: opacity 0.6s var(--ease);
}
.gate.lit .gate-dim { opacity: 0; }

.gate-ui {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 2.4vw, 26px);
  padding: 0 24px;
  text-align: center;
}

/* --------------------------------------------------------------- 入口按钮 */

.enter {
  appearance: none;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(240, 236, 228, 0.4);
  border-radius: 2px;
  background: rgba(10, 10, 12, 0.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  color: #f2efe9;
  font-family: var(--sans);
  font-size: clamp(11.5px, 1.02vw, 13px);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 21px 33px 21px 39px;
  box-shadow:
    0 34px 90px -46px rgba(0, 0, 0, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  transition:
    background 0.45s var(--ease),
    color 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
}

@media (hover: hover) {
  .enter:hover {
  background: #f2efe9;
  color: #0b0b0c;
  border-color: #f2efe9;
  box-shadow: 0 30px 70px -40px rgba(242, 239, 233, 0.55);
  outline: none;
}
}


.enter:focus-visible {
  background: #f2efe9;
  color: #0b0b0c;
  border-color: #f2efe9;
  box-shadow: 0 30px 70px -40px rgba(242, 239, 233, 0.55);
  outline: none;
}

.enter:active { transform: translateY(1px); }

.enter.gone {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  pointer-events: none;
}

.gate-meta {
  margin: 0;
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(233, 231, 228, 0.42);
  transition: opacity 0.45s var(--ease);
}
.gate-meta.gone { opacity: 0; }

/* --------------------------------------------------------------- 转场 */

.portal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}
.portal[hidden] { display: none; }

.portal-word {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(34px, 10.5vw, 178px);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--soft);
  opacity: 0;
  transform: scale(0.94);
  will-change: transform, opacity;
  user-select: none;
}

.portal.on {
  pointer-events: auto;
}
.portal.on .portal-word {
  animation:
    portal-pop 0.22s cubic-bezier(0.2, 0.7, 0.3, 1) forwards,
    portal-blow 0.82s cubic-bezier(0.62, 0.02, 0.12, 1) 0.24s forwards;
}

/* 兜底：放大结束之后再补一层同色。
   它和字的颜色一模一样、又是在画面已经是这个颜色之后才出现，
   所以看不见；只是用来盖住某些机型（尤其手机上字体更细）
   最后一帧没铺满的角落。 */
.portal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--soft);
  opacity: 0;
  pointer-events: none;
}
.portal.on::after {
  animation: portal-fill 0.16s linear 0.98s forwards;
}
@keyframes portal-fill {
  to { opacity: 1; }
}

.portal.lift {
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

@keyframes portal-pop {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
/* 放大终点落在 W 顶部那块实心笔画里：画面"钻"进字母，
   最后整屏都是字色，不再需要额外补一层灰。
   --p-tx/--p-ty/--p-scale 由 app.js 按实际字号和视口算出来 */
@keyframes portal-blow {
  from { transform: translate(0, 0) scale(1); }
  to   {
    transform: translate(var(--p-tx, 0px), var(--p-ty, 0px))
               scale(var(--p-scale, 46));
  }
}

/* --------------------------------------------------------------- 新世界 */

.world {
  position: fixed;
  inset: 0;
  z-index: 88;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* 照片行放大 6% 时可能会顶出内容盒一点点，别让它冒横向滚动条 */
  overflow-x: hidden;
  /* 刚进来时是转场那层柔和的灰，随后加深到主题底色 */
  --w-bg: var(--soft);
  --w-fg: #0b0b0c;
  --w-line: rgba(11, 11, 12, 0.2);
  /* 内容左边缘到屏幕左边缘的距离：标题那条细线和眼睛页的返回键都用它 */
  --side: calc((100vw - min(100vw, clamp(1180px, 74vw, 2000px))) / 2 + var(--pad));
  background: var(--w-bg);
  color: var(--w-fg);
  /* 背景沉下去要利落一些；文字提前一点反白，避免中途和背景同色"消失" */
  transition: background-color 0.55s var(--ease), color 0.34s var(--ease) 0.12s;
}
.world.deep {
  --w-bg: var(--deep);
  --w-fg: var(--deep-fg);
  --w-line: var(--deep-line);
}
.world[hidden] { display: none; }
.world.closing {
  opacity: 0;
  transition: opacity 0.32s var(--ease);
  pointer-events: none;
}

/* 背景照片：黑场稳定之后再慢慢透出来，压在内容之下 */
.world-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--w-photo, none);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: var(--w-photo-pos, 50% 46%);
  filter: brightness(var(--w-photo-dim, 0.62)) contrast(1.04);
  opacity: 0;
  /* 提前提成独立图层，切日夜时开始淡出不会先卡一帧 */
  will-change: opacity;
  transition: opacity 1.6s var(--ease) 0.1s;
  pointer-events: none;
}
/* 压暗左侧（文字在这边）并收暗四角，保证字始终压得住 */
.world-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.82) 0%,
      rgba(0, 0, 0, 0.52) 34%,
      rgba(0, 0, 0, 0.12) 62%,
      rgba(0, 0, 0, 0) 100%),
    radial-gradient(125% 105% at 66% 46%,
      rgba(0, 0, 0, 0) 30%,
      rgba(0, 0, 0, 0.42) 78%,
      rgba(0, 0, 0, 0.78) 100%);
}
.world.deep .world-bg { opacity: 1; }
/* 日间模式是白底黑字，照片会和字打架，先不显示 */
html[data-theme="light"] .world.deep .world-bg { opacity: 0; }
/* 手动切日夜时背景图快速收放，别让文字先变色、照片还留着 */
.world.theme-swap .world-bg { transition-duration: 0.4s; }

.world-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  /* 普通屏幕还是 1180；超宽屏才放宽，别让新世界缩在屏幕中间 */
  max-width: clamp(1180px, 74vw, 2000px);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) var(--pad) clamp(26px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  gap: clamp(38px, 7vh, 86px);
  min-height: 100%;
  flex: 1 1 auto;
}

/* 进眼睛页时，整块内容和轨道按钮一起快速淡出 */
.world-inner,
.world-orbit {
  transition: opacity 0.22s var(--ease);
}
.world-inner.world-out,
.world-orbit.world-out {
  opacity: 0;
  pointer-events: none;
}

.world-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.world-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.world .theme-toggle { color: inherit; }

.world-back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 10px 16px 10px 13px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
@media (hover: hover) {
  .world-back:hover {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}
}

.world-back:focus-visible {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}

.world-back-arrow {
  font-size: 13px;
  line-height: 1;
  transform: translateY(-0.5px);
}

.world-tag {
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  opacity: 0.42;
}

.world-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 22px);
}
.world-body[hidden] { display: none; }

.world-heading {
  margin: 0;
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: inherit;
}

.world-sub {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(13.5px, 1.4vw, 15.5px);
  line-height: 1.8;
  color: inherit;
  opacity: 0.55;
}

/* 大标题 + 一条贯穿整页的细线 + 右端的眼睛 */
.world-head-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  width: 100%;
}

/* 标题和眼睛之间那一段：位置靠近页面中间，所以略粗一点 */
.world-rule {
  flex: 1 1 auto;
  min-width: 24px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.5;
  pointer-events: none;
}

/* 两端继续伸到屏幕边缘，越往外越淡 */
.world-head-row::before,
.world-head-row::after {
  content: "";
  position: absolute;
  top: calc(50% - 0.5px);
  width: calc(var(--side, 190px) - 18px);
  height: 1px;
  pointer-events: none;
  opacity: 0.42;
}
.world-head-row::before {
  right: calc(100% + 18px);
  background: linear-gradient(90deg,
    transparent 0%, currentColor 58%, currentColor 100%);
}
.world-head-row::after {
  left: calc(100% + 18px);
  background: linear-gradient(90deg,
    currentColor 0%, currentColor 42%, transparent 100%);
}

/* 眼睛按钮：和标题差不多大，鼠标移上去眨一次 */
.world-eye {
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(70px, 12.95vw, 141px);
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.62;
  cursor: pointer;
  transition: opacity 0.28s var(--ease);
}
@media (hover: hover) {
  .world-eye:hover { opacity: 0.95; }
}
.world-eye:focus-visible {
  opacity: 1;
  outline: 1px solid var(--w-line);
  outline-offset: 6px;
}
.world-eye .eye-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
/* 以眼睛中心为轴上下压扁，描边不跟着变细（按钮和眼睛页共用） */
.eye-shape {
  transform-box: view-box;
  transform-origin: 24px 15px;
}
@media (hover: hover) {
  .world-eye:hover .eye-shape,
  .world-eye:focus-visible .eye-shape {
    animation: eye-blink 700ms cubic-bezier(0.33, 0, 0.2, 1);
  }
}
@keyframes eye-blink {
  0%   { transform: scaleY(1); }
  18%  { transform: scaleY(0.6); }
  30%  { transform: scaleY(0.04); }
  41%  { transform: scaleY(0.04); }
  62%  { transform: scaleY(1.05); }
  78%  { transform: scaleY(0.98); }
  100% { transform: scaleY(1); }
}

/* ---------------- 眼睛页 ---------------- */

.eye-page {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: var(--w-bg);
  color: var(--w-fg);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  animation: eye-page-in 420ms var(--ease) both;
}
.eye-page[hidden] { display: none; }
@keyframes eye-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 透视轨道层：新世界里在大背景之上、内容之下；眼睛页里在大眼之下 */
.world-orbit-line,
.eye-orbit-line {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.world-orbit-line { position: fixed; }
.world-orbit-line.on,
.eye-orbit-line.on { opacity: 1; }

/* 点眼睛后：新世界的内容、轨道按钮、背景照片一起淡出 */
.world.eye-out .world-inner,
.world.eye-out .world-orbit {
  opacity: 0;
  pointer-events: none;
}
.world.eye-out .world-bg {
  opacity: 0;
  transition-duration: 0.35s;
}

/* 飞行中的那只眼（临时克隆，浮在所有东西上面） */
.eye-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 300;
  pointer-events: none;
  overflow: visible;
  will-change: transform;
}

/* 点眼睛后四散的粒子：一整张画布，几千个点在上面飞 */
.world-shards {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: block;
  pointer-events: none;
}

/* 从轨道飞过来的那一帧起，大眼已经在终点就位，不要再淡入 */
.eye-page.arrive { animation: none; }
.eye-page.arrive .eye-big {
  /* 落地后接着缓慢放大一点点，把飞行的惯性收住，不会"啪"地停住 */
  animation: eye-settle 1500ms cubic-bezier(0.16, 0.62, 0.24, 1) forwards;
  opacity: 1;
}
@keyframes eye-settle {
  from { transform: translateX(-32%) scale(1); }
  to   { transform: translateX(-32%) scale(1.05); }
}

.eye-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* 大眼：宽高跟着屏幕走，左边大约四分之一在屏幕外 */
.eye-big {
  display: block;
  width: min(94vw, 118vh, 1500px);
  height: auto;
  transform: translateX(-32%);
  animation: eye-in 900ms cubic-bezier(0.22, 0.61, 0.36, 1) 120ms both;
}
@keyframes eye-in {
  from { opacity: 0; transform: translateX(-32%) scale(0.97); }
  to   { opacity: 1; transform: translateX(-32%) scale(1); }
}

/* 大眼随机眨动 */
.eye-big .eye-shape.blink {
  animation: eye-blink 700ms cubic-bezier(0.33, 0, 0.2, 1);
}

/* 右上角返回：没有边框，只有一个短箭头，点击面积和原来的返回键一致 */
.eye-back {
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  right: var(--side, 24px);
  z-index: 2;
  width: 76px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.25s var(--ease);
}
.eye-back svg {
  display: block;
  width: 16px;
  height: 16px;
}
@media (hover: hover) {
  .eye-back:hover { opacity: 0.95; }
}
.eye-back:focus-visible {
  opacity: 1;
  outline: 1px solid var(--w-line);
  outline-offset: 3px;
}

/* 眼睛页右上角：返回键左边的日夜切换 */
.eye-page .eye-theme {
  position: absolute;
  top: calc(clamp(18px, 3vw, 32px) + 1.5px);
  right: calc(var(--side, 24px) + 76px + 18px);
  z-index: 2;
  width: 32px;
  height: 32px;
  color: inherit;
  opacity: 0.5;
  transition: opacity 0.25s var(--ease), transform 0.4s var(--ease);
}
.eye-page .eye-theme svg {
  width: 18px;
  height: 18px;
}
@media (hover: hover) {
  .eye-page .eye-theme:hover { opacity: 0.95; }
}
.eye-page .eye-theme:focus-visible {
  opacity: 1;
  outline: 1px solid var(--w-line);
  outline-offset: 3px;
}

/* 日间模式下按钮要落回正文里这一排的位置，用它来定位 */
.world-orbit-anchor {
  width: 100%;
  height: 46px;
  margin-top: clamp(10px, 2vw, 20px);
  pointer-events: none;
}

/* 四个按钮浮在背景光晕外的椭圆轨道上，位置由 app.js 按光心算 */
.world-orbit {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.world-orbit[hidden] { display: none; }

.world-orbit .world-btn {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  white-space: nowrap;
  pointer-events: auto;
  transform-origin: 50% 50%;
  opacity: var(--o, 1);
  /* 转到灯柱这类亮处时，靠一点阴影保证字还看得清 */
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  transform:
    translate3d(var(--ox, 0px), var(--oy, 0px), 0)
    translate(-50%, -50%)
    scale(var(--s, 1));
  /* 位置每帧都在变，绝不能把 transform 也放进过渡里 */
  transition: background 0.32s var(--ease), color 0.32s var(--ease),
    border-color 0.32s var(--ease);
  will-change: transform, opacity;
}
/* 日间模式落回正文那一排：不再需要阴影，也不做远近缩放 */
.world-orbit.row .world-btn { text-shadow: none; }

/* 点进子页面前：其余按钮快速淡出，被点的那个移到中心再淡出 */
.world-orbit .world-btn.leaving-dim {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease);
}
.world-orbit .world-btn.leaving-focus {
  opacity: 0;
  pointer-events: none;
  transition: transform 0.52s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.34s var(--ease) 0.34s;
}
.world-body.leaving {
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

@media (hover: hover) {
  /* 悬停时不管远近都实心显示 */
.world-orbit .world-btn:hover { opacity: 1; text-shadow: none; }
}


.world-orbit .world-btn:focus-visible { opacity: 1; text-shadow: none; }
/* 按下时不要覆盖掉轨道位置 */
.world-orbit .world-btn:active {
  transform:
    translate3d(var(--ox, 0px), var(--oy, 0px), 0)
    translate(-50%, -50%)
    scale(var(--s, 1));
}

.world-btn {
  appearance: none;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 15px 26px;
  cursor: pointer;
  transition: background 0.32s var(--ease), color 0.32s var(--ease),
    border-color 0.32s var(--ease), transform 0.32s var(--ease);
}
@media (hover: hover) {
  .world-btn:hover {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}
}

.world-btn:focus-visible {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}
.world-btn:active { transform: translateY(1px); }

.world-note {
  margin: 0;
  min-height: 1.6em;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: inherit;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.world-note.show { opacity: 0.55; transform: none; }

/* --------------------------------------------------------------- 留言板 */

.board {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.6vw, 28px);
  width: 100%;
  max-width: 760px;
}
.board[hidden] { display: none; }

.board-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.board-title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 300;
  letter-spacing: 0.12em;
}

.board-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board-textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.75;
  padding: 14px 16px;
  transition: border-color 0.3s var(--ease);
}
.board-textarea::placeholder { color: currentColor; opacity: 0.35; }
.board-textarea:focus { border-color: var(--w-fg); }

.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.board-vis {
  display: inline-flex;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  overflow: hidden;
}
.board-vis button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.board-vis button + button { border-left: 1px solid var(--w-line); }
.board-vis button[aria-pressed="true"] { background: var(--w-fg); color: var(--w-bg); }

.board-count {
  margin-right: auto;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.4;
}

.board-send {
  appearance: none;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.18em;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease), opacity 0.3s;
}
@media (hover: hover) {
  .board-send:hover:not(:disabled) {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
}
}
.board-send:disabled { opacity: 0.4; cursor: default; }

.board-msg {
  margin: 0;
  min-height: 1.5em;
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.board-msg.show { opacity: 0.6; }

.board-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--w-line);
  padding-top: 18px;
}

.board-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-list-title {
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
}

.board-owner {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 4px 0;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.25s;
}
@media (hover: hover) {
  .board-owner:hover { opacity: 0.8; }
}

.board-owner-form { display: flex; gap: 8px; }
.board-owner-form[hidden] { display: none; }

.board-owner-input {
  flex: 1 1 auto;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 10px 12px;
}
.board-owner-input:focus { border-color: var(--w-fg); }

/* iOS 上聚焦 font-size 小于 16px 的输入框会强制放大整页，触屏设备补到 16px */
.ios .board-textarea,
.ios .board-owner-input { font-size: 16px; }

.board-list { list-style: none; margin: 0; padding: 0; }

.board-item { padding: 16px 0; border-bottom: 1px solid var(--w-line); }
.board-item:last-child { border-bottom: 0; }

.board-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.45;
}

.board-badge {
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 5px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.board-text {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.board-hide {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--label);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  padding: 2px 0;
  opacity: 0.5;
  cursor: pointer;
}
@media (hover: hover) {
  .board-hide:hover { opacity: 1; }
}

.board-empty {
  margin: 0;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0.35;
}
.board-empty[hidden] { display: none; }

/* --------------------------------------------------------------- 关于 / 感谢墙 */

.about {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.6vw, 26px);
  width: 100%;
  padding-bottom: 8vh;
}
.about[hidden] { display: none; }

.about-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.about-sub {
  margin: 0;
  font-size: clamp(12.5px, 1.4vw, 14.5px);
  letter-spacing: 0.06em;
  line-height: 1.8;
  opacity: 0.5;
}

/* 两列"墙"，卡片高度随文字自然错落 */
.about-wall {
  columns: 2;
  column-gap: clamp(12px, 2vw, 22px);
}

.thanks-card {
  break-inside: avoid;
  margin: 0 0 clamp(12px, 2vw, 20px);
  padding: clamp(14px, 1.8vw, 20px) clamp(16px, 2vw, 22px);
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
}

.thanks-from {
  margin: 0 0 8px;
  font-family: var(--label);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  opacity: 0.72;
}

.thanks-text {
  margin: 0;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.85;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.about-empty {
  margin: 0;
  font-size: 13px;
  opacity: 0.4;
}

@media (max-width: 760px) {
  .about-wall { columns: 1; }
}

/* --------------------------------------------------------------- 作品分类 */

.cats {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
  width: 100%;
}
.cats[hidden] { display: none; }

.cats-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 3vw, 34px) clamp(14px, 2.5vw, 30px);
  padding: 6px 0 20px;
}

/* 正方形封面 */
.cover {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: clamp(148px, 15vw, 208px);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s var(--ease);
}
@media (hover: hover) {
  .cover:hover { transform: translateY(-2px); }
}

.cover:focus-visible { transform: translateY(-2px); }

.cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: var(--lb-img-bg);
  box-shadow: 0 16px 34px -22px rgba(0, 0, 0, 0.8);
}

.cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.4s var(--ease);
}

/* 老 iOS（15 以前）不认 aspect-ratio，用 padding 撑成正方形 */
@supports not (aspect-ratio: 1 / 1) {
  .cover-img { height: 0; padding-bottom: 100%; position: relative; }
  .cover-img img { position: absolute; inset: 0; }
  .color-pick-item { height: 0; padding-bottom: 100%; position: relative; }
  .color-pick-item img { position: absolute; inset: 0; }
}
@media (hover: hover) {
  .cover:hover .cover-img img {
  transform: scale(1.045);
  filter: brightness(1.06);
}
}

.cover:focus-visible .cover-img img {
  transform: scale(1.045);
  filter: brightness(1.06);
}

.cover-name {
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.cover-count {
  margin-top: -4px;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.45;
}

/* --------------------------------------------------------------- 分类照片墙 */

.catview {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  opacity: 0;
  transition: opacity 0.22s var(--ease), background-color 0.5s var(--ease),
    color 0.5s var(--ease);
  --w-bg: var(--bg);
  --w-fg: var(--text);
  --w-line: var(--line);
}
.catview[hidden] { display: none; }
.catview.on { opacity: 1; }

.catview-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.catview-title {
  font-size: 13px;
  letter-spacing: 0.1em;
}

.catview-meta {
  margin-right: auto;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.45;
}

.catview-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
}

.catview-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--pad) 64px;
}

.catview-wall { position: relative; }

/* --------------------------------------------------------------- 照片块 */

.tile {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  overflow: hidden;
  background: var(--lb-img-bg);
  transform-origin: 50% 50%;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease), filter 0.5s var(--ease);
}

.gate .tile { pointer-events: none; }

.wall .tile { cursor: zoom-in; }
@media (hover: hover) {
  .wall .tile:hover img {
  transform: scale(1.035);
  filter: brightness(1.07);
}
}

.wall .tile:focus-visible img {
  transform: scale(1.035);
  filter: brightness(1.07);
}
.wall .tile:focus-visible img { transform: scale(1.035); filter: brightness(1.07); }

/* --------------------------------------------------------------- 顶栏 */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--pad) 30px;
  background: var(--bg);
  /* 用遮罩做出向下渐隐，换主题时颜色可以平滑过渡 */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.8s var(--ease) 0.1s, transform 0.8s var(--ease) 0.1s,
    background-color 0.5s var(--ease);
  pointer-events: none;
}
body.revealed .hud { opacity: 1; transform: none; }

.hud-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 日夜切换和「新 世 界」之间的一道细竖线 */
.hud-sep {
  flex: none;
  width: 1px;
  height: 13px;
  background: var(--line-strong);
  opacity: 0.9;
}

/* 日夜切换：太阳 / 月亮两个图标交叉淡入淡出 */
.theme-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.5s var(--ease), transform 0.4s var(--ease);
}
@media (hover: hover) {
  .theme-toggle:hover { transform: scale(1.08); }
}
.theme-toggle:focus-visible { transform: scale(1.12); }

.theme-toggle svg {
  position: absolute;
  width: 15px;
  height: 15px;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.theme-toggle .ico-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle .ico-moon { opacity: 0; transform: rotate(-45deg) scale(0.55); }
html[data-theme="light"] .theme-toggle .ico-sun { opacity: 0; transform: rotate(45deg) scale(0.55); }
html[data-theme="light"] .theme-toggle .ico-moon { opacity: 1; transform: rotate(0deg) scale(1); }

.hud-title {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 0;
  margin: -8px 0;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.hud-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease);
}

@media (hover: hover) {
  .hud-title:hover::after { transform: scaleX(1); }
}


.hud-title:focus-visible::after { transform: scaleX(1); }

.hud-title.gone {
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
}

/* --------------------------------------------------------------- 作品墙 */

.wall-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.wall { position: relative; transition: filter 0.6s var(--ease); }

/* 进入新世界时，作品墙同步变成和门厅一样的黑白（比门厅稍亮，但不过曝） */
html.bw .wall { filter: grayscale(1) brightness(0.84) contrast(1.04); }

/* --------------------------------------------------------------- 页脚 */

.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(30px, 4vw, 56px) var(--pad) 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.9s var(--ease) 0.25s, color 0.5s var(--ease);
}
body.revealed .foot { opacity: 1; }

.foot-hint { color: var(--hint); }
.foot-author { margin-left: auto; }

/* --------------------------------------------------------------- 灯箱 */

.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--lb-bg);
  opacity: 0;
  transition: opacity 0.32s var(--ease), background-color 0.5s var(--ease);
}
.lb.open { opacity: 1; }
.lb[hidden] { display: none; }

.lb-top {
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.lb-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-count {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.lb-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  padding: 10px;
  cursor: pointer;
  transition: color 0.2s;
}
@media (hover: hover) {
  .lb-x:hover { color: var(--text); }
}

.lb-x:focus-visible { color: var(--text); }

.lb-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 「头脑风暴」已经移到顶栏，右边只留一点呼吸位 */
  padding: 0 clamp(24px, 4vw, 96px) 0 clamp(12px, 7vw, 110px);
  /* 左右滑切换由 JS 处理；别让 iOS 顺手把后面的页面也滚了 */
  touch-action: none;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--lb-img-bg);
  opacity: 0;
  transform: scale(0.995);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease),
    background-color 0.5s var(--ease);
}
.lb-img.ready { opacity: 1; transform: scale(1); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* 照片自身带 transform，会另起一层；不抬高这里，窄屏上左边的 ‹ 会被照片盖住 */
  z-index: 3;
  appearance: none;
  border: 1px solid transparent;
  background: var(--lb-nav-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding-bottom: 3px;
  transition: color 0.2s, background 0.3s var(--ease), border-color 0.2s, opacity 0.2s;
  opacity: 0.55;
}
@media (hover: hover) {
  .lb-nav:hover { color: var(--text); background: var(--lb-nav-bg-hover); border-color: var(--line); opacity: 1; }
}

.lb-nav:focus-visible { color: var(--text); background: var(--lb-nav-bg-hover); border-color: var(--line); opacity: 1; }
.lb-nav.prev { left: clamp(6px, 1.6vw, 22px); }
.lb-nav.next { right: clamp(6px, 1.6vw, 22px); }

.lb-bar {
  flex: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  padding: 16px clamp(16px, 3vw, 40px) 22px;
  border-top: 1px solid var(--line);
}

.lb-when {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
}

.lb-exif {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* --------------------------------------------------------------- 头脑风暴 */

/* 「头脑风暴」按钮挪到灯箱右上角，和日夜切换、关闭排成一行 */
.lb-brain {
  pointer-events: auto;
  appearance: none;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  height: 26px;                 /* 和日夜切换一样高，横向排起来才齐 */
  padding: 0 2px;
  color: var(--text);
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  opacity: 0.72;
  transition: opacity 0.25s var(--ease);
}

/* 按钮之间的浅竖线 */
.lb-divider {
  flex: none;
  width: 1px;
  height: 13px;
  background: currentColor;
  opacity: 0.16;
}
.lb-brain::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s var(--ease);
}
@media (hover: hover) {
  .lb-brain:hover { opacity: 1; }
}

.lb-brain:focus-visible { opacity: 1; }
@media (hover: hover) {
  .lb-brain:hover::after { transform: scaleX(1); }
}

.lb-brain:focus-visible::after { transform: scaleX(1); }

.brain {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--lb-bg);
  opacity: 0;
  overflow: hidden;   /* 蛛网模式的外圈照片故意放到视口之外，这里裁掉 */
  transition: opacity 0.3s var(--ease);
}
.brain[hidden] { display: none; }
.brain.on { opacity: 1; }

/* 右上角：蛛网 / 联想 两个模式 */
.brain-modes {
  position: absolute;
  top: 14px;
  right: 58px;
  z-index: 3;
  display: flex;
  gap: 18px;
}
.brain-mode {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--text-faint);
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.2em;
  cursor: pointer;
  position: relative;
  opacity: 0.7;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.brain-mode::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  opacity: 0.65;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s var(--ease);
}
.brain-mode.on { color: var(--text); opacity: 1; }
.brain-mode.on::after { transform: scaleX(1); }
@media (hover: hover) {
  .brain-mode:hover { color: var(--text); opacity: 1; }
}
.brain-mode:focus-visible { color: var(--text); opacity: 1; outline: none; }
.brain-mode:focus-visible::after { transform: scaleX(1); }

.brain-stage {
  position: absolute;
  inset: 0;
  will-change: transform;
  /* 蛛网模式要拖动整张网，别让浏览器把滑动当成滚动/缩放 */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.brain-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  appearance: none;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  padding: 12px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
@media (hover: hover) {
  .brain-close:hover { color: var(--text); }
}

.brain-nodes { transition: opacity 0.3s var(--ease); transform-origin: 0 0; }

.brain-rays {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--text);
  pointer-events: none;
  transform-origin: 0 0;
  /* 网可以拖到视口外，线的端点也会跑出去，别被 svg 自己裁掉 */
  overflow: visible;
}
.brain-rays line {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.22;
  transition: stroke-dashoffset 0.7s var(--ease);
}

.brain-center {
  position: absolute;
  overflow: hidden;
  border-radius: 2px;
  background: var(--lb-img-bg);
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.92);
  transform-origin: 50% 50%;
  cursor: zoom-in;
}
.brain-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brain-node {
  position: absolute;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--lb-img-bg);
  cursor: pointer;
  opacity: 0;
  /* --node-scale：按屏幕位置的大小（蛛网模式用）；--node-in：入场缩放 */
  transform: scale(calc(var(--node-scale, 1) * var(--node-in, 1)));
  transition: opacity 0.4s var(--ease), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.3s var(--ease), box-shadow 0.45s var(--ease);
}
/* 蛛网模式里，谁占住中心那一格谁就是"中心照片" */
.brain-node.is-center {
  z-index: 3;
  border-color: transparent;
  box-shadow: 0 34px 90px -34px rgba(0, 0, 0, 0.92);
  cursor: zoom-in;
}
/* 蛛网模式里越靠外的照片越淡，--node-alpha 由脚本逐张给 */
.brain.on .brain-node { opacity: var(--node-alpha, 1); }
.brain.on .brain-node.far { filter: brightness(0.82); }
@media (hover: hover) {
  .brain-node:hover { border-color: var(--line-strong); }
}

.brain-node:focus-visible { border-color: var(--line-strong); }
.brain-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brain-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0;
  text-align: center;
  font-family: var(--label);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.45s;
}
.brain.on .brain-hint { opacity: 1; }

/* 点星图照片后飞向灯箱的那张 */
.brain-fly {
  position: fixed;
  z-index: 120;
  overflow: hidden;
  border-radius: 2px;
  background: var(--lb-img-bg);
  pointer-events: none;
  will-change: left, top, width, height;
}
.brain-fly img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------- 寻彩 */

.game {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 30px);
  width: 100%;
  flex: 1 1 auto;
  min-height: 56vh;
}
.game[hidden] { display: none; }

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-progress {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.42;
}

/* 连对提示：连对两次以上才出现，空着的时候不占宽度，不会把进度挤走 */
.game-streak {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.72;
  white-space: nowrap;
}

.game-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
}

.game-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vh, 26px);
  width: 100%;
}
.game-pane[hidden] { display: none; }

/* 开始 / 结算稍微往下一点，出题画面则贴着上方 */
#game-intro,
#game-result { padding-top: clamp(24px, 11vh, 120px); }

/* 出题时题目词靠上居中，照片在下面 */
#game-play {
  position: relative;
  justify-content: flex-start;
  padding-top: clamp(10px, 4vh, 46px);
  gap: clamp(10px, 3.5vh, 46px);
  transition: opacity 0.5s var(--ease);
}
#game-play.out { opacity: 0; }
/* 内容压在光晕上面（不能用负 z-index，会被 .world 的背景盖住） */
#game-play > .game-headline,
#game-play > .game-cards {
  position: relative;
  z-index: 1;
}

/* 每轮换题时整块淡入，不给单张卡片做动画，免得和后面的变色打架 */
.game-pane.round-in { animation: game-in 0.5s var(--ease); }
@keyframes game-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.game-lead {
  margin: 0;
  font-size: clamp(12.5px, 1.4vw, 14.5px);
  letter-spacing: 0.06em;
  line-height: 1.9;
  opacity: 0.5;
  text-align: center;
}

/* 玩法切换：两个连成一组的小按钮，选中的那个反白 */
.game-modes {
  display: inline-flex;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  overflow: hidden;
}

.game-mode {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.game-mode + .game-mode { border-left: 1px solid var(--w-line); }
.game-mode[aria-pressed="true"] {
  background: var(--w-fg);
  color: var(--w-bg);
}
@media (hover: hover) {
  .game-mode:hover {
  background: var(--w-fg);
  color: var(--w-bg);
}
}
.game-mode:focus-visible {
  background: var(--w-fg);
  color: var(--w-bg);
}

.game-btn {
  appearance: none;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  padding: 15px 32px;
  cursor: pointer;
  transition: background 0.32s var(--ease), color 0.32s var(--ease),
    border-color 0.32s var(--ease);
}
@media (hover: hover) {
  .game-btn:hover {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}
}

.game-btn:focus-visible {
  background: var(--w-fg);
  color: var(--w-bg);
  border-color: var(--w-fg);
  outline: none;
}

/* 题目词：画面正上方居中 */
.game-word {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 52px);
  font-weight: 300;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  line-height: 1.1;
  transition: opacity 0.3s var(--ease);
}
/* 「正确！」「再来！」这种判定词，字距收一点 */
.game-word.verdict {
  letter-spacing: 0.06em;
  text-indent: 0.06em;
}

/* 题目词 + 一行玩法说明，绑成一块，和照片之间才有一个正常的间距 */
.game-headline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.game-hint {
  margin: 0;
  font-family: var(--label);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  opacity: 0.4;
  text-align: center;
  transition: opacity 0.3s var(--ease);
}

/* 出题画面：四张画框只允许两种排法——一行四张，或 2×2 四角。
   用网格排，列数和每张的宽度由 JS 按屏幕算好写进 --card-w（见 fitGameCards），
   所以永远不会出现「三张 + 一张掉到下面」这种半吊子换行。
   照片绝对定位贴在画框里，100% × 100%，跟着画框同步缩放。 */
.game-cards {
  display: grid;
  grid-template-columns: repeat(4, 160px);
  justify-content: center;
  align-items: start;
  gap: clamp(10px, 1.6vw, 22px);
  width: 100%;
  height: auto !important;
}

/* 一格 = 画框 + 下面那行占比数字（只在「找最多」里出现）。
   数字那行始终占着位置（min-height），所以出现时不会把照片顶动、也不会压到照片上。 */
.game-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.game-pct {
  display: none;
  font-family: var(--label);
  font-size: 11px;
  line-height: 14px;
  min-height: 14px;
  letter-spacing: 0.06em;
  opacity: 0.55;
  white-space: nowrap;
}
.game-cards.with-pct .game-pct { display: block; }

.game-card {
  appearance: none;
  position: relative;
  display: block;
  flex: 0 0 auto !important;
  align-self: center !important;
  padding: 0;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: var(--lb-img-bg);
  width: 100% !important;
  height: var(--card-h, 213px) !important;
  min-height: 0 !important;
  max-height: var(--card-h, 213px) !important;
  overflow: hidden;
  cursor: pointer;
  /* 褪得只剩一丝颜色：黑白里能隐约看出色偏 */
  --card-dim: 0.75;
  --card-lit: 1;
  filter: grayscale(0.92) brightness(var(--card-dim));
  transition: filter 0.9s var(--ease), opacity 0.55s var(--ease),
    transform 0.55s var(--ease), border-color 0.3s var(--ease);
}
html[data-theme="light"] .game-card { --card-dim: 1; }

.game-card img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;          /* 照片原样完整显示，不拉伸、不裁切 */
  transform-origin: 50% 50%;
  transition: transform 0.9s var(--ease);
}
/* 揭晓时只有照片在画框里等比放大 6%，画框尺寸位置完全不变 */
.game-card.color img { transform: scale(1.06); }

/* 答错时把正确的那张也点亮：只换边框颜色，不动尺寸和位置 */
.game-card.right { border-color: var(--w-fg); }

@media (hover: hover) {
  .game-card:hover {
  border-color: var(--w-fg);
  outline: none;
}
}

.game-card:focus-visible {
  border-color: var(--w-fg);
  outline: none;
}
.game-cards.locked .game-card { pointer-events: none; cursor: default; }

/* 揭晓：选中的（答对时是全部）恢复彩色，亮度提到和门厅彩色一致 */
.game-card.color { filter: grayscale(0) brightness(var(--card-lit, 1)); }

/* 答对瞬间：颜色"涌"上来，先过饱和再回落到正常 */
/* 选错时，没被选中的那几张一边往下滑、一边淡出（只动 transform/opacity，不改尺寸） */
.game-cards.fade .game-card:not(.color) {
  opacity: 0;
  transform: translateY(28px);
}

.game-label {
  margin: 0;
  font-family: var(--label);
  font-size: 11.5px;
  letter-spacing: 0.26em;
  opacity: 0.45;
}

.game-score {
  margin: 0;
  font-size: clamp(46px, 7.5vw, 92px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* 结算：这一局每一题的对错，一排小圆点 */
.game-recap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 10px;
}
.recap-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.3;
  transition: opacity 0.3s var(--ease);
}
.recap-dot.ok {
  background: currentColor;
  opacity: 1;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.game-perfect {
  margin: 0;
  font-size: clamp(15px, 2.1vw, 23px);
  letter-spacing: 0.16em;
}
.game-perfect.show { animation: perfect-in 0.7s var(--ease) both; }
.game-perfect.top { font-size: clamp(17px, 2.5vw, 29px); }
@keyframes perfect-in {
  from { opacity: 0; transform: scale(0.94); letter-spacing: 0.32em; }
  to   { opacity: 1; transform: none; letter-spacing: 0.16em; }
}

/* --------------------------------------------------------------- 寻彩入口 */

.game-hub {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 28px);
  width: 100%;
  flex: 1 1 auto;
  min-height: 56vh;
}
.game-hub[hidden] { display: none; }

.hub-list {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vw, 20px);
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-top: clamp(8px, 5vh, 60px);
}

.hub-item {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: clamp(18px, 2.6vw, 26px) clamp(20px, 3vw, 32px);
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.32s var(--ease), color 0.32s var(--ease),
    border-color 0.32s var(--ease), transform 0.32s var(--ease);
}
@media (hover: hover) {
  .hub-item:hover { background: var(--w-fg); color: var(--w-bg); border-color: var(--w-fg); }
}
.hub-item:active { transform: translateY(1px); }
.hub-title { font-size: clamp(16px, 2.1vw, 21px); letter-spacing: 0.14em; }
.hub-desc {
  font-size: clamp(11.5px, 1.3vw, 13px);
  letter-spacing: 0.06em;
  line-height: 1.8;
  opacity: 0.55;
}
@media (hover: hover) { .hub-item:hover .hub-desc { opacity: 0.7; } }

/* --------------------------------------------------------------- 专属色彩 */

.color {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 56vh;
}
.color[hidden] { display: none; }

/* 步骤提示 */
.color-step {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.45;
}

.color-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: clamp(380px, 60vh, 640px);
}

/* 当前颜色的柔光，铺在舞台后面 */
.color-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92%, 760px);
  height: min(92%, 760px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, transparent) 0%, transparent 64%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}

.rgb-dial {
  position: absolute;
  left: 50%;
  top: 50%;
  /* 同时看宽和高：横屏手机、大屏都不会太大或太小 */
  width: clamp(84px, min(11vw, 14vh), 128px);
  height: clamp(84px, min(11vw, 14vh), 128px);
  border-radius: 50%;
  border: 1px solid var(--w-line);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: left 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    top 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.4s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.45s var(--ease), background 0.3s var(--ease);
}
.rgb-dial.on {
  border-color: var(--dial-c, var(--w-fg));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
}
.rgb-letter {
  font-family: var(--label);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  opacity: 0.62;
}
.rgb-num { font-size: clamp(19px, 2.6vw, 28px); font-weight: 300; line-height: 1; }

/* 开场 */
.color-intro {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vh, 34px);
  padding: 0 8%;
  text-align: center;
  animation: color-in 0.5s var(--ease) both;
}
.color-intro[hidden] { display: none; }
.color-lead {
  margin: 0;
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 2;
  letter-spacing: 0.08em;
  opacity: 0.62;
}

/* 调值：色块 + 色值 + 滑杆 + 下一步 */
.color-controls {
  /* 贴住舞台底部：不管屏幕多矮，按钮都不会被推到屏幕外 */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  padding: 0 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 16px);
  animation: color-in 0.4s var(--ease) both;
}
/* 滑杆现在是普通流式元素（以前是绝对定位贴在舞台上） */
.color-controls .color-range,
.color-wheel .color-range {
  position: static;
  transform: none;
  width: 100%;
  max-width: 360px;
}
.color-controls[hidden] { display: none; }

.color-readout {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--label);
  font-size: 11.5px;
  letter-spacing: 0.16em;
}
.color-chip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--w-line);
  background: #c87850;
  transition: background 0.25s var(--ease);
}
.color-hex { opacity: 0.55; }

/* 自定义滑杆：已填部分用当前通道色 */
.color-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--trk, #888) 0%,
    var(--trk, #888) var(--fill, 50%),
    rgba(255, 255, 255, 0.14) var(--fill, 50%),
    rgba(255, 255, 255, 0.14) 100%);
  cursor: pointer;
  outline: none;
}
.color-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--w-fg);
  border: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.color-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--w-fg);
  border: 0;
}

.color-alt {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.color-alt-btn {
  appearance: none;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  padding: 9px 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.28s var(--ease), color 0.28s var(--ease),
    border-color 0.28s var(--ease), opacity 0.28s var(--ease);
}
@media (hover: hover) {
  .color-alt-btn:hover { background: var(--w-fg); color: var(--w-bg); border-color: var(--w-fg); opacity: 1; }
}
.color-alt-btn[hidden] { display: none; }

/* 结果出来前先铺一层纯色，再让照片从中"溶解"出来 */
/* 背景照片闪一下提取到的颜色。
   放在 .world-bg 之后、.world-inner(z-index:1) 之前，
   所以只染背景照片，不会盖住文字和按钮。 */
.color-flash {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--flash, #b8b5ae);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.color-flash.on { animation: flash-pulse 0.9s ease-out both; }
@keyframes flash-pulse {
  0%   { opacity: 0; }
  14%  { opacity: 0.2; }
  46%  { opacity: 0.13; }
  100% { opacity: 0; }
}

.color-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 从照片拾色 */
.color-picker {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 26px);
  padding: 0 6%;
  animation: color-in 0.4s var(--ease) both;
  z-index: 3;
}
.color-picker[hidden] { display: none; }
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.6vw, 14px);
  width: min(100%, 520px);
}
.color-pick-item {
  appearance: none;
  padding: 0;
  border: 1px solid var(--w-line);
  border-radius: 2px;
  background: var(--lb-img-bg);
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease);
}
.color-pick-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) {
  .color-pick-item:hover { border-color: var(--w-fg); transform: translateY(-2px); }
}

/* 色轮 */
.color-wheel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100% - 12px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(16px, 3vw, 24px);
  background: var(--w-bg);
  border: 1px solid var(--w-line);
  border-radius: 2px;
  z-index: 4;
  animation: color-in 0.35s var(--ease) both;
}
.color-wheel[hidden] { display: none; }
.color-wheel-canvas {
  width: min(58vw, 220px);
  height: min(58vw, 220px);
  border-radius: 50%;
  cursor: crosshair;
  touch-action: none;
}
.color-v { width: min(58vw, 220px); }

.color-result {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  /* 底部留出圆圈条的高度，文字和按钮永远压在圆圈上方 */
  padding: 8px 8% calc(var(--dial-strip, 96px) + 12px);
  pointer-events: none;
  animation: color-in 0.55s var(--ease) 0.12s both;
}
.color-result[hidden] { display: none; }
.color-result .game-btn { pointer-events: auto; }
.color-result > * { flex: none; }
@keyframes color-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* 尺寸由 fitColorImage() 按剩余空间算，这里只兜底 */
.color-img {
  flex: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: var(--lb-img-bg);
}

.color-caption {
  margin: 0;
  font-size: clamp(15px, 2vw, 20px);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
}

.color-rgb {
  margin: 0;
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.5;
}

/* --------------------------------------------------------------- 响应式 */

@media (max-width: 640px) {
  .enter { padding: 18px 26px 18px 31px; letter-spacing: 0.26em; }
  .hud { padding: 12px var(--pad) 24px; }
  .lb-stage { padding: 0 12px; }
  .lb-top-right { gap: 8px; }
  .lb-brain { font-size: 10px; letter-spacing: 0.14em; text-indent: 0.14em; }
  .lb-divider { height: 11px; }
  .lb-nav { width: 36px; height: 36px; font-size: 19px; }
  .lb-bar { padding: 12px 16px 18px; gap: 10px; }
  .lb-exif { font-size: 10px; gap: 4px 12px; }
  .foot-author { margin-left: 0; }

  .world-inner { gap: 30px; }
  .world-orbit .world-btn { padding: 11px 15px; letter-spacing: 0.1em; font-size: 10.5px; }
  .world-back { padding: 9px 13px 9px 11px; }

  .cats-grid { gap: 16px 10px; }
  .cover { width: 140px; }
  .catview-bar { gap: 10px; padding: 10px var(--pad); }

  /* 手机屏窄，背景会顶到文字后面，压得更暗一些 */
  .world-bg { filter: brightness(0.52) contrast(1.04); background-position: 50% 34%; }
}

/* 寻彩：窄屏把间距收一点，排法由 JS 按屏幕算（一行四张 或 2×2） */
@media (max-width: 760px) {
  #game-play { padding-top: clamp(6px, 2.5vh, 22px); gap: clamp(14px, 3.5vh, 34px); }
  .game-cards { gap: 10px; }
}

/* 屏幕矮的机器（手机横屏、iPhone SE）再收一档，尽量不用滚动 */
@media (max-height: 560px) {
  #game-play { padding-top: 8px; gap: 10px; }
  .game-word { font-size: clamp(22px, 3.4vw, 34px); }
  .game-hint { display: none; }
  /* 专属色彩：矮屏把色值那行收掉，给照片和圆圈让位 */
  .color-rgb { display: none; }
  .color-caption { font-size: 14px; letter-spacing: 0.18em; }
}

@media (prefers-reduced-motion: reduce) {
  .field { animation: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
