* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding-bottom: 84px;
  background: #F4F1EA;
  color: #111111;
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 17px;
  line-height: 1.72;
  font-weight: 400;
}

img {
  max-width: 100%;
}

.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
}

/* 左侧目录栏 */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow: auto;
  padding: 26px 18px 40px;
  border-right: 2px solid #111111;
  background: #F4F1EA;
}

.rail-t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.rail-t::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  background: #FF4D5E;
}

.subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #FF4D5E;
}

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

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-left: 3px solid rgba(17, 17, 17, 0.14);
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.36);
  color: #111111;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: #111111;
  color: #F4F1EA;
  border-left-color: #FF4D5E;
  outline: none;
}

.wrap {
  min-width: 0;
}

/* 首屏 */
.hero-sec {
  border-bottom: 2px solid #111111;
  background-color: #F4F1EA;
  background-image: radial-gradient(rgba(17, 17, 17, 0.34) 1.1px, transparent 1.1px);
  background-size: 20px 20px;
  background-position: 0 0;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  gap: 22px;
  padding: 88px 42px 104px;
}

h1 {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(1.9rem, 5.6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.hero-lead {
  margin: 0;
  max-width: 38ch;
  font-size: 17px;
}

.hero-art {
  width: 100%;
  max-width: 540px;
  border: 2px solid #111111;
  border-radius: 4px;
  overflow: hidden;
  background: #FFFFFF;
  will-change: transform;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* 正文 */
.body-sec {
  padding: 44px 42px 90px;
}

.prose {
  max-width: 770px;
}

.prose div {
  position: relative;
  margin: 0 0 20px;
  padding: 26px 24px;
  border: 2px solid #111111;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  scroll-margin-top: 86px;
}

.prose h2 {
  margin: 0 0 0.5em;
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.prose h3 {
  margin: 1.4em 0 0.5em;
  font-size: 1.1rem;
  font-weight: 700;
}

.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.28em 0;
}

.prose a {
  color: #FF4D5E;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.prose strong,
.prose b {
  font-weight: 700;
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 6px solid #FF4D5E;
  background: #FFFFFF;
}

/* 页脚 */
.foot {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: 40px 42px 52px;
  border-top: 2px solid #111111;
  background: #111111;
  color: #F4F1EA;
}

.foot .cta {
  margin: 0;
  width: 100%;
}

.foot .cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 18px 24px;
  border: 2px solid #FF4D5E;
  border-radius: 4px;
  background: #FF4D5E;
  color: #111111;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  letter-spacing: 0.05em;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.foot .cta a:hover {
  background: #F4F1EA;
  border-color: #F4F1EA;
  color: #111111;
}

.foot small {
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(244, 241, 234, 0.66);
}

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: #111111;
  border-top: 2px solid #111111;
}

.dock .brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 2px;
  color: #F4F1EA;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
}

.menu-toggle {
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid #F4F1EA;
  border-radius: 4px;
  background: #FF4D5E;
  color: #111111;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.menu-toggle:hover {
  background: #F4F1EA;
}

/* 全屏菜单 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px 40px;
  background: #111111;
  color: #F4F1EA;
  overflow: auto;
}

.overlay.open {
  display: flex;
}

.menu-close {
  align-self: flex-end;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid #F4F1EA;
  border-radius: 4px;
  background: #FF4D5E;
  color: #111111;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

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

.overlay li {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.overlay.open li {
  opacity: 1;
  transform: none;
}

.overlay.open li:nth-child(1) { transition-delay: 0.04s; }
.overlay.open li:nth-child(2) { transition-delay: 0.08s; }
.overlay.open li:nth-child(3) { transition-delay: 0.12s; }
.overlay.open li:nth-child(4) { transition-delay: 0.16s; }
.overlay.open li:nth-child(5) { transition-delay: 0.2s; }
.overlay.open li:nth-child(6) { transition-delay: 0.24s; }
.overlay.open li:nth-child(7) { transition-delay: 0.28s; }

.overlay-nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.2);
  color: #F4F1EA;
  text-decoration: none;
  font-size: clamp(1.25rem, 4.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 0.16s ease, padding-left 0.16s ease;
}

.overlay-nav a:hover,
.overlay-nav a:focus-visible {
  color: #FF4D5E;
  padding-left: 10px;
  outline: none;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 2px solid #111111;
    padding: 22px 20px 24px;
  }

  .rail-nav ul {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .hero {
    min-height: 100vh;
    padding: 72px 20px 96px;
  }

  .body-sec {
    padding: 28px 16px 70px;
  }

  .prose div {
    padding: 20px 16px;
    scroll-margin-top: 20px;
  }

  .foot {
    padding: 28px 16px 44px;
  }
}

@media (max-width: 420px) {
  .rail-nav ul {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(1.7rem, 8.4vw, 2.6rem);
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

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