@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700&display=swap');

:root {
  --blue: #3bb1ff;
  --red: #ff5252;
  --ink: #000000;
  --paper: #fffdf6;
  --soft: #eef8ff;
  --sans: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --head: 'Syne', 'Manrope', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(0, 0, 0, .17) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* 顶部细条 */
.strip {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--ink);
  padding: 7px 18px;
  font-family: var(--head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* 页头 */
.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--head);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
}

.mark:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.mark:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.mark-img { width: 100%; height: 100%; object-fit: contain; border: 0; }

.nav { flex: 1 1 auto; }
.nav p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border: 3px solid transparent;
  border-radius: 0;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.nav a:hover {
  background: var(--blue);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

/* 主视觉 */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 40px 20px 96px;
  background-color: var(--blue);
  background-image: radial-gradient(rgba(0, 0, 0, .28) 2px, transparent 2px);
  background-size: 26px 26px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 72px), 0 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero-img {
  position: absolute;
  top: -6%;
  left: 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
  z-index: -2;
  will-change: transform;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, .3);
  display: none;
}

.hero.has-img .hero-veil { display: block; }

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.hero h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--head);
  font-size: clamp(2.35rem, 7.2vw, 5.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 7px 7px 0 var(--ink);
}

/* 正文骨架 */
main { display: block; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 20px 84px;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 30px;
  align-items: start;
}

.post { min-width: 0; }

.post div {
  position: relative;
  margin: 0 0 36px;
  padding: 26px 24px 30px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 7px 7px 0 var(--ink);
  scroll-margin-top: 132px;
}

.post > div:nth-child(odd) { border-top: 9px solid var(--blue); }
.post > div:nth-child(even) { border-top: 9px solid var(--red); }

.post h2 {
  margin: 0 0 16px;
  font-family: var(--head);
  font-size: clamp(1.55rem, 3.3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.01em;
}

.post h2 > span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 6px solid var(--red);
}

.post h3 {
  margin: 26px 0 12px;
  font-family: var(--head);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 700;
  line-height: 1.25;
}

.post h3 > span { border-bottom: 4px solid var(--blue); }

.post p { margin: 0 0 1.05em; }
.post p:last-child { margin-bottom: 0; }

.post a {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid var(--red);
  transition: background-color .14s ease;
}

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

.post ul,
.post ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.post li { margin: 0 0 .45em; }
.post li::marker { color: var(--red); font-weight: 700; }

.post blockquote {
  margin: 0 0 1.1em;
  padding: 16px 18px;
  background: var(--soft);
  border: 3px solid var(--ink);
  border-left: 10px solid var(--blue);
  border-radius: 0 14px 14px 0;
}

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

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

.post th,
.post td {
  border: 3px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

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

.post img {
  max-width: 100%;
  height: auto;
  border: 3px solid var(--ink);
  border-radius: 14px;
}

.post strong { background: var(--blue); padding: 0 .16em; }

.post hr {
  border: 0;
  border-top: 3px dashed var(--ink);
  margin: 26px 0;
}

/* 侧栏 */
.rail {
  position: sticky;
  top: 96px;
  padding: 18px 16px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

.rail h2 {
  margin: 0 0 12px;
  font-family: var(--head);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: .06em;
}

.rail h2 > span {
  display: inline-block;
  padding: 3px 10px;
  background: var(--red);
  color: #fff;
  border: 3px solid var(--ink);
}

.rail-list { display: flex; flex-direction: column; }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 6px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px dashed rgba(0, 0, 0, .35);
  transition: background-color .14s ease, padding-left .14s ease;
}

.rail-list a:last-child { border-bottom: 0; }

.rail-list a:hover,
.rail-list a.is-on {
  background: var(--blue);
  padding-left: 12px;
}

.rail-stamp {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 3px solid var(--ink);
  font-family: var(--head);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: .04em;
}

/* 页脚 */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 20px 20px;
  background: var(--ink);
  color: var(--paper);
  border-top: 9px solid var(--blue);
}

.f-brand a {
  font-family: var(--head);
  font-size: clamp(1.9rem, 5.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--paper);
  text-decoration: none;
  transition: color .14s ease;
}

.f-brand a:hover { color: var(--blue); }

.f-nav p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}

.f-nav a:hover { background: var(--red); border-color: var(--paper); color: #fff; }

.f-copy {
  font-size: 14px;
  font-weight: 600;
  opacity: .9;
}

/* 回到顶部 */
.totop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  min-height: 46px;
  padding: 10px 15px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.totop.on { opacity: 1; transform: translateY(0); pointer-events: auto; }
.totop:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

@media (max-width: 980px) {
  .board { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .rail { position: static; }
  .rail-list { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .rail-list a { border-bottom: 0; padding: 6px 10px; min-height: 42px; }
  .rail-list a:hover,
  .rail-list a.is-on { padding-left: 10px; }
}

@media (max-width: 760px) {
  .strip { font-size: 12px; letter-spacing: .22em; padding: 6px 14px; }
  .mast { position: static; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .nav { flex: 1 0 100%; }
  .nav p { justify-content: flex-start; }
  .nav a { padding: 7px 9px; font-size: 14px; }
  .hero { min-height: 62vh; padding: 26px 14px 78px; }
  .hero h1 { text-shadow: 4px 4px 0 var(--ink); }
  .wrap { padding: 34px 14px 60px; }
  .post div { padding: 20px 16px 24px; box-shadow: 5px 5px 0 var(--ink); }
  .post div { scroll-margin-top: 24px; }
  .foot { padding: 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition: none !important; animation: none !important; }
  .hero-img { transform: none !important; }
}

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