@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #ffffff;
  --wash: #eef8ff;
  --edge: 3px solid #000000;
  --drop: 6px 6px 0 #000000;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding-bottom: 118px;
  font-family: "EB Garamond", "Crimson Text", "Songti SC", "SimSun", Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
}

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

a {
  color: var(--ink);
}

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

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 99;
  transform: translateY(-130%);
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 700;
}

.skip:focus {
  transform: none;
}

/* 骨架 */
.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 2.2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.8rem 1.2rem 0;
  align-items: start;
}

/* 左侧栏 */
.rail {
  position: sticky;
  top: 1.2rem;
  border: var(--edge);
  box-shadow: var(--drop);
  background: var(--paper);
  padding: 1rem;
}

.rail small {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--red);
  border: 2px solid #000;
  padding: 0.12em 0.45em;
}

.rail h2 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0.55rem 0 0.7rem;
  font-weight: 800;
}

.rail ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.rail li + li {
  border-top: 2px solid #000;
}

.rail li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.25rem;
  text-decoration: none;
  font-weight: 600;
}

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

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: var(--edge);
  background: var(--blue);
  box-shadow: 4px 4px 0 #000;
  font-weight: 700;
  text-decoration: none;
}

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

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 2.2rem;
  align-items: center;
  min-height: calc(100vh - 100px);
  padding: 2rem 0 3.4rem;
  border-bottom: var(--edge);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}

.badge {
  display: inline-block;
  border: var(--edge);
  background: var(--blue);
  box-shadow: 4px 4px 0 #000;
  padding: 0.3em 0.75em;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  animation: bob 3.6s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.5vw, 3.3rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
}

.hero-art {
  border: var(--edge);
  box-shadow: 10px 10px 0 var(--red);
  background: var(--blue);
  overflow: hidden;
  will-change: transform;
}

.hero-plate {
  aspect-ratio: 4 / 3;
  background: var(--blue);
}

.hero-logo {
  width: 100%;
  padding: 1.6rem;
  background: var(--paper);
}

/* 正文 */
section {
  padding-bottom: 2rem;
  max-width: 78ch;
}

section > article[id] {
  padding: 2.4rem 0;
  border-bottom: 2px solid #000;
}

section > article[id]:last-of-type {
  border-bottom: 0;
}

article[id] {
  scroll-margin-top: 2rem;
  scroll-margin-bottom: 130px;
}

section small {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--red);
  border: 2px solid #000;
  padding: 0.12em 0.45em;
  margin-bottom: 0.4rem;
}

section h2 {
  margin: 2.2rem 0 0.8rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  font-weight: 800;
}

section h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
}

section p {
  margin: 0 0 1.1rem;
  max-width: 68ch;
}

section ul,
section ol {
  padding-left: 1.4rem;
  max-width: 68ch;
}

section li {
  margin: 0.35rem 0;
}

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

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

section strong {
  font-weight: 700;
}

section blockquote {
  margin: 1.4rem 0;
  padding: 0.4rem 1rem;
  border-left: 6px solid #000;
  background: var(--wash);
}

section img {
  border: var(--edge);
  box-shadow: var(--drop);
  margin: 1.3rem 0;
}

section table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3rem 0;
}

section th,
section td {
  border: 2px solid #000;
  padding: 0.5rem 0.65rem;
  text-align: left;
}

section th {
  background: var(--blue);
  font-weight: 700;
}

section code,
section pre {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

section pre {
  border: var(--edge);
  padding: 0.8rem;
  overflow-x: auto;
}

/* 页脚 */
.site-foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-top: 4rem;
  padding: 3rem 1.4rem 1rem;
  border-top: 6px solid #000;
  background: var(--paper);
}

.foot-word p {
  margin: 0;
  font-size: clamp(2.1rem, 11vw, 4.3rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.foot-nav nav dl {
  margin: 0;
}

.foot-nav dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--red);
  border: 2px solid #000;
  padding: 0.12em 0.45em;
  display: inline-block;
  margin-bottom: 0.6rem;
}

.foot-nav dd {
  margin: 0 0 0.4rem;
}

.foot-nav dd a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.55rem;
  border: 2px solid #000;
  text-decoration: none;
  font-weight: 600;
}

.foot-nav dd a:hover {
  background: var(--blue);
}

.copy {
  grid-column: 1 / -1;
  margin: 1.6rem 0 0;
  padding-top: 0.9rem;
  border-top: 2px solid #000;
  font-size: 0.9rem;
}

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: var(--paper);
  border-top: var(--edge);
}

.brandmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.7rem;
  border: var(--edge);
  background: var(--blue);
  box-shadow: 4px 4px 0 #000;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.dock-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.dock-menu {
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border: var(--edge);
  background: var(--red);
  box-shadow: 4px 4px 0 #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dock-menu[aria-expanded="true"] {
  background: var(--blue);
  box-shadow: 1px 1px 0 #000;
}

.dock-search {
  position: relative;
  flex: 1 1 170px;
  min-width: 0;
}

.dock-search input {
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  border: var(--edge);
  font: inherit;
  font-size: 16px;
  background: var(--paper);
}

.sug {
  list-style: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  margin: 0;
  padding: 0;
  display: none;
  background: var(--paper);
  border: var(--edge);
  box-shadow: 5px 5px 0 #000;
  max-height: 44vh;
  overflow: auto;
}

.sug.show {
  display: block;
}

.sug li + li a {
  border-top: 2px solid #000;
}

.sug li a {
  display: block;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  text-decoration: none;
  font-weight: 600;
}

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

.dock-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  background: var(--paper);
  border-top: var(--edge);
  box-shadow: 0 -7px 0 rgba(0, 0, 0, 0.14);
  max-height: 60vh;
  overflow: auto;
}

.dock-panel.open {
  display: block;
}

.dock-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.2rem 1.2rem;
}

.gname {
  display: inline-block;
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--red);
  border: 2px solid #000;
  padding: 0.12em 0.45em;
}

.dock-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 2px solid #000;
  background: var(--paper);
  text-decoration: none;
  font-weight: 600;
}

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

/* 滚动显现 */
.js section > article,
.js .site-foot > article {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js section > article.in,
.js .site-foot > article.in {
  opacity: 1;
  transform: none;
}

.js .hero {
  opacity: 1;
  transform: none;
}

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

  .badge {
    animation: none;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 1.4rem;
    padding-top: 1rem;
  }

  .rail {
    position: static;
    padding: 0.8rem 0.9rem;
  }

  .rail ul {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-bottom: 0.7rem;
    padding-bottom: 0.3rem;
  }

  .rail li + li {
    border-top: 0;
  }

  .rail li a {
    border: 2px solid #000;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 1.5rem 0 2.4rem;
  }

  .site-foot {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    padding: 2rem 1.1rem 1rem;
  }

  .dock-nav {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 158px;
  }

  .dock-search {
    order: 3;
    flex: 1 1 100%;
  }
}

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