:root {
  --ink: #000000;
  --blue: #3bb1ff;
  --coral: #ff5252;
  --sun: #ffdb58;
  --paper: #fffdf2;
  --line: 3px solid #000000;
  --hard: 5px 5px 0 #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Baloo 2', 'Comic Neue', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#00000014 1px, transparent 1px);
  background-size: 22px 22px;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.skip {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 120;
  background: var(--sun);
  border: var(--line);
  border-radius: 4px;
  padding: 8px 14px;
  font-weight: 700;
  text-decoration: none;
  transition: top .18s linear;
}

.skip:focus {
  top: 10px;
}

/* 顶栏 */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: var(--line);
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 14px;
}

.drawer {
  justify-self: start;
}

.drawer[data-side="right"] {
  justify-self: end;
}

.drawer > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: var(--line);
  border-radius: 4px;
  background: var(--coral);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  box-shadow: 3px 3px 0 var(--ink);
  user-select: none;
}

.drawer[data-side="right"] > summary {
  background: var(--blue);
}

.drawer > summary::-webkit-details-marker {
  display: none;
}

.bar-ico {
  width: 18px;
  height: 3px;
  background: var(--ink);
  box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}

.drawer[open] {
  z-index: 90;
}

.drawer[open] > summary {
  position: relative;
  z-index: 100;
  background: var(--sun);
  box-shadow: none;
  transform: translate(3px, 3px);
}

.drawer > menu {
  list-style: none;
}

.drawer[open] > menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 96px 22px 40px;
  background: var(--blue);
  overflow-y: auto;
}

.drawer[data-side="right"][open] > menu {
  background: var(--coral);
}

.drawer > menu a {
  display: block;
  min-height: 48px;
  padding: 10px 16px;
  background: #ffffff;
  border: var(--line);
  border-radius: 4px;
  box-shadow: var(--hard);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.drawer > menu a:hover {
  background: var(--sun);
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: var(--line);
  border-radius: 4px;
  background: var(--sun);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* 二级锚点条 */
.rail {
  display: flex;
  overflow-x: auto;
  background: var(--blue);
  border-bottom: var(--line);
  scrollbar-width: none;
}

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

.rail a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  border-right: 2px solid var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.rail a:hover,
.rail a.is-on {
  background: var(--sun);
}

.rail a.is-on {
  box-shadow: inset 0 -5px 0 var(--coral);
}

/* 版心 */
.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 14px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

@media (min-width: 1000px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 252px;
    align-items: start;
    padding-top: 32px;
  }
}

.sheet > section {
  background: #ffffff;
  border: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

/* 头图区 */
.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 122px);
  padding: 20px;
  background: var(--sun);
  border-bottom: var(--line);
}

.hero-txt {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  text-align: left;
}

.badge {
  align-self: flex-start;
  display: inline-block;
  padding: 4px 12px;
  border: var(--line);
  border-radius: 4px;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(32px, 7.4vw, 62px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero h1 > span {
  background: var(--blue);
  box-shadow: 7px 7px 0 var(--ink);
  padding: 0 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lede {
  max-width: 54ch;
  font-size: 18px;
  font-weight: 500;
  background: #fffdf2;
  border-left: 8px solid var(--coral);
  padding: 8px 12px;
}

.hero-art {
  position: relative;
  flex: 0 0 auto;
  height: 40vh;
  min-height: 190px;
  border: var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--coral);
}

.hero-art img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 114%;
  object-fit: cover;
  will-change: transform;
}

/* 正文排版 */
section > article {
  padding: 28px 20px 0;
  scroll-margin-top: 126px;
}

section > article + article {
  margin-top: 30px;
  border-top: 3px dashed var(--ink);
}

section > article:last-child {
  padding-bottom: 34px;
}

section p {
  margin: 12px 0;
}

section h2 {
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1.3;
  font-weight: 700;
  margin: 6px 0 8px;
}

section hr {
  border: 0;
  border-top: 3px solid var(--ink);
  margin: 0 0 16px;
}

section h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 22px 0 8px;
}

section ul,
section ol {
  margin: 12px 0 12px 24px;
}

section li {
  margin: 6px 0;
}

section a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--coral);
  text-underline-offset: 3px;
}

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

section strong {
  background: var(--sun);
  box-shadow: 0 0 0 2px var(--sun);
}

section blockquote {
  margin: 16px 0;
  padding: 10px 14px;
  border: var(--line);
  border-left-width: 10px;
  border-radius: 0 4px 4px 0;
  background: #f1faff;
}

section img {
  margin: 16px 0;
  border: var(--line);
  border-radius: 4px;
}

section figure {
  margin: 16px 0;
}

section figcaption {
  font-size: 16px;
  padding-top: 4px;
}

section table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 16px;
}

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

section th {
  background: var(--sun);
}

/* 侧栏 */
.side {
  border: var(--line);
  border-radius: 4px;
  background: #ffffff;
  padding: 14px;
}

@media (min-width: 1000px) {
  .side {
    position: sticky;
    top: 128px;
  }
}

.side h2 {
  font-size: 18px;
  font-weight: 700;
}

.side hr {
  border: 0;
  border-top: var(--line);
  margin: 8px 0 12px;
}

.side-list {
  list-style: none;
  counter-reset: sec;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-list li {
  counter-increment: sec;
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.side-list a::before {
  content: "0" counter(sec);
  font-size: 13px;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 0.04em;
}

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

/* 页脚 */
.foot {
  background: var(--ink);
  color: #ffffff;
  border-top: var(--line);
}

.foot-bar {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.foot-logo {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  border: 2px solid #ffffff;
  border-radius: 4px;
  padding: 6px 10px;
}

.foot-logo:hover {
  background: var(--coral);
  color: #000000;
  border-color: #000000;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 4px;
  color: #ffffff;
  font-size: 16px;
  text-decoration: none;
}

.foot nav a:hover {
  background: var(--blue);
  color: #000000;
}

.copy {
  font-size: 16px;
}

/* 动效 */
.rise {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .45s ease, transform .45s ease;
}

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

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

  .rise {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .skip {
    transition: none;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 17px;
    padding: 4px 8px;
  }

  .brand img {
    width: 22px;
    height: 22px;
  }

  .drawer > summary {
    padding: 0 10px;
    font-size: 15px;
  }

  .hero {
    padding: 16px;
    gap: 14px;
  }

  .hero-art {
    height: 34vh;
  }

  section > article {
    padding: 24px 16px 0;
  }
}

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