:root {
  --ink: #26171f;
  --mag: #ff0080;
  --vio: #ff00ff;
  --txt: #f6eaf1;
  --dim: #cba9bd;
  --line: rgba(255, 255, 255, 0.12);
  --mono: "Share Tech Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r: 4px;
}

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

html {
  background: #140b11;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--txt);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
}

body::before {
  content: "";
  position: fixed;
  inset: -12% -12% -12% -12%;
  z-index: -2;
  background:
    radial-gradient(42% 34% at 12% 10%, rgba(255, 0, 128, 0.6), transparent 68%),
    radial-gradient(38% 30% at 88% 6%, rgba(255, 0, 255, 0.44), transparent 70%),
    radial-gradient(46% 40% at 74% 84%, rgba(255, 0, 128, 0.3), transparent 72%),
    radial-gradient(40% 36% at 16% 82%, rgba(122, 43, 255, 0.34), transparent 70%),
    linear-gradient(160deg, #26171f, #190f16 55%, #2a1420);
  animation: aurora 26s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: screen;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

@keyframes aurora {
  0% {
    transform: scale(1) rotate(0deg);
    filter: hue-rotate(0deg) saturate(1);
  }
  100% {
    transform: scale(1.12) rotate(2deg);
    filter: hue-rotate(26deg) saturate(1.15);
  }
}

a {
  color: #ff9ad0;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--vio);
  outline-offset: 2px;
}

menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 顶栏 ---------- */
.mast {
  position: relative;
  z-index: 30;
  background: rgba(20, 11, 17, 0.74);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.mast-in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.drawer {
  position: relative;
  justify-self: start;
}

.drawer summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
  list-style: none;
  color: var(--txt);
  font-family: var(--mono);
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.drawer summary::-webkit-details-marker {
  display: none;
}

.bars {
  width: 16px;
  height: 12px;
  background:
    linear-gradient(var(--mag), var(--mag)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--vio), var(--vio)) 0 5px / 100% 2px no-repeat,
    linear-gradient(var(--mag), var(--mag)) 0 10px / 100% 2px no-repeat;
}

.drawer-list {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  min-width: 190px;
  padding: 6px;
  background: #2b1822;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 26px 48px -22px rgba(0, 0, 0, 0.85);
}

.drawer-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 3px;
  color: var(--txt);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
}

.drawer-list a:hover {
  background: rgba(255, 0, 128, 0.18);
}

.mark {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 6px;
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.14em;
}

.prism {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: conic-gradient(from 20deg, var(--mag), var(--vio), #7a2bff, var(--mag));
  box-shadow: 0 0 14px rgba(255, 0, 200, 0.75);
}

.ping {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: #ffb3da;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
  border: 1px solid rgba(255, 0, 255, 0.45);
  border-radius: var(--r);
}

.ping:hover {
  color: #fff;
  background: rgba(255, 0, 255, 0.16);
}

/* ---------- 粘性锚点条 ---------- */
.railnav {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(23, 12, 18, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.railmenu {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.railmenu::-webkit-scrollbar {
  display: none;
}

.railmenu a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 11px;
  white-space: nowrap;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
  border-bottom: 2px solid transparent;
}

.railmenu a:hover {
  color: #fff;
  border-bottom-color: var(--mag);
}

/* ---------- 主区 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 14px 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.doc {
  order: -1;
  min-width: 0;
}

.rail {
  min-width: 0;
}

.rail h2 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: #fff;
}

.subtitle {
  margin: 2px 0 14px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--mag);
}

.idx {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.idx li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.idx a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
}

.idx a b {
  color: var(--vio);
  font-weight: 400;
}

.idx a:hover {
  color: #fff;
  background: rgba(255, 0, 255, 0.12);
}

/* ---------- 纸张 ---------- */
.paper {
  overflow: hidden;
  background: rgba(34, 20, 28, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r);
  box-shadow:
    0 30px 64px -38px rgba(255, 0, 128, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(26px, 6vw, 52px) clamp(18px, 5vw, 44px);
  background: linear-gradient(140deg, rgba(255, 0, 128, 0.18), rgba(255, 0, 255, 0.1) 55%, transparent);
}

.hero::after {
  content: "";
  position: absolute;
  right: -22px;
  top: 22%;
  width: 128px;
  height: 128px;
  border-radius: var(--r);
  opacity: 0.5;
  filter: blur(0.5px);
  transform: rotate(16deg) translateY(calc(var(--sy, 0) * 0.05px));
  background: conic-gradient(from 30deg, #ff0080, #ff00ff, #7a2bff, #ff0080);
  pointer-events: none;
}

.badge {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin: 0;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 0, 200, 0.5);
  background: rgba(255, 0, 128, 0.16);
  color: #ffd0e8;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.16em;
  box-shadow: 0 8px 20px -12px var(--mag);
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 20ch;
  color: #fff;
  font-size: clamp(28px, 6.4vw, 44px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-shadow: 0 0 28px rgba(255, 0, 128, 0.4);
}

.paper > article {
  padding: clamp(22px, 4.6vw, 38px) clamp(18px, 5vw, 44px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 64px;
}

.paper h2 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(20px, 3.4vw, 27px);
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #fff;
}

.paper h2::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--mag), var(--vio));
}

.paper h3 {
  margin: 26px 0 10px;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.5;
  color: #ffd8ea;
}

.paper p {
  margin: 0 0 1.05em;
  color: #f0dbe6;
}

.paper ul,
.paper ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.paper li {
  margin: 0 0 0.45em;
}

.paper strong {
  color: #fff;
}

.paper blockquote {
  margin: 0 0 1.1em;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--mag);
  color: var(--dim);
}

.paper img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 16px 44px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.foot-cta {
  margin: 0;
}

.foot-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: 0.06em;
}

.foot-cta a::after {
  content: "↑";
  margin-left: 12px;
  color: var(--vio);
}

.foot-bar {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  font-family: var(--mono);
}

.foot-bar small {
  font-size: 16px;
}

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

.foot-bar a:hover {
  color: #fff;
}

/* ---------- 大屏 ---------- */
@media (min-width: 960px) {
  .wrap {
    grid-template-columns: 236px minmax(0, 1fr);
    padding-inline: 20px;
    gap: 30px;
  }

  .doc {
    order: 0;
  }

  .rail {
    position: sticky;
    top: 70px;
    align-self: start;
  }

  .railmenu {
    justify-content: center;
  }
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .paper > article {
    animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .paper > article:nth-of-type(1) { animation-delay: 0.04s; }
  .paper > article:nth-of-type(2) { animation-delay: 0.08s; }
  .paper > article:nth-of-type(3) { animation-delay: 0.12s; }
  .paper > article:nth-of-type(4) { animation-delay: 0.16s; }
  .paper > article:nth-of-type(5) { animation-delay: 0.2s; }
  .paper > article:nth-of-type(6) { animation-delay: 0.24s; }
  .paper > article:nth-of-type(7) { animation-delay: 0.28s; }
}

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

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

  body::before {
    animation: none;
  }
}

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