*,
::after,
::before {
  box-sizing: border-box;
}
body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, PingFangSC-Regular, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #111111;
  background-color: var(--color0);
  font-weight: 300;
}
img {
  vertical-align: bottom;
}
ul {
  list-style-type: none;
}
a {
  color: #111111;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
:root {
  --color0: #DEDEDE;
  --color-black: #111111;
  --color-white: #FBFBFB;
  --color1: #1E5EFF;
  --color2: #0CFD00;
  --color3: #FFED25;
  --color-secondary-text: #898989;
  --color5-secondary-green: #E1FCDF;
  --color6-secondary-blue: #80D0FF;
  --color7-selecting-blue: #5485FF;
}
/* 首页暂时不覆盖导航样式 */
.hero {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--color0);
}
.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}
#physicsCanvas {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 3;
  pointer-events: none;
}
.figure {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  width: min(54vw, 784px);
  max-width: 784px;
  min-width: 320px;
  height: auto;
  z-index: 2;
  pointer-events: none;
}
/* ===============================
   Responsive - index
================================= */
@media (max-width: 1200px) {
  .hero {
    height: min(100vh, 680px);
    min-height: 520px;
  }
  .figure {
    width: min(60vw, 680px);
  }
}
@media (max-width: 992px) {
  .hero {
    height: min(100vh, 620px);
    min-height: 480px;
  }
  .figure {
    width: min(68vw, 560px);
    bottom: 24px;
  }
}
@media (max-width: 768px) {
  .hero {
    height: calc(100svh - 64px);
    min-height: 480px;
  }
  .figure {
    width: min(82vw, 460px);
    min-width: 260px;
    bottom: 18px;
  }
}

/* ── Homepage dice: repositioned + ripple ── */
body.home .navDiceBtn {
  position: fixed;
  top: 100px;
  left: 40px;
  z-index: 9996;
  overflow: visible;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              top  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* panel open: slide dice to horizontal center of panel (350px wide, btn 30px) */
body.home .navDiceBtn.isPanelOpen {
  left: 160px; /* (350 - 30) / 2 */
}
body.home .navDiceBtn::before,
body.home .navDiceBtn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}
body.home .navDiceBtn::before {
  border: 1.5px solid var(--color3);
  animation: diceRipple 2.4s ease-out 0s infinite;
}
body.home .navDiceBtn::after {
  border: 1.5px solid var(--color1);
  animation: diceRipple 2.4s ease-out 0.8s infinite;
}
@keyframes diceRipple {
  0%   { width: 30px;  height: 30px;  opacity: 0.85; }
  100% { width: 54px;  height: 54px;  opacity: 0; }
}
body.home .navDiceBtn canvas {
  animation: diceRippleGreen 2.4s ease-out 1.6s infinite;
}
@keyframes diceRippleGreen {
  0%   { box-shadow: 0 0 0 1px rgba(12, 253, 0, 0.8); }
  100% { box-shadow: 0 0 0 8px rgba(12, 253, 0, 0); }
}
/* stop ripple when panel is open */
body.home .navDiceBtn.isPanelOpen::before,
body.home .navDiceBtn.isPanelOpen::after {
  animation: none;
  opacity: 0;
}
body.home .navDiceBtn.isPanelOpen canvas {
  animation: none;
  box-shadow: none;
}
@media (max-width: 768px) {
  body.home .navDiceBtn {
    top: 84px;
    left: 20px;
  }
  body.home .navDiceBtn.isPanelOpen {
    left: calc(50vw - 15px);
  }
}
