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

*, *::before, *::after { box-sizing: border-box; }

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #f4f1ea;
  --white: #ffffff;
  --rail: 264px;
  --bar: 34px;
  --disp: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.75 var(--sans);
  overflow-x: hidden;
}

h1, h2, h3, h4 { text-wrap: balance; }

a { color: inherit; }

img { max-width: 100%; }

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

/* 顶部细条 */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--ink);
  color: var(--white);
  border-bottom: 3px solid var(--ink);
}

.topbar p {
  margin: 0;
  font: 800 13px/1 var(--sans);
  letter-spacing: .3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tick {
  width: 9px;
  height: 9px;
  background: var(--red);
  border: 2px solid var(--white);
  flex: 0 0 auto;
}

.shell { padding-top: var(--bar); }

/* 左侧固定栏 */
.rail {
  position: fixed;
  top: var(--bar);
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 18px 22px;
  background: var(--white);
  border-right: 4px solid var(--ink);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark,
.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--blue);
}

.brand-mark {
  display: grid;
  place-items: center;
  font: 700 24px/1 var(--disp);
}

.brand-logo { object-fit: cover; }

.brand-name {
  font: 800 18px/1.2 var(--sans);
  letter-spacing: .01em;
  word-break: break-all;
}

/* 侧栏导航 */
.side {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
  min-width: 0;
}

.side-title {
  margin: 0 0 8px;
  font: 800 14px/1 var(--sans);
  letter-spacing: .34em;
}

.side hr {
  margin: 0 0 14px;
  border: 0;
  border-top: 3px solid var(--ink);
}

.side-nav { min-width: 0; }

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  font: 700 16px/1.3 var(--sans);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.side-nav a::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  background: var(--blue);
  border: 3px solid var(--ink);
}

.side-nav li:nth-child(3n+2) a::before {
  background: var(--red);
  border-radius: 50%;
}

.side-nav li:nth-child(3n) a::before {
  background: var(--ink);
  transform: rotate(45deg);
}

.side-nav a:hover,
.side-nav a:focus-visible,
.side-nav a.is-on {
  background: var(--red);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.totop {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  font: 700 15px/1 var(--sans);
  text-decoration: none;
  color: var(--white);
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--red);
}

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

/* 主体 */
.main { margin-left: var(--rail); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px 64px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  min-height: 70vh;
  margin-top: 30px;
  padding: 46px 34px 62px;
  background: var(--blue);
  border: 4px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
  text-align: right;
}

.hero::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -14px;
  height: 26px;
  background: var(--red);
  border-top: 4px solid var(--ink);
  transform: skewY(-2.4deg);
}

.hero-copy {
  flex: 0 1 auto;
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font: 700 clamp(32px, 5.4vw, 68px)/1.06 var(--disp);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.lead {
  margin: 16px 0 0 0;
  max-width: 44ch;
  margin-left: auto;
  font: 400 16px/1.7 var(--sans);
  overflow-wrap: anywhere;
}

.sticker {
  position: relative;
  flex: 0 0 auto;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--ink);
  transform: translateY(0) rotate(-6deg);
  will-change: transform;
}

.sticker-char {
  font: 700 54px/1 var(--disp);
}

.sticker-dot {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 28px;
  height: 28px;
  background: var(--red);
  border: 4px solid var(--ink);
  border-radius: 50%;
}

/* 正文 */
.content { margin-top: 40px; }

.prose { display: block; }

.prose > div {
  margin: 0 0 44px;
  padding: 28px 26px 30px;
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  scroll-margin-top: 110px;
}

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

.prose h2 {
  margin: 0 0 12px;
  font: 700 clamp(23px, 3.2vw, 34px)/1.2 var(--disp);
  letter-spacing: -.01em;
}

.prose h3 {
  margin: 26px 0 10px;
  font: 800 20px/1.35 var(--sans);
}

.prose hr {
  margin: 0 0 18px;
  border: 0;
  border-top: 4px solid var(--ink);
}

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

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

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

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

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

.prose li { margin: 7px 0; }

.prose strong { font-weight: 800; }

.prose img {
  display: block;
  margin: 20px 0;
  height: auto;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.prose blockquote {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: var(--blue);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 var(--ink);
}

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

.prose code {
  font: 400 15px/1 var(--mono);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 2px 6px;
}

.prose pre {
  margin: 0 0 18px;
  padding: 16px;
  overflow-x: auto;
  background: var(--ink);
  color: var(--white);
  border: 4px solid var(--ink);
}

.prose pre code { background: none; border: 0; padding: 0; color: inherit; }

[data-nosnippet] { display: block; }

/* 页脚 */
.foot {
  margin-left: var(--rail);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 22px 28px;
  background: var(--ink);
  color: var(--white);
  border-top: 4px solid var(--ink);
}

.foot-brand a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font: 700 17px/1.2 var(--disp);
  color: var(--white);
  text-decoration: none;
  border-bottom: 3px solid var(--red);
  padding-bottom: 3px;
}

.foot-nav { min-width: 0; }

.foot-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font: 600 15px/1 var(--sans);
  color: var(--white);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot-nav a:hover { color: var(--blue); border-color: var(--blue); }

.foot-copy { font: 400 14px/1.5 var(--sans); color: #c9c9c9; }

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

  .rail {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
    overflow: visible;
  }

  .brand { order: 1; }

  .totop {
    order: 2;
    margin: 0 0 0 auto;
    min-height: 40px;
    box-shadow: 3px 3px 0 var(--red);
  }

  .side {
    order: 3;
    flex: 1 1 100%;
  }

  .side-title,
  .side hr { display: none; }

  .side-nav {
    margin: 0 -14px;
    padding: 4px 14px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .side-nav ul { flex-direction: row; gap: 8px; }

  .side-nav a { white-space: nowrap; }

  .main { margin-left: 0; }

  .wrap { padding: 0 14px 44px; }

  .hero {
    min-height: 0;
    margin-top: 18px;
    padding: 28px 16px 44px;
    gap: 16px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .sticker {
    width: 78px;
    height: 78px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .sticker-char { font-size: 36px; }

  .sticker-dot { width: 20px; height: 20px; border-width: 3px; top: -10px; right: -10px; }

  .lead { font-size: 15px; line-height: 1.65; }

  .content { margin-top: 26px; }

  .prose > div {
    margin-bottom: 28px;
    padding: 20px 16px 22px;
    box-shadow: 5px 5px 0 var(--ink);
    scroll-margin-top: 62px;
  }

  .foot {
    margin-left: 0;
    padding: 18px 14px;
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 30px; }
  .brand-name { font-size: 16px; }
}

@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}
