@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700&family=Comic+Neue:wght@300;400;700&display=swap');

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #fffdf6;
  --cream: #fdf1dc;
  --muted: #3a3a3a;
  --line: 3px solid #000;
  --font: 'Baloo 2', 'Comic Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --hard: 6px 6px 0 #000;
  --radius: 18px;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 500;
  overflow-x: clip;
}

a {
  color: inherit;
}

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

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

/* ---------- 顶部两行 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--blue);
  border-bottom: 4px solid var(--ink);
  padding-bottom: 10px;
}

.brandline {
  display: flex;
  align-items: center;
  padding: 10px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 16px;
  background: #fff;
  border: var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .5px;
  transform: rotate(-1.4deg);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.brand:hover {
  transform: rotate(0deg) translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--red);
  background: var(--paper);
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  object-fit: cover;
}

.menuline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.menuline a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 15px;
  background: #fff;
  border: var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
}

.menuline a:hover {
  background: var(--red);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.menuline a.is-active {
  background: var(--ink);
  color: #fff;
}

/* ---------- 栅格骨架 ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
}

main {
  display: block;
}

/* ---------- 首屏 ---------- */
.hero {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 45vh;
  padding: 30px 22px 22px;
  background: var(--blue);
  border: 4px solid var(--ink);
  border-radius: 26px;
  box-shadow: 8px 8px 0 var(--ink);
  text-align: right;
  overflow: hidden;
}

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 3px 13px;
  background: var(--red);
  color: #fff;
  border: var(--line);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 15px;
  font-weight: 700;
  transform: rotate(-6deg);
  will-change: transform;
}

.hero h1 {
  margin: 0;
  font-size: clamp(31px, 6vw, 54px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 #fff;
}

.hero-lede {
  margin: 16px 0 0 auto;
  max-width: 46ch;
  padding: 10px 15px;
  background: #fff;
  border: var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 16px;
  line-height: 1.6;
  text-align: right;
}

.hero-art {
  margin: 0;
  will-change: transform;
}

.hero-art img {
  display: block;
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
}

/* ---------- 正文卡片流 ---------- */
.body-shell {
  min-width: 0;
}

.prose > div {
  padding: 20px 20px 10px;
  margin: 0 0 22px;
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 138px;
  transition: transform .16s ease, box-shadow .16s ease;
}

.prose > div:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.prose > div:last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin: 4px 0 10px;
  padding-left: 12px;
  border-left: 10px solid var(--red);
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.22;
  font-weight: 700;
}

.prose h3 {
  margin: 20px 0 8px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  text-decoration: underline 4px var(--blue);
  text-underline-offset: 5px;
}

.prose p {
  margin: 0 0 14px;
}

.prose .subtitle,
.prose .subhead,
.prose .desc,
.prose .lead {
  margin: -4px 0 14px;
  font-size: 16px;
  color: var(--muted);
}

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

.prose li {
  margin-bottom: 7px;
}

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

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

.prose a:hover {
  background: var(--blue);
  text-decoration-color: var(--ink);
}

.prose img {
  margin: 10px 0 16px;
  border: var(--line);
  border-radius: 14px;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  background: var(--cream);
  border: var(--line);
  border-left: 10px solid var(--blue);
  border-radius: 12px;
}

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

.prose table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 16px;
}

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

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

.prose code {
  padding: 1px 6px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-size: 15px;
}

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 132px;
  padding: 18px;
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--hard);
}

.rail h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
}

.rail .subtitle {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--muted);
}

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

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

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

/* ---------- 页脚 ---------- */
.site-footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr .9fr;
  gap: 24px;
  padding: 32px max(16px, calc((100% - 1120px) / 2)) 14px;
  background: var(--ink);
  color: #fff;
  border-top: 6px solid var(--blue);
}

.site-footer div {
  min-width: 0;
}

.f-brand {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--blue);
}

.f-note {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #e6e6e6;
}

.site-footer nav dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.site-footer nav dt {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue);
}

.site-footer nav dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.site-footer nav a:hover {
  background: var(--red);
  border-color: #000;
  color: #fff;
}

.signup {
  display: grid;
  gap: 10px;
  max-width: 320px;
}

.signup label {
  font-weight: 700;
  color: var(--blue);
}

.signup input {
  min-height: 46px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  border: 3px solid #fff;
  border-radius: 12px;
  font: inherit;
}

.signup button {
  min-height: 46px;
  background: var(--red);
  color: #fff;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 4px 4px 0 var(--blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}

.signup button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blue);
}

.copyright {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid #555;
  font-size: 15px;
  color: #cfcfcf;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
}

.totop:hover {
  background: var(--blue);
  color: var(--ink);
  border-color: #000;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 16px 14px 44px;
  }

  .rail {
    position: static;
  }

  .hero {
    min-height: 0;
    padding: 34px 16px 18px;
    border-radius: 20px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .hero h1 {
    font-size: clamp(28px, 8.4vw, 40px);
  }

  .prose > div {
    padding: 16px 14px 6px;
    scroll-margin-top: 150px;
  }

  .site-footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 26px 16px 12px;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 16px;
  }

  .brand {
    font-size: 20px;
  }

  .menuline a {
    min-height: 40px;
    padding: 5px 12px;
    font-size: 15px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

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