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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --tint: #f0f0f0;
  --grey: #6b6b6b;
  --rail: 186px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Roboto", Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
}

h1,
h2,
h3 {
  font-family: "Newsreader", Georgia, "Songti SC", serif;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 28px;
}

button {
  font: inherit;
  color: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  text-decoration: none;
}

.skip:focus {
  position: fixed;
  left: 12px;
  top: 12px;
}

/* ==== 左侧固定栏 ==== */
.site-head {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 22px;
  background: var(--paper);
  border-right: 1px solid var(--ink);
}

.brand {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.burger,
.veil-close {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  font-size: 15px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.burger:hover,
.veil-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.cta {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 26px;
  border-radius: 28px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
}

/* ==== 全屏遮罩菜单 ==== */
.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.veil.open {
  opacity: 1;
  pointer-events: auto;
}

.veil .veil-close {
  align-self: flex-start;
  border-color: var(--paper);
  background: transparent;
  color: var(--paper);
}

.veil .veil-close:hover {
  background: var(--paper);
  color: var(--ink);
}

.veil-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 2px;
}

.veil-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 0;
  color: var(--paper);
  text-decoration: none;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.5rem, 4.4vw, 2.9rem);
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  transition: padding-left 0.22s ease;
}

.veil-nav a:hover {
  padding-left: 14px;
}

/* ==== 主体 ==== */
main {
  padding-left: var(--rail);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 72px;
}

main [id] {
  scroll-margin-top: 16px;
}

.hero {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  text-align: right;
  padding: 120px 0 44px;
  border-bottom: 2px solid var(--ink);
}

.hero h1 {
  font-size: clamp(2.2rem, 7.6vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 224px;
  gap: 56px;
  padding-top: 56px;
}

.prose {
  min-width: 0;
  max-width: 68ch;
}

.prose article {
  border-top: 1px solid var(--ink);
  padding-top: 32px;
  margin-top: 56px;
}

.prose article:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.prose h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.05rem);
  margin-bottom: 20px;
}

.prose h3 {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  margin: 32px 0 14px;
}

.prose h2 > span,
.prose h3 > span {
  display: inline-block;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 6px;
}

.prose p {
  margin: 0 0 18px;
  line-height: 1.8;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
  line-height: 1.8;
}

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

.prose a {
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.1rem;
}

/* ==== 右侧目录 ==== */
.side {
  position: sticky;
  top: 32px;
  align-self: start;
  border-left: 1px solid var(--ink);
  padding-left: 24px;
}

.side-h {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: step;
}

.side-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.side-list li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--grey);
  flex: 0 0 auto;
}

.side-list a {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 28px;
  background: var(--tint);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
}

.side-list a:hover {
  background: var(--ink);
  color: var(--paper);
}

.deco {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 7px;
  background: var(--ink);
  vertical-align: 0.15em;
}

/* ==== 页脚 ==== */
.foot {
  padding: 56px 40px 32px var(--rail);
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.foot > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: 8px;
}

.foot-grid nav,
.foot-grid dl {
  margin: 0;
  min-width: 0;
}

.foot-grid dt {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.foot-grid dd {
  margin: 0 0 4px;
}

.foot-grid dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid transparent;
}

.foot-grid dd a:hover {
  border-bottom-color: var(--ink);
}

.foot-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  padding-top: 28px;
  margin-top: 32px;
  border-top: 1px solid var(--ink);
}

.form-h {
  flex: 1 0 100%;
  font-size: 1.15rem;
}

.sub {
  display: flex;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
}

.sub input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  font: inherit;
  font-size: 16px;
}

.sub input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.sub button {
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 28px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  cursor: pointer;
}

.foot-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.cr {
  margin: 0;
  color: var(--grey);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 2px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
}

/* ==== 滚动显现 ==== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .cta:hover,
  .veil-nav a:hover {
    transform: none;
  }
}

/* ==== 窄屏 ==== */
@media (max-width: 900px) {
  .site-head {
    inset: 0 0 auto 0;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .brand {
    flex: 1 0 100%;
    font-size: 19px;
    padding-bottom: 10px;
    margin-bottom: 4px;
  }

  .burger {
    flex: 0 0 auto;
  }

  .cta {
    position: static;
    margin-left: auto;
    top: auto;
    right: auto;
  }

  main {
    padding-left: 0;
    padding-top: 132px;
  }

  .wrap {
    padding: 0 18px 56px;
  }

  main [id] {
    scroll-margin-top: 132px;
  }

  .hero {
    min-height: 56vh;
    padding: 32px 0 28px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 3.4rem);
    max-width: 100%;
  }

  .doc {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 32px;
  }

  .side {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--ink);
    padding-left: 0;
    padding-top: 20px;
  }

  .foot {
    padding: 40px 18px 28px;
  }

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

  .veil {
    padding: 22px 18px;
  }
}

@media (max-width: 460px) {
  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sub {
    flex: 1 0 100%;
  }
}

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