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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --graphite: #4a4a4a;
  --hair: rgba(26, 26, 26, 0.28);
  --wash: rgba(26, 26, 26, 0.06);
}

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

html {
  font-size: 17px;
  color: var(--ink);
  background-color: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Work Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.045) 0 1px, rgba(26, 26, 26, 0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(26, 26, 26, 0.028) 0 1px, rgba(26, 26, 26, 0) 1px 4px),
    repeating-linear-gradient(118deg, rgba(74, 74, 74, 0.045) 0 2px, rgba(74, 74, 74, 0) 2px 11px);
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', 'Work Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ---------- 页头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 34px);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.05) 0 1px, rgba(26, 26, 26, 0) 1px 3px);
  border-bottom: 3px solid var(--ink);
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-3deg);
  transition: transform 0.08s linear;
}

.mark:hover,
.mark:focus-visible {
  transform: rotate(3deg) scale(1.05);
}

.navbar {
  min-width: 0;
}

.navbar p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.navbar a {
  display: inline-block;
  min-height: 42px;
  padding: 11px 9px;
  color: var(--graphite);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.25;
  border-bottom: 3px solid transparent;
  transition: color 0.08s linear, background-color 0.08s linear, border-color 0.08s linear;
  animation: stamp 0.28s ease-out backwards;
}

.navbar a:hover,
.navbar a:focus-visible {
  color: var(--ink);
  background-color: var(--wash);
  border-bottom-color: var(--ink);
}

.navbar a.is-on {
  color: var(--paper);
  background-color: var(--ink);
  border-bottom-color: var(--ink);
}

.navbar a:nth-child(3),
.navbar a:nth-child(6) {
  padding-left: 13px;
  box-shadow: inset 1px 0 0 var(--hair);
}

.navbar a:nth-child(1) { animation-delay: 0s; }
.navbar a:nth-child(2) { animation-delay: 0.04s; }
.navbar a:nth-child(3) { animation-delay: 0.08s; }
.navbar a:nth-child(4) { animation-delay: 0.12s; }
.navbar a:nth-child(5) { animation-delay: 0.16s; }
.navbar a:nth-child(6) { animation-delay: 0.2s; }
.navbar a:nth-child(7) { animation-delay: 0.24s; }

@keyframes stamp {
  from {
    opacity: 0;
    transform: translateY(-7px) rotate(-1.6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

.entry {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  transform: rotate(1.6deg);
  transition: transform 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.entry:hover,
.entry:focus-visible {
  background-color: var(--ink);
  color: var(--paper);
  transform: rotate(-1.6deg);
}

/* ---------- 主体骨架 ---------- */

main {
  display: block;
}

main > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  column-gap: clamp(26px, 4vw, 58px);
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 36px) clamp(40px, 7vw, 84px);
}

div > * {
  grid-column: 1;
  min-width: 0;
}

/* ---------- 首屏 ---------- */

.hero {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(26px, 6vw, 62px) 0 clamp(26px, 6vw, 56px);
  text-align: center;
}

.hero-copy {
  max-width: 21em;
}

.hero h1 {
  display: inline-block;
  margin: 0 0 0.42em;
  padding-bottom: 0.1em;
  border-bottom: 4px solid var(--ink);
  font-size: clamp(2.1rem, 7.4vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  transform: rotate(-1.2deg);
}

.hero-sub {
  margin: 0;
  color: var(--graphite);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-plate {
  width: min(760px, 100%);
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-bottom-width: 6px;
  background-image: repeating-linear-gradient(135deg, rgba(74, 74, 74, 0.09) 0 8px, rgba(74, 74, 74, 0) 8px 17px);
  transform: rotate(0.7deg);
}

.hero-plate img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 正文区 ---------- */

.sheet > section:not(.hero) {
  padding: clamp(30px, 5vw, 56px) 0;
  border-bottom: 2px solid var(--ink);
  scroll-margin-top: 116px;
}

.sheet h2 {
  display: inline-block;
  margin: 0 0 0.28em;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  line-height: 1.22;
  transform: rotate(-0.6deg);
}

.sheet hr {
  width: 100%;
  margin: 0 0 1.1em;
  border: 0;
  border-top: 3px solid var(--ink);
}

.sheet h3 {
  margin: 1.5em 0 0.35em;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  line-height: 1.3;
}

.sheet p {
  max-width: 38em;
  margin: 0 0 1.05em;
}

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

.sheet a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background-color 0.08s linear, color 0.08s linear;
}

.sheet a:hover,
.sheet a:focus-visible {
  background-color: var(--ink);
  color: var(--paper);
  text-decoration-color: transparent;
}

.sheet ul,
.sheet ol {
  max-width: 38em;
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.sheet li {
  margin-bottom: 0.45em;
}

.sheet li::marker {
  color: var(--graphite);
}

.sheet blockquote {
  max-width: 36em;
  margin: 0 0 1.1em;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--ink);
  color: var(--graphite);
  font-style: normal;
}

.sheet img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
}

.sheet figure {
  margin: 0 0 1.2em;
}

.sheet figcaption {
  font-size: 0.94rem;
  color: var(--graphite);
  padding-top: 0.4em;
}

.sheet table {
  width: 100%;
  max-width: 38em;
  border-collapse: collapse;
  margin-bottom: 1.2em;
  font-size: 0.98rem;
}

.sheet th,
.sheet td {
  border-bottom: 1px solid var(--hair);
  padding: 9px 10px;
  text-align: left;
}

.sheet th {
  border-bottom: 2px solid var(--ink);
  font-family: 'Outfit', sans-serif;
}

/* ---------- 侧栏 ---------- */

.sideline {
  grid-column: 2;
  grid-row: 2 / span 40;
  position: sticky;
  top: 106px;
  align-self: start;
  margin-top: clamp(30px, 5vw, 56px);
  padding: 16px 16px 20px;
  border: 2px solid var(--ink);
  border-bottom-width: 6px;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, rgba(26, 26, 26, 0.05) 0 1px, rgba(26, 26, 26, 0) 1px 3px);
  transform: rotate(0.6deg);
  font-size: 0.95rem;
}

.sideline h2 {
  margin: 0 0 0.34em;
  font-size: 1.02rem;
  letter-spacing: 0.1em;
  transform: rotate(-0.8deg);
}

.sideline hr {
  margin: 0 0 0.7em;
  border: 0;
  border-top: 2px solid var(--ink);
}

.sideline-list a {
  display: block;
  min-height: 42px;
  padding: 10px 4px;
  color: var(--graphite);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
  border-bottom: 1px dashed var(--hair);
  transition: color 0.08s linear, background-color 0.08s linear, padding-left 0.08s linear;
  animation: slip 0.3s ease-out backwards;
}

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

.sideline-list a:hover,
.sideline-list a:focus-visible,
.sideline-list a.is-on {
  color: var(--ink);
  background-color: var(--wash);
  padding-left: 11px;
}

.sideline-list a:nth-child(1) { animation-delay: 0.05s; }
.sideline-list a:nth-child(2) { animation-delay: 0.09s; }
.sideline-list a:nth-child(3) { animation-delay: 0.13s; }
.sideline-list a:nth-child(4) { animation-delay: 0.17s; }
.sideline-list a:nth-child(5) { animation-delay: 0.21s; }
.sideline-list a:nth-child(6) { animation-delay: 0.25s; }
.sideline-list a:nth-child(7) { animation-delay: 0.29s; }

@keyframes slip {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- 页脚 ---------- */

footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto;
  align-items: start;
  gap: clamp(12px, 3vw, 40px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 36px) clamp(30px, 5vw, 52px);
  border-top: 4px solid var(--ink);
  font-size: 0.95rem;
}

footer p {
  margin: 0;
}

.foot-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.35;
  transform: rotate(-0.8deg);
}

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

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.08s linear, border-color 0.08s linear;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

footer small {
  align-self: end;
  color: var(--graphite);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 920px) {
  main > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .sideline {
    grid-column: 1;
    grid-row: auto;
    position: static;
    transform: none;
    margin-top: 0;
    margin-bottom: clamp(28px, 5vw, 44px);
  }

  .sheet > section:not(.hero) {
    scroll-margin-top: 150px;
  }

  footer {
    grid-template-columns: minmax(0, 1fr);
  }

  footer small {
    align-self: start;
  }
}

@media (max-width: 620px) {
  .masthead {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 4px;
  }

  .navbar {
    grid-column: 1 / -1;
    order: 3;
  }

  .entry {
    justify-self: end;
    padding: 9px 13px;
    transform: none;
  }

  .hero {
    min-height: 88svh;
  }

  .hero h1 {
    font-size: clamp(1.95rem, 8.6vw, 2.7rem);
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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