/* ==========================================================
   OpeningHero — 开场页（点阵手 + 可控蟑螂）
   全屏覆盖层，淡出后自毁，不影响下层页面结构
   ========================================================== */
.oh:focus { outline: none; }

.oh {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F9 62%, #F1F1F4 100%);
  cursor: crosshair;
  opacity: 0;
  animation: oh-in var(--d-slow, 360ms) var(--e-standard, cubic-bezier(0.2, 0.8, 0.2, 1)) forwards;
}
@keyframes oh-in { to { opacity: 1; } }

.oh[data-leaving] {
  animation: oh-out 520ms var(--e-emphasized, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
  pointer-events: none;
}
@keyframes oh-out {
  to { opacity: 0; transform: scale(1.03); filter: blur(2px); }
}

/* 点阵画布：铺满，不接收事件 */
.oh__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------------- 中央文案 ---------------- */
.oh__panel {
  position: relative;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 0 32px;
  margin-bottom: 20vh;          /* 上移，把画面中部留给两条手臂 */
  text-align: center;
  cursor: default;
}

.oh__eyebrow {
  font-family: var(--f-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--t-tertiary, #9699A3);
  opacity: 0;
  animation: oh-rise 620ms var(--e-emphasized) 120ms forwards;
}

.oh__title {
  font-family: var(--f-display, sans-serif);
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--t-primary, #17181D);
  opacity: 0;
  animation: oh-rise 720ms var(--e-emphasized) 200ms forwards;
}
.oh__title em {
  display: block;
  font-style: normal;
  font-family: var(--f-sans, sans-serif);
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--t-secondary, #646771);
  margin-top: 14px;
}

.oh__lede {
  max-width: 30ch;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--t-secondary, #646771);
  opacity: 0;
  animation: oh-rise 720ms var(--e-emphasized) 300ms forwards;
}

@keyframes oh-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- 进入按钮 ---------------- */
.oh__enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  margin-top: 26px;
  padding-inline: 26px;
  background: var(--n-900, #111217);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  animation: oh-rise 720ms var(--e-emphasized) 400ms forwards;
  transition: transform 180ms var(--e-standard), box-shadow 260ms var(--e-standard);
}
.oh__enter::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: 999px;
  background: conic-gradient(from 180deg, #D4864E, #B9632E, #E7AD83, #B9632E, #D4864E);
  opacity: 0;
  filter: blur(9px);
  transition: opacity 260ms var(--e-standard);
}
.oh__enter:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(17, 18, 23, 0.22); }
.oh__enter:hover::before { opacity: 0.85; }
.oh__enter:active { transform: translateY(0) scale(0.985); }
.oh__enter svg { transition: transform 260ms var(--e-emphasized); }
.oh__enter:hover svg { transform: translateX(3px); }

/* ---------------- 操作提示 ---------------- */
.oh__hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--t-tertiary, #9699A3);
  white-space: nowrap;
  opacity: 0;
  animation: oh-rise 720ms var(--e-emphasized) 560ms forwards;
}
.oh__keys { display: inline-flex; gap: 3px; }
.oh__key {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 4px;
  font-family: var(--f-mono, monospace);
  font-size: 10px;
  color: var(--t-secondary, #646771);
  background: #fff;
  border: 1px solid var(--b-default, #E2E3E8);
  border-bottom-width: 2px;
  border-radius: 5px;
}
.oh__key[data-on] {
  background: var(--n-900, #111217);
  border-color: var(--n-900, #111217);
  color: #fff;
  transform: translateY(1px);
  border-bottom-width: 1px;
}

/* 跳过 */
.oh__skip {
  position: absolute;
  top: 26px;
  right: 30px;
  z-index: 3;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--t-tertiary, #9699A3);
  border-radius: 999px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}
.oh__skip:hover { color: var(--t-primary, #17181D); background: rgba(17, 18, 23, 0.045); }

/* ---------------- 蟑螂 ---------------- */
.oh__roach {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;      /* 以中心为锚点 */
  pointer-events: none;
  will-change: transform;
}
.oh__roach-inner { display: block; width: 100%; height: 100%; }

/* 爬行时的轻微摆动，只在移动中挂载 */
.oh__roach[data-moving] .oh__roach-inner { animation: oh-crawl 300ms linear infinite; }
@keyframes oh-crawl {
  0%, 100% { transform: rotate(-3.5deg) translateY(0); }
  50%      { transform: rotate(3.5deg) translateY(-0.6px); }
}

/* 跟班蟑螂：比领头的小一圈、淡一点，爬行节奏各不相同 */
.oh__flock { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.oh__bug {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--bug, 22px);
  height: var(--bug, 22px);
  margin-top: calc(var(--bug, 22px) / -2);
  margin-left: calc(var(--bug, 22px) / -2);
  will-change: transform;
}
.oh__bug-inner { display: block; width: 100%; height: 100%; }
.oh__bug[data-moving] .oh__bug-inner { animation: oh-crawl var(--crawl, 300ms) linear infinite; }

/* 蟑螂脚下的一点点阴影，帮助它「贴」在画面上 */
.oh__shadow {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 34px;
  height: 9px;
  margin: -4px 0 0 -17px;
  background: radial-gradient(ellipse at center, rgba(17, 18, 23, 0.16), rgba(17, 18, 23, 0) 70%);
  pointer-events: none;
  will-change: transform;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .oh__panel { gap: 4px; }
  .oh__title em { letter-spacing: 0.22em; text-indent: 0.22em; margin-top: 10px; }
  .oh__lede { max-width: 24ch; font-size: 13px; }
  .oh__hint { bottom: 22px; font-size: 11px; }
  .oh__hint .oh__hint-kbd { display: none; }   /* 触屏没有方向键 */
  .oh__roach { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .oh__panel { margin-bottom: 26vh; }
}

/* ---------------- 动效降级 ---------------- */
@media (prefers-reduced-motion: reduce) {
  .oh, .oh__eyebrow, .oh__title, .oh__lede, .oh__enter, .oh__hint { animation: none; opacity: 1; }
  .oh[data-leaving] { animation: none; opacity: 0; transition: opacity 160ms linear; }
  .oh__roach[data-moving] .oh__roach-inner,
  .oh__bug[data-moving] .oh__bug-inner { animation: none; }
}
