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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --soft: #e6e6e6;
  --dot: #cfcfcf;
  --mute: #555555;
  --pad: clamp(1rem, 4vw, 3rem);
  --r: 28px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*,
*::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: 'Chakra Petch', ui-sans-serif, system-ui, 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
}

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

h1, h2, h3, h4, p, figure, address { margin: 0; }

h1, h2, h3, h4 {
  font-family: 'Russo One', 'Chakra Petch', ui-sans-serif, system-ui, 'Noto Sans SC', sans-serif;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: .015em;
}

a { color: inherit; }

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

.wrap {
  width: min(1200px, calc(100% - 2 * var(--pad)));
  margin-inline: auto;
}

/* ---------- 顶栏 ---------- */
.top { border-bottom: 1px solid var(--ink); }

.top-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  font-family: 'Russo One', system-ui, 'Noto Sans SC', sans-serif;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  letter-spacing: .12em;
  line-height: 1;
}

.brand::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: .65rem;
  background: var(--ink);
}

.top-mark {
  width: clamp(36px, 10vw, 96px);
  height: 10px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

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

.anchors nav {
  width: min(1200px, calc(100% - 2 * var(--pad)));
  margin-inline: auto;
}

.anchors ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.anchors li { flex: 0 0 auto; }

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: .55rem 1rem;
  font-size: .95rem;
  white-space: nowrap;
  text-decoration: none;
  border-right: 1px solid var(--soft);
  transition: background-color .22s var(--ease), color .22s var(--ease);
}

.anchors li:first-child a { border-left: 1px solid var(--soft); }

.anchors a:hover,
.anchors a:focus-visible,
.anchors a[aria-current] {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  min-height: 100vh;
  padding-block: clamp(2rem, 6vh, 4rem) clamp(2rem, 6vh, 4.5rem);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: center;
  border-bottom: 1px solid var(--ink);
}

.hero-in {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: clamp(.9rem, 2.5vw, 1.6rem);
}

.hero-h1 {
  font-size: clamp(2.3rem, 8.6vw, 6.4rem);
  letter-spacing: .01em;
  word-break: break-word;
}

.hero-lead {
  max-width: 46ch;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.8;
  color: #222;
  border-top: 1px solid var(--ink);
  padding-top: clamp(.9rem, 2vw, 1.3rem);
}

.hero-fig {
  margin-top: clamp(.5rem, 2vw, 1rem);
  min-height: clamp(180px, 30vh, 420px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 主体框架 ---------- */
.frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2.5rem, 7vh, 5.5rem);
}

main, div { min-width: 0; }

div > section {
  border-top: 1px solid var(--ink);
  padding-block: clamp(1.8rem, 4.5vh, 3rem);
  scroll-margin-top: 76px;
  overflow-wrap: break-word;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

div > section:first-child {
  border-top: 0;
  padding-top: 0;
}

div > section.pre {
  opacity: 0;
  transform: translateY(18px);
}

div > section.in {
  opacity: 1;
  transform: none;
}

/* ---------- 正文排版 ---------- */
.prose p { margin-block: 0 1.1rem; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }

.prose h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  margin-block: 0 .9rem;
}

.prose h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  margin-block: 1.6rem .6rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
  max-width: 66ch;
}

.prose li { margin-bottom: .45rem; }

.prose li::marker { color: var(--ink); }

.prose strong { font-weight: 700; }

.prose blockquote {
  margin: 0 0 1.3rem;
  padding: .35rem 0 .35rem 1.1rem;
  border-left: 3px solid var(--ink);
  font-size: 1.05rem;
}

.prose blockquote p { margin-bottom: .5rem; }

.prose table {
  width: 100%;
  margin-bottom: 1.4rem;
  border-collapse: collapse;
  font-size: .95rem;
}

.prose th,
.prose td {
  border: 1px solid var(--ink);
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: top;
}

.prose th { font-weight: 700; background: #f3f3f3; }

.prose figure { margin: 0 0 1.4rem; }

.prose figure img {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.prose a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  border: 1px solid var(--soft);
  padding: .05em .3em;
}

/* ---------- 右侧栏 ---------- */
.side {
  align-self: start;
  position: sticky;
  top: 5rem;
  min-width: 0;
  padding-left: clamp(1rem, 2vw, 1.75rem);
  border-left: 1px solid var(--ink);
}

.side small {
  display: block;
  margin-bottom: .3rem;
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mute);
}

.side h2 {
  font-size: 1.1rem;
  margin-bottom: 1.1rem;
}

.side ul {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .45rem 1rem;
  font-size: .9rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  transition: background-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}

.side a:hover,
.side a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: translateX(2px);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: clamp(2.5rem, 7vh, 5rem);
  padding-block: clamp(2rem, 5vh, 3.5rem) 1.25rem;
  border-top: 2px solid var(--ink);
}

.foot-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: end;
}

.foot-brand { font-style: normal; min-width: 0; }

.foot-mark {
  display: block;
  font-family: 'Russo One', system-ui, 'Noto Sans SC', sans-serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 9.5vw, 6.5rem);
  line-height: .95;
  letter-spacing: -.01em;
  word-break: break-word;
}

.foot-nav ul {
  display: grid;
  gap: .1rem;
  justify-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .2rem 0;
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .22s var(--ease);
}

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

.foot-bot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  margin-top: 2rem;
  padding-top: .85rem;
  border-top: 1px solid var(--soft);
  font-size: .85rem;
  color: var(--mute);
}

.foot-bot ul {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-bot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
}

.foot-bot a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-in > * {
    animation: rise .7s var(--ease) both;
  }

  .hero-in > *:nth-child(2) { animation-delay: .08s; }
  .hero-in > *:nth-child(3) { animation-delay: .16s; }

  .side li {
    animation: rise .55s var(--ease) both;
  }

  .side li:nth-child(2) { animation-delay: .05s; }
  .side li:nth-child(3) { animation-delay: .1s; }
  .side li:nth-child(4) { animation-delay: .15s; }
  .side li:nth-child(5) { animation-delay: .2s; }
  .side li:nth-child(6) { animation-delay: .25s; }
  .side li:nth-child(7) { animation-delay: .3s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

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

  .side ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .foot-top { grid-template-columns: minmax(0, 1fr); }

  .foot-nav ul { justify-items: start; }
}

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

  .hero { min-height: auto; padding-block: 1.75rem 2.25rem; }

  .hero-h1 { font-size: clamp(2.1rem, 10vw, 3rem); }

  .hero-fig { min-height: 190px; }

  .anchors a { padding-inline: .8rem; font-size: .9rem; }

  .top-mark { display: none; }

  .foot-bot { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

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