:root {
  --ink: #000000;
  --paper: #ffffff;
  --wash: #f3f3f3;
  --hair: #d8d8d8;
  --hair-soft: #e7e7e7;
  --maxw: 1240px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  overflow-x: hidden;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--ink);
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

p {
  overflow-wrap: break-word;
}

/* ---------- 顶部细条 ---------- */
.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  padding: 8px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.strip-brand {
  font-weight: 700;
}

.strip-note {
  font-weight: 400;
  opacity: 0.86;
}

/* ---------- 刊头 ---------- */
.masthead {
  padding: 26px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: inline-block;
  padding: 6px 10px;
  font-size: clamp(2.1rem, 6.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  background: var(--wash);
}

/* ---------- 粘性锚点条 ---------- */
.mastnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.nav-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 0 10px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-list li {
  flex: 0 0 auto;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

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

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  padding: 88px 22px 96px;
  text-align: center;
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

@supports (min-height: 100svh) {
  .hero {
    min-height: 100svh;
  }
}

.hero-badge {
  display: inline-block;
  padding: 7px 15px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: 1rem;
  letter-spacing: 0.14em;
  animation: drift 6s ease-in-out infinite;
}

.hero h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.4rem, 9vw, 5.4rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.hero-sub {
  margin: 0;
  max-width: 36ch;
  color: #2a2a2a;
  font-size: 1.05rem;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- 主栏 ---------- */
.page-main {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 0 52px;
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 52px 22px 80px;
}

/* ---------- 左侧栏 ---------- */
.rail {
  position: sticky;
  top: 78px;
  padding-right: 26px;
  border-right: 1px solid var(--ink);
}

.rail h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.rail hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 10px 0 16px;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rail;
  display: grid;
  gap: 2px;
}

.rail-list li {
  counter-increment: rail;
}

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 7px 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid var(--hair-soft);
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.rail-list a:hover {
  background: var(--wash);
}

/* ---------- 正文 ---------- */
.content {
  min-width: 0;
}

.content > article {
  padding-bottom: 46px;
  margin-bottom: 46px;
  border-bottom: 1px solid var(--hair);
  scroll-margin-top: 84px;
}

.content > article:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.content h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.45rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.032em;
}

.content h2 + hr {
  border: 0;
  border-top: 3px solid var(--ink);
  margin: 14px 0 28px;
}

.content h3 {
  margin: 38px 0 12px;
  font-size: 1.34rem;
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -0.018em;
}

.content p {
  max-width: 68ch;
  margin: 0 0 1.15em;
}

.content > article:first-child > p:first-of-type {
  max-width: 62ch;
}

.content > article:first-child > p:first-of-type::first-letter {
  float: left;
  padding: 8px 12px 0 0;
  font-size: 3.9rem;
  line-height: 0.84;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--hair);
  margin: 28px 0;
}

.content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content a:hover {
  background: var(--wash);
}

.content ul,
.content ol {
  max-width: 66ch;
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

.content li {
  margin: 0 0 0.5em;
}

.content li::marker {
  font-weight: 700;
}

.content blockquote {
  margin: 32px 0;
  padding: 18px 0 18px 26px;
  border-left: 4px solid var(--ink);
  font-size: 1.24rem;
  font-weight: 500;
  line-height: 1.52;
  letter-spacing: -0.01em;
}

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

.content figure {
  margin: 30px 0;
}

.content figcaption {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  font-size: 0.95rem;
  color: #3a3a3a;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 0.98rem;
}

.content th,
.content td {
  border-bottom: 1px solid var(--hair);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.content th {
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}

.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.94em;
  background: var(--wash);
  padding: 1px 5px;
  border-radius: 4px;
}

.content strong {
  font-weight: 700;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--ink);
  padding: 30px 22px 38px;
  text-align: center;
}

.site-footer p {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.site-footer small {
  display: inline-block;
  font-size: 0.95rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.site-footer a:hover {
  background: var(--wash);
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .content > article {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.62s ease, transform 0.62s ease;
  }

  .js .content > article.in {
    opacity: 1;
    transform: none;
  }

  .rail-list li {
    animation: rail-in 0.5s ease both;
  }

  .rail-list li:nth-child(2) { animation-delay: 0.05s; }
  .rail-list li:nth-child(3) { animation-delay: 0.1s; }
  .rail-list li:nth-child(4) { animation-delay: 0.15s; }
  .rail-list li:nth-child(5) { animation-delay: 0.2s; }
  .rail-list li:nth-child(6) { animation-delay: 0.25s; }
  .rail-list li:nth-child(7) { animation-delay: 0.3s; }
}

@keyframes rail-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

  .hero-badge {
    animation: none;
  }
}

/* ---------- 断点 ---------- */
@media (min-width: 900px) {
  .nav-list {
    justify-content: center;
    padding: 0 20px;
  }
}

@media (max-width: 880px) {
  .page-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 34px 20px 64px;
  }

  .rail {
    position: static;
    padding-right: 0;
    padding-bottom: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .rail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
  }

  .content > article {
    scroll-margin-top: 74px;
  }
}

@media (max-width: 520px) {
  .strip {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 8px 16px;
  }

  .masthead {
    padding: 20px 16px 12px;
  }

  .hero {
    padding: 72px 18px 80px;
  }

  .content > article:first-child > p:first-of-type::first-letter {
    font-size: 3.2rem;
  }

  .content blockquote {
    padding-left: 18px;
    font-size: 1.14rem;
  }
}

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