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

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000;
  --paper: #fffdf6;
  --line: 3px solid #000;
  --shadow: 5px 5px 0 #000;
  --dock-h: 74px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-bottom: calc(var(--dock-h) + 26px);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Roboto', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  font-weight: 400;
}

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

/* ---------- 版心与区块 ---------- */

.main > article {
  width: 100%;
  max-width: 940px;
  margin-inline: auto;
  padding: clamp(30px, 6vw, 62px) clamp(16px, 5vw, 40px);
  border-bottom: var(--line);
  scroll-margin-top: 20px;
  scroll-margin-bottom: calc(var(--dock-h) + 22px);
}

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

.hero {
  max-width: none !important;
  margin: 0 !important;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
  text-align: right;
  padding: clamp(30px, 7vw, 76px) clamp(16px, 5vw, 52px);
  border-bottom: var(--line);
  background-color: var(--paper);
  background-image: radial-gradient(#00000026 1.5px, transparent 1.6px);
  background-size: 22px 22px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.25rem, 10vw, 5.4rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.025em;
  text-shadow: 4px 4px 0 var(--blue);
  overflow-wrap: break-word;
}

.lead {
  margin: 0;
  max-width: 34ch;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  background: #fff;
  border: var(--line);
  box-shadow: var(--shadow);
  padding: 13px 16px;
}

.hero-figure { margin: 0; max-width: min(100%, 420px); }

.hero-img {
  width: 100%;
  border: var(--line);
  box-shadow: 6px 6px 0 #000;
  object-fit: cover;
}

.sticker {
  display: inline-block;
  background: var(--blue);
  border: var(--line);
  box-shadow: 6px 6px 0 #000;
  padding: 10px 20px;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: .02em;
  transform: rotate(-2deg);
}

/* ---------- 标题与副标题 ---------- */

.main h2 {
  display: inline-block;
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 5vw, 2.35rem);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -.01em;
  background: var(--blue);
  border: var(--line);
  box-shadow: var(--shadow);
  padding: .12em .38em;
}

.subtitle {
  display: inline-block;
  margin: 16px 0 0;
  padding: 3px 12px;
  background: var(--red);
  border: var(--line);
  box-shadow: 4px 4px 0 #000;
  font-weight: 700;
  letter-spacing: .05em;
  font-size: .95rem;
}

/* ---------- 目录区 ---------- */

.board {
  max-width: 1120px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: clamp(20px, 4vw, 42px);
  align-items: start;
}

.board-main { min-width: 0; }
.board-links { margin: 0; }

.index-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.index-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 11px 14px;
  background: #fff;
  border: var(--line);
  box-shadow: 4px 4px 0 #000;
  text-decoration: none;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.index-list a:hover,
.index-list a:focus-visible {
  background: var(--blue);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #000;
}

.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  font-size: .88rem;
  letter-spacing: .04em;
}

.idx-name { min-width: 0; }

/* ---------- 右侧 aside ---------- */

.board-aside {
  align-self: start;
  background: #fff;
  border: var(--line);
  box-shadow: 6px 6px 0 var(--red);
  padding: 16px;
  min-width: 0;
}

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

.aside-list a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #000;
  background: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: .97rem;
  transition: background-color .12s ease, color .12s ease;
}

.aside-list a:hover,
.aside-list a:focus-visible { background: var(--red); color: #fff; }

/* ---------- 正文排版（page.content） ---------- */

.main h3 {
  margin: 30px 0 8px;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.3;
}

.main h4 { margin: 22px 0 6px; font-size: 1.05rem; font-weight: 900; }
.main p { margin: 14px 0; }
.main ul, .main ol { padding-left: 1.35em; }
.main li { margin: 7px 0; }

.main a {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

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

.main img {
  border: var(--line);
  box-shadow: var(--shadow);
  margin: 22px 0;
}

.main blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  background: #fff;
  border: var(--line);
  border-left-width: 11px;
  border-left-color: var(--red);
  box-shadow: var(--shadow);
  font-weight: 500;
}

.main blockquote p:first-child { margin-top: 0; }
.main blockquote p:last-child { margin-bottom: 0; }

.main table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  border: 2px solid #000;
}

.main th, .main td {
  border: 2px solid #000;
  padding: 9px 12px;
  text-align: left;
}

.main th { background: var(--blue); font-weight: 900; }
.main code { font-size: .95em; background: #fff; border: 2px solid #000; padding: 1px 5px; }

/* ---------- 底部固定条（footer） ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--dock-h);
  padding: 10px max(12px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  background: #fff;
  border-top: var(--line);
}

.dock-left { flex: none; position: relative; }

.dock-menu { position: relative; }

.dock-menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  background: var(--blue);
  border: var(--line);
  box-shadow: 4px 4px 0 #000;
  font-weight: 900;
  font-size: .98rem;
  letter-spacing: .06em;
  cursor: pointer;
  user-select: none;
}

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

.dock-menu[open] > summary {
  background: var(--red);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.dock-menu menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  margin: 0;
  padding: 8px;
  list-style: none;
  width: min(78vw, 300px);
  max-height: min(62vh, 430px);
  overflow: auto;
  background: #fff;
  border: var(--line);
  box-shadow: 8px 8px 0 #000;
}

.dock-menu menu li + li { margin-top: 8px; }

.dock-menu menu a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #000;
  background: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: .97rem;
}

.dock-menu menu a:hover,
.dock-menu menu a:focus-visible { background: var(--blue); }

.dock-mid {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dock-brand {
  max-width: 40vw;
  padding: 6px 12px;
  border: var(--line);
  background: #fff;
  box-shadow: 4px 4px 0 #000;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .02em;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.dock-right {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-right a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 8px;
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

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

/* ---------- 进入动效 ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.is-in { animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }

.index-list li:nth-child(2n).is-in { animation-delay: .06s; }
.index-list li:nth-child(3n).is-in { animation-delay: .12s; }
.aside-list li:nth-child(2n).is-in { animation-delay: .08s; }

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

@media (max-width: 820px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-aside { box-shadow: 5px 5px 0 #000; }
  .hero { min-height: 62vh; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .index-list { grid-template-columns: minmax(0, 1fr); }
  .dock-right a:nth-child(2) { display: none; }
  .hero-figure { max-width: 100%; }
}

@media (max-width: 420px) {
  :root { --dock-h: 68px; }
  .copy { display: none; }
  .dock-brand { font-size: .9rem; max-width: 46vw; padding: 6px 8px; }
  .dock-menu > summary { padding: 10px 13px; letter-spacing: .02em; }
  .hero-title { text-shadow: 3px 3px 0 var(--blue); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-in { animation: none; }
  .index-list a, .aside-list a { transition: none; }
}

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