/* StaggeredMenu —— 错层菜单（移植自 React Bits，暗色适配） */

.staggered-menu-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 40;
  pointer-events: none;
}
.staggered-menu-wrapper.fixed-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  overflow: hidden;
}

.staggered-menu-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2em;
  background: transparent;
  pointer-events: none;
  z-index: 20;
}
.staggered-menu-header > * { pointer-events: auto; }

.sm-logo { display: flex; align-items: center; user-select: none; }
.sm-logo-img { display: block; height: 32px; width: auto; object-fit: contain; }
.sm-logo .logo-mark { width: 30px; height: 30px; border-radius: 6px; background: var(--grad, linear-gradient(135deg,#b06bff,#ff3d8f)); box-shadow: 0 0 14px rgba(176,107,255,0.5); position: relative; }
.sm-logo .logo-mark::after { content: ''; position: absolute; inset: 8px; border-radius: 3px; background: #0d0716; }

.sm-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #e9e9ef;
  font-weight: 500;
  line-height: 1;
  overflow: visible;
  font-family: inherit;
  font-size: 15px;
}
.sm-toggle:focus-visible { outline: 2px solid #ffffffaa; outline-offset: 4px; border-radius: 4px; }

.sm-toggle-textWrap {
  position: relative;
  display: inline-block;
  height: 1em;
  overflow: hidden;
  white-space: nowrap;
  width: var(--sm-toggle-width, auto);
  min-width: var(--sm-toggle-width, auto);
}
.sm-toggle-textInner { display: flex; flex-direction: column; line-height: 1; }
.sm-toggle-line { display: block; height: 1em; line-height: 1; }

.sm-icon { position: relative; width: 14px; height: 14px; flex: 0 0 14px; display: inline-flex; align-items: center; justify-content: center; will-change: transform; }
.sm-icon-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.staggered-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(260px, 38vw, 420px);
  height: 100%;
  background: #0d0716;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  padding: 6em 2em 2em 2em;
  overflow-y: auto;
  z-index: 10;
  pointer-events: auto;
  opacity: 0;
}
[data-position='left'] .staggered-menu-panel { right: auto; left: 0; }

.sm-prelayers {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(260px, 38vw, 420px);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}
[data-position='left'] .sm-prelayers { right: auto; left: 0; }

.sm-prelayer { position: absolute; top: 0; right: 0; height: 100%; width: 100%; opacity: 0; }

.sm-panel-inner { flex: 1; display: flex; flex-direction: column; gap: 1.25rem; }

.sm-socials { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.sm-socials-title { margin: 0; font-size: 1rem; font-weight: 500; color: var(--sm-accent, #ff3d8f); }
.sm-socials-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sm-socials-list .sm-socials-link { opacity: 1; }
.sm-socials-list:hover .sm-socials-link { opacity: 0.35; }
.sm-socials-list:hover .sm-socials-link:hover { opacity: 1; }
.sm-socials-link:focus-visible { outline: 2px solid var(--sm-accent, #ff3d8f); outline-offset: 3px; }
.sm-socials-list:focus-within .sm-socials-link { opacity: 0.35; }
.sm-socials-list:focus-within .sm-socials-link:focus-visible { opacity: 1; }
.sm-socials-link {
  font-size: 1.2rem;
  font-weight: 500;
  color: #c9bde8;
  text-decoration: none;
  position: relative;
  padding: 2px 0;
  display: inline-block;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.sm-socials-link:hover { color: var(--sm-accent, #ff3d8f); }

.sm-panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.sm-panel-item {
  position: relative;
  color: #f4f0ff;
  font-weight: 600;
  font-size: 3.5rem;
  cursor: pointer;
  line-height: 1;
  letter-spacing: -2px;
  transition: background 0.25s, color 0.25s;
  display: inline-block;
  text-decoration: none;
  padding-right: 1.4em;
}
.sm-panel-item:hover { color: var(--sm-accent, #ff3d8f); }
.sm-panel-itemLabel { display: inline-block; will-change: transform; transform-origin: 50% 100%; }

.sm-panel-list[data-numbering] { counter-reset: smItem; }
.sm-panel-list[data-numbering] .sm-panel-item::after {
  counter-increment: smItem;
  content: counter(smItem, decimal-leading-zero);
  position: absolute;
  top: 0.1em;
  right: 2.8em;
  font-size: 18px;
  font-weight: 400;
  color: var(--sm-accent, #ff3d8f);
  letter-spacing: 0;
  pointer-events: none;
  user-select: none;
  opacity: var(--sm-num-opacity, 0);
}

@media (max-width: 1024px) {
  .staggered-menu-panel { width: 100%; left: 0; right: 0; }
  .sm-prelayers { width: 100%; }
}
@media (max-width: 640px) {
  .staggered-menu-panel { width: 100%; left: 0; right: 0; }
  .staggered-menu-panel .sm-panel-item { font-size: 2.5rem; }
}
