:root {
  --red: #ff0000;
  --vio: #8b00ff;
  --ink: #261717;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.15);
  --line-2: rgba(255, 255, 255, 0.28);
  --txt: #f4eaea;
  --dim: rgba(255, 255, 255, 0.58);
  --r: 10px;
}

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

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

body {
  margin: 0;
  min-height: 100%;
  font-family: 'Share Tech Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo,
    Consolas, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--txt);
  background: #150c0c;
  overflow-x: hidden;
}

/* ---------- 背景光层 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(760px 600px at 12% 8%, rgba(255, 0, 0, 0.3), transparent 64%),
    radial-gradient(700px 560px at 88% 18%, rgba(139, 0, 255, 0.34), transparent 62%),
    radial-gradient(900px 720px at 50% 108%, rgba(139, 0, 255, 0.22), transparent 66%),
    linear-gradient(180deg, #1e1111 0%, #140b0b 55%, #1b0e12 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(62px);
  opacity: 0.55;
}

.o1 {
  width: 340px;
  height: 340px;
  left: -90px;
  top: 18%;
  background: radial-gradient(circle, var(--red), transparent 70%);
}

.o2 {
  width: 420px;
  height: 420px;
  right: -120px;
  top: 6%;
  background: radial-gradient(circle, var(--vio), transparent 70%);
}

.o3 {
  width: 300px;
  height: 300px;
  left: 42%;
  bottom: -90px;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.7), transparent 70%);
}

/* ---------- 骨架 ---------- */
.main {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 32px);
}

.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(48px, 11vh, 96px) 0 clamp(26px, 5vh, 44px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 7.4vw, 4.4rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-shadow: 0 0 18px rgba(255, 0, 0, 0.45), 0 0 46px rgba(139, 0, 255, 0.4);
}

.hero::after {
  content: "";
  width: min(240px, 60%);
  height: 2px;
  margin-top: clamp(16px, 4vh, 30px);
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--red), var(--vio), transparent);
  box-shadow: 0 0 16px rgba(255, 0, 0, 0.6);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
  padding-bottom: 20px;
}

/* ---------- 正文 ---------- */
.prose > article {
  position: relative;
  margin: 0 0 clamp(14px, 2.4vw, 22px);
  padding: clamp(20px, 3.2vw, 34px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  scroll-margin-top: 28px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.prose > article:last-child {
  margin-bottom: 0;
}

.prose > article:hover {
  border-color: rgba(255, 0, 0, 0.42);
  box-shadow: 0 22px 50px -26px rgba(255, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.prose h2,
.prose h3 {
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  letter-spacing: 0.01em;
}

.prose h2 {
  font-size: clamp(1.22rem, 3.3vw, 1.7rem);
  margin: 0 0 0.7em;
}

.prose h3 {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  margin: 1.1em 0 0.5em;
}

.prose h2 > span,
.prose h3 > span {
  color: inherit;
}

.prose h2 > span {
  display: inline-block;
  padding-left: 12px;
  border-left: 3px solid var(--red);
  box-shadow: -3px 0 0 -1px var(--vio);
}

.prose p {
  margin: 0 0 1em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.35em 0;
}

.prose a {
  color: #ff8080;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 128, 128, 0.45);
}

.prose a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.prose strong {
  color: #fff;
}

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

.prose blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 2px solid var(--vio);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(139, 0, 255, 0.1);
}

.prose pre,
.prose code {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 0.94em;
}

.prose pre {
  overflow-x: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.45);
}

.prose table {
  width: 100%;
  margin: 0 0 1em;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.rail-h {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.rail-h > span {
  color: #fff;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: #eedede;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.rail-list a:hover {
  border-left-color: var(--red);
  background: rgba(255, 0, 0, 0.16);
  color: #fff;
}

.rail-back {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.rail-back a {
  color: var(--dim);
  text-decoration: none;
}

.rail-back a:hover {
  color: #fff;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: clamp(40px, 8vw, 80px) auto 0;
  padding: 34px clamp(14px, 4vw, 32px) 132px;
  border-top: 1px solid var(--line);
}

.foot-mark {
  margin: 0 0 26px;
  font-size: clamp(1.9rem, 9vw, 4.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.02em;
  background: linear-gradient(92deg, #ff2b2b, #8b00ff 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 26px rgba(139, 0, 255, 0.25);
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}

.foot-nav dl {
  margin: 0;
}

.foot-nav dt {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 0;
  color: #e3d6d6;
  font-size: 0.94rem;
  text-decoration: none;
}

.foot-nav a:hover {
  color: #ff8a8a;
}

.foot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--dim);
}

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

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

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(12px, 3vw, 24px) calc(8px + env(safe-area-inset-bottom));
  background: rgba(22, 12, 13, 0.72);
  border-top: 1px solid var(--line-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.5);
}

.hamb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hamb:hover {
  border-color: rgba(255, 0, 0, 0.6);
  background: rgba(255, 0, 0, 0.22);
}

.hamb-bars {
  position: relative;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.hamb-bars::before,
.hamb-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.hamb-bars::before {
  top: -6px;
}

.hamb-bars::after {
  top: 6px;
}

.dock-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: #fff;
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-decoration: none;
  text-shadow: 0 0 14px rgba(255, 0, 0, 0.55);
}

.dock-q {
  width: clamp(92px, 26vw, 210px);
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, background 0.2s;
}

.dock-q::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.dock-q:focus {
  border-color: var(--red);
  background: rgba(255, 0, 0, 0.14);
}

/* ---------- 全屏遮罩菜单 ---------- */
.navswitch {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 112px;
  background: rgba(16, 8, 9, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.navswitch:checked ~ .sheet {
  opacity: 1;
  visibility: visible;
}

.sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.92rem;
  cursor: pointer;
}

.sheet-close:hover {
  background: rgba(139, 0, 255, 0.3);
}

.sheet-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 26px;
  width: min(760px, 100%);
}

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

.sheet-nav ul.col-l {
  text-align: right;
}

.sheet-nav a {
  display: block;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.06);
  color: #f4e9e9;
  font-size: 1.02rem;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.sheet-nav a:hover {
  border-color: rgba(255, 0, 0, 0.55);
  background: rgba(255, 0, 0, 0.2);
  transform: translateX(3px);
}

.sheet-nav ul.col-l a:hover {
  transform: translateX(-3px);
}

.sheet-nav li.is-off {
  display: none;
}

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

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

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

  .orb {
    animation: drift 16s ease-in-out infinite alternate;
  }

  .o2 {
    animation-duration: 21s;
    animation-delay: -3s;
  }

  .o3 {
    animation-duration: 26s;
    animation-delay: -7s;
  }

  @keyframes drift {
    from {
      transform: translate3d(0, 0, 0);
    }
    to {
      transform: translate3d(0, -46px, 0);
    }
  }
}

/* ---------- 断点 ---------- */
@media (max-width: 880px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .hero {
    min-height: 42vh;
  }

  .foot-nav {
    gap: 12px;
  }
}

@media (max-width: 560px) {
  .sheet-nav {
    grid-template-columns: 1fr;
  }

  .sheet-nav ul.col-l {
    text-align: left;
  }

  .sheet-nav ul.col-l a:hover {
    transform: translateX(3px);
  }
}

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