@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&display=swap');

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #ffffff;
  --tint: #e8f6ff;
  --line: 3px solid #000000;
  --shadow: 5px 5px 0 #000000;
  --soft: 4px 4px 0 #000000;
  --r: 10px;
}

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

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

body {
  margin: 0;
  padding-bottom: 92px;
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

body.sheet-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: grid;
  place-items: center;
  padding: 40px 18px 46px;
  background: var(--blue);
  border-bottom: var(--line);
}

.hero__ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3rem, 17vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 3px #000000;
  white-space: nowrap;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
}

.hero__title {
  position: relative;
  z-index: 1;
  margin: 0;
  text-align: center;
  max-width: 20ch;
  font-size: clamp(1.9rem, 7.4vw, 3.5rem);
  font-weight: 700;
  text-shadow: 4px 4px 0 #ffffff;
}

/* ---------- 主体网格 ---------- */
.main {
  display: block;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 44px;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.stage {
  min-width: 0;
}

main section[id] {
  scroll-margin-top: 30px;
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 22px;
  padding: 18px 16px 20px;
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.rail__title {
  font-size: 1.05rem;
  margin: 0 0 8px;
  word-break: break-all;
}

.subtitle {
  display: inline-block;
  margin: 0 0 14px;
  padding: 1px 9px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 6px;
}

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

.rail__list a {
  display: block;
  padding: 10px 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: background 0.16s linear, border-color 0.16s linear, box-shadow 0.16s linear;
}

.rail__list a:hover,
.rail__list a:focus-visible {
  background: var(--tint);
  border-color: var(--ink);
}

.rail__list a.is-hot {
  background: var(--blue);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- 正文 ---------- */
.prose {
  min-width: 0;
  max-width: 70ch;
  font-size: 17px;
}

.prose > section + section {
  margin-top: 46px;
  padding-top: 38px;
  border-top: var(--line);
}

.prose h2 {
  display: inline-block;
  padding: 9px 16px;
  margin: 0 0 20px;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  background: var(--blue);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--soft);
}

.prose h3 {
  margin-top: 1.6em;
  padding-left: 14px;
  font-size: 1.18rem;
  border-left: 8px solid var(--red);
}

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

.prose li {
  margin-bottom: 0.5em;
}

.prose li::marker {
  color: var(--red);
  font-weight: 700;
}

.prose blockquote {
  margin: 0 0 1.3em;
  padding: 14px 18px;
  background: var(--tint);
  border: var(--line);
  border-left-width: 9px;
  border-radius: 0 var(--r) var(--r) 0;
  box-shadow: var(--soft);
}

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

.prose strong {
  background: linear-gradient(to top, var(--blue) 0 38%, transparent 38%);
  padding: 0 2px;
}

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

.prose img {
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin: 0 0 1.2em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3em;
  font-size: 0.96rem;
}

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

.prose th {
  background: var(--blue);
}

.prose hr {
  border: none;
  border-top: var(--line);
  margin: 2em 0;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 30px;
  padding: 34px 20px 30px;
  background: var(--ink);
  color: #ffffff;
  border-top: var(--line);
}

.foot__cols {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.foot dt {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--blue);
}

.foot dd {
  margin: 0;
}

.foot dd a {
  display: inline-block;
  padding: 10px 0;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot dd a:hover,
.foot dd a:focus-visible {
  border-bottom-color: var(--red);
}

.foot__bar {
  max-width: 1120px;
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 3px solid #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.foot__copy {
  margin: 0;
  font-size: 0.92rem;
}

.foot__top {
  display: inline-block;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  color: #ffffff;
  background: var(--red);
  border: 3px solid #ffffff;
  border-radius: var(--r);
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--paper);
  border-top: var(--line);
}

.dock__btn {
  justify-self: start;
  min-height: 46px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--blue);
  border: var(--line);
  border-radius: var(--r);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.dock__btn--search {
  justify-self: end;
  background: var(--red);
}

.dock__btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.dock__brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  color: #ffffff;
  background: var(--ink);
  border: var(--line);
  border-radius: var(--r);
}

.brandmark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 2px solid #ffffff;
}

/* ---------- 全屏菜单 ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 34px;
  background: var(--blue);
  overflow-y: auto;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s ease;
}

.sheet.is-open {
  transform: none;
  visibility: visible;
}

.sheet__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.sheet__brand {
  justify-self: center;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: #ffffff;
  background: var(--ink);
  border: var(--line);
  border-radius: var(--r);
}

.sheet__close {
  grid-column: 3;
  justify-self: end;
  min-height: 46px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: #ffffff;
  border: var(--line);
  border-radius: var(--r);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.sheet__search {
  display: block;
}

.sheet__search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
  border: var(--line);
  border-radius: var(--r);
  box-shadow: var(--soft);
}

.sheet__nav {
  margin-top: 4px;
}

.sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  gap: 10px 14px;
}

.sheet__item.is-miss {
  display: none;
}

.sheet__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: #ffffff;
  border: var(--line);
  border-radius: var(--r);
  box-shadow: 3px 3px 0 var(--ink);
}

.sheet__link:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.sheet__num {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 1px 6px;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 5px;
}

/* ---------- 动效 ---------- */
.js [data-reveal] {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.js [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(16px);
}

/* ---------- 断点 ---------- */
@media (max-width: 860px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 22px 16px 36px;
  }

  .rail {
    order: 2;
    position: static;
  }

  .stage {
    order: 1;
  }

  .rail__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot__cols {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .hero {
    min-height: 45vh;
    padding: 32px 16px 38px;
  }
}

@media (max-width: 560px) {
  .sheet__list {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr);
  }

  .foot__cols {
    grid-template-columns: 1fr;
  }

  .prose h2 {
    font-size: 1.28rem;
    padding: 8px 12px;
  }
}

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

  .sheet {
    transition-duration: 0.001ms;
  }

  .js [data-reveal]:not(.is-in) {
    opacity: 1;
    transform: none;
  }
}

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