@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #ffffff;
  --tint: #e6f5ff;
  --pink: #ffeded;
  --edge: 3px solid #000000;
  --pop: 6px 6px 0 #000000;
  --pop-sm: 4px 4px 0 #000000;
  --mono: 'JetBrains Mono', ui-monospace, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

/* ---------- 顶部 ---------- */

.top {
  background: var(--paper);
  border-bottom: 5px solid var(--ink);
}

.bar { padding: 12px 16px; }

.brandBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 21px;
  font-weight: 700;
  background: var(--blue);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop-sm);
}

.bname {
  padding-bottom: 3px;
  border-bottom: 4px solid var(--red);
}

.menuBar {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: var(--edge);
  padding-top: 12px;
  padding-bottom: 14px;
}

.menu {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  padding: 3px 4px 6px 0;
  scrollbar-width: none;
}

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

.menu ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  background: var(--paper);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.menu a:hover {
  background: var(--blue);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.menu a.hit,
.sideList a.hit {
  background: var(--red);
  color: var(--ink);
}

.find {
  display: flex;
  gap: 0;
  flex: 0 0 auto;
}

.find input {
  width: 130px;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: var(--edge);
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.find button {
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: var(--edge);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.find button:hover { background: var(--red); color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-bottom: 5px solid var(--ink);
}

.heroText {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  text-align: right;
}

.stamp {
  display: inline-block;
  padding: 4px 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--red);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop-sm);
  transform: rotate(-4deg);
}

.heroText h1 {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  background: var(--blue);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop);
}

.heroArt {
  align-self: flex-end;
  display: flex;
  align-items: center;
}

.heroPic {
  display: block;
  width: 100%;
  max-width: 340px;
  max-height: 40vh;
  object-fit: cover;
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop);
}

.cards {
  position: relative;
  width: 152px;
  height: 116px;
}

.cards span {
  position: absolute;
  width: 98px;
  height: 74px;
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop-sm);
}

.cards span:nth-child(1) { top: 0; left: 0; background: var(--blue); transform: rotate(-9deg); }
.cards span:nth-child(2) { top: 18px; left: 26px; background: var(--red); transform: rotate(5deg); }
.cards span:nth-child(3) { top: 34px; left: 8px; background: #fff; transform: rotate(-2deg); }

/* ---------- 主体布局 ---------- */

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 16px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

.side { order: -1; }

.prose { min-width: 0; }

.prose section {
  scroll-margin-top: 22px;
  margin: 0 0 30px;
  padding: 22px 18px 24px;
  background: var(--paper);
  border: var(--edge);
  border-radius: 4px;
  border-bottom-width: 8px;
  box-shadow: var(--pop);
}

.prose section:nth-child(2n) { background: var(--tint); }
.prose section:nth-child(3n) { background: var(--pink); }

.prose h2 {
  margin: 0 0 0.55em;
  padding-bottom: 0.35em;
  font-size: clamp(1.35rem, 4.2vw, 1.75rem);
  line-height: 1.3;
  border-bottom: 4px solid var(--ink);
}

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

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

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--blue);
  text-underline-offset: 3px;
}

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

.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }

.prose blockquote {
  margin: 0 0 1em;
  padding: 10px 16px;
  background: #fff;
  border: var(--edge);
  border-left-width: 9px;
  border-left-color: var(--red);
  box-shadow: var(--pop-sm);
}

.prose img {
  max-width: 100%;
  height: auto;
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop-sm);
}

.prose strong { background: var(--blue); padding: 0 4px; }

/* ---------- 侧栏 ---------- */

.side {
  padding: 16px 16px 20px;
  background: var(--paper);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: var(--pop);
  height: max-content;
}

.sideHead {
  display: inline-block;
  margin: 0;
  padding: 2px 12px;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--ink);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--red);
}

.subtitle {
  margin: 14px 0 16px;
  font-size: 1rem;
  line-height: 1.65;
  color: #1a1a1a;
}

.sideList {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: side;
}

.sideList a {
  display: block;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  background: var(--tint);
  border: var(--edge);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.sideList a:hover {
  background: var(--blue);
  transform: translate(-2px, -2px);
}

/* ---------- 页脚 ---------- */

.foot {
  margin-top: 20px;
  padding: 30px 16px 18px;
  color: #fff;
  background: var(--ink);
  border-top: 6px solid var(--blue);
}

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

.fcol h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.faddr {
  margin: 0;
  font-style: normal;
  display: grid;
  gap: 6px;
}

.faddr strong {
  font-size: 1.15rem;
  border-bottom: 4px solid var(--red);
  padding-bottom: 4px;
  width: max-content;
}

.faddr span { font-size: 0.95rem; }

.sub {
  display: flex;
}

.sub input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: var(--ink);
  border: 3px solid #fff;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.sub button {
  min-height: 44px;
  padding: 8px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--red);
  border: 3px solid #fff;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

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

.fcol li a {
  display: block;
  min-height: 44px;
  padding: 9px 12px;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  border: 3px solid #fff;
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--blue);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.fcol li a:hover {
  background: var(--blue);
  color: var(--ink);
  transform: translate(-2px, -2px);
}

.fbar {
  max-width: 1100px;
  margin: 26px auto 0;
  padding-top: 14px;
  border-top: 3px solid #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fbar small { font-size: 0.95rem; }

.up {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 4px;
  text-decoration: none;
}

.up:hover { background: var(--red); }

/* ---------- 滚动显现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */

@media (min-width: 820px) {
  .hero {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 44px;
    min-height: 45vh;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .heroArt { align-self: center; }

  .find input { width: 170px; }
}

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
    gap: 34px;
  }

  .prose { grid-column: 1; grid-row: 1; }

  .side {
    grid-column: 2;
    grid-row: 1;
    order: 0;
    position: sticky;
    top: 18px;
  }
}

@media (min-width: 760px) {
  .fgrid { grid-template-columns: 1.1fr 1.2fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .menu a:hover,
  .sideList a:hover,
  .fcol li a:hover { transform: none; }
}

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