:root {
  --ink: #0d0d0d;
  --ink2: #141019;
  --ink3: #1c1526;
  --p: #8000ff;
  --m: #ff00ff;
  --txt: #efe6fb;
  --dim: #b5a4ce;
  --r: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Nunito", "DM Sans", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.72;
  color: var(--txt);
  background-color: var(--ink);
  background-image:
    radial-gradient(880px 520px at 10% -10%, rgba(128, 0, 255, 0.32), transparent 60%),
    radial-gradient(720px 460px at 96% 2%, rgba(255, 0, 255, 0.18), transparent 58%);
  background-repeat: no-repeat;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  opacity: 0.55;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #ff9bf5;
}

a:hover {
  color: #fff;
}

main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- hero ---------- */
.hero {
  min-height: 70vh;
  display: grid;
  gap: 26px;
  align-content: center;
  padding: 52px 0 44px;
}

.hero-txt {
  min-width: 0;
}

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(128, 0, 255, 0.24);
  color: #f3c7ff;
  box-shadow: 0 0 24px rgba(255, 0, 255, 0.28);
  animation: bob 5s ease-in-out infinite alternate;
}

h1 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fdf8ff;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.5), 0 0 46px rgba(128, 0, 255, 0.6);
  animation: glitch 7s steps(1, end) infinite;
}

.hero-fig {
  margin: 0;
  background-image: linear-gradient(155deg, #1a1128, #26123a);
  border-radius: calc(var(--r) + 4px);
  padding: 20px;
  display: grid;
  place-items: center;
  min-height: 168px;
  animation: bob 6s ease-in-out infinite alternate;
}

.hero-svg {
  width: 100%;
  max-width: 208px;
  height: auto;
}

.hero-svg .spin {
  transform-origin: 100px 100px;
  animation: spin 18s linear infinite;
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: var(--r);
}

/* ---------- stage ---------- */
.stage {
  display: grid;
  gap: 26px;
  padding: 0 0 60px;
}

.stage-body > div {
  background: var(--ink2);
  border-radius: var(--r);
  padding: 24px 20px;
  margin: 0 0 16px;
  scroll-margin-top: 26px;
  animation: rise 0.6s both;
}

.stage-body > div:nth-child(2) { animation-delay: 0.05s; }
.stage-body > div:nth-child(3) { animation-delay: 0.1s; }
.stage-body > div:nth-child(4) { animation-delay: 0.15s; }
.stage-body > div:nth-child(5) { animation-delay: 0.2s; }
.stage-body > div:nth-child(6) { animation-delay: 0.25s; }
.stage-body > div:nth-child(7) { animation-delay: 0.3s; }

.stage-body > div > h2:first-child,
.stage-body > div > h3:first-child {
  margin-top: 0;
}

.stage-body h2 {
  font-size: clamp(1.3rem, 3.4vw, 1.7rem);
  line-height: 1.3;
  font-weight: 800;
  color: #ffb3ff;
  margin: 26px 0 8px;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.32);
}

.stage-body h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #e2c6ff;
  margin: 20px 0 6px;
}

.stage-body p {
  margin: 0 0 14px;
  color: #ded2ef;
}

.stage-body ul,
.stage-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
  color: #ded2ef;
}

.stage-body li {
  margin: 0 0 6px;
}

.stage-body blockquote {
  margin: 0 0 14px;
  padding: 12px 16px;
  background: rgba(128, 0, 255, 0.16);
  border-radius: var(--r);
  color: #f0dcff;
}

.stage-body blockquote p:last-child {
  margin-bottom: 0;
}

.stage-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 15px;
}

.stage-body th,
.stage-body td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(128, 0, 255, 0.28);
}

.stage-body th {
  color: #ffb3ff;
  font-weight: 700;
}

.stage-body a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

hr {
  border: 0;
  height: 1px;
  margin: 10px 0 22px;
  background-image: linear-gradient(90deg, rgba(255, 0, 255, 0.85), rgba(128, 0, 255, 0.5) 45%, transparent);
}

/* ---------- rail ---------- */
.rail {
  background: var(--ink2);
  border-radius: var(--r);
  padding: 18px 16px;
}

.rail h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ff9bf5;
}

.rail hr {
  margin: 10px 0 14px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r);
  background: var(--ink3);
  color: #e6d5ff;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.rail-list a:hover {
  background: rgba(128, 0, 255, 0.36);
  color: #fff;
  transform: translateX(3px);
}

/* ---------- footer ---------- */
footer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 12px 18px 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.foot-cta {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  border-radius: var(--r);
  background-image: linear-gradient(120deg, rgba(128, 0, 255, 0.55), rgba(255, 0, 255, 0.32));
}

.foot-cta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
}

.foot-cta a span {
  font-family: var(--mono);
}

.foot-col {
  margin: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}

.foot-col a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--dim);
  font-size: 15px;
  text-decoration: none;
}

.foot-col a:hover {
  color: #ff9bf5;
}

.foot-copy {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 13px;
  color: #8e7fa6;
  padding-top: 10px;
  border-top: 1px solid rgba(128, 0, 255, 0.25);
}

/* ---------- dock ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 0, 255, 0.3);
  box-shadow: 0 -10px 30px rgba(128, 0, 255, 0.22);
}

.dock-brand {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 0, 255, 0.14);
  color: #ff9bf5;
  text-decoration: none;
}

.dock-brand img,
.dock-brand svg {
  width: 24px;
  height: 24px;
  display: block;
}

.dock-menu {
  margin-left: auto;
  position: relative;
}

.dock-menu > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: rgba(128, 0, 255, 0.32);
  color: #ffe1ff;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.14em;
}

.dock-menu > summary::-webkit-details-marker {
  display: none;
}

.dock-menu > menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  gap: 6px;
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(242px, 78vw);
  background: #150f1f;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 0, 255, 0.22);
}

.dock-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: #e8d8ff;
  font-size: 15px;
  text-decoration: none;
}

.dock-menu a:hover {
  background: rgba(255, 0, 255, 0.2);
  color: #fff;
}

/* ---------- motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes glitch {
  0%, 90%, 100% { transform: none; }
  92% { transform: translate(2px, -1px) skewX(-2deg); }
  94% { transform: translate(-3px, 1px); }
  96% { transform: translate(1px, 1px) skewX(1deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bob {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

/* ---------- breakpoints ---------- */
@media (min-width: 640px) {
  .stage-body > div {
    padding: 28px 26px;
  }
}

@media (min-width: 900px) {
  main {
    padding: 0 26px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    gap: 44px;
  }

  .stage {
    grid-template-columns: minmax(0, 1fr) 272px;
    gap: 30px;
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 22px;
  }

  footer {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 16px 26px 52px;
  }

  .dock {
    padding: 12px 22px calc(12px + env(safe-area-inset-bottom));
  }

  .dock-menu {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    position: static;
  }

  .dock-menu > summary {
    display: none;
  }

  .dock-menu > menu {
    position: static;
    display: flex;
    gap: 4px;
    width: auto;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }

  .dock-menu a {
    padding: 0 11px;
    min-height: 44px;
    font-size: 14.5px;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
