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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mono: "Orbitron", "Exo 2", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --sans: "Exo 2", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --pad: clamp(1.05rem, 4vw, 3.25rem);
  --r: 28px;
  --bar: 118px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; }
menu { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

main [id] { scroll-margin-top: calc(var(--bar) + 18px); }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem var(--pad) 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(0.85rem, 3vw, 1rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand img { display: block; height: 28px; width: auto; }

.tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.q {
  width: clamp(72px, 20vw, 190px);
  min-height: 42px;
  padding: 0 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--paper);
  background: transparent;
  border: 1px solid #4d4d4d;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
}

.q::placeholder { color: #9a9a9a; }
.q:focus { border-color: var(--paper); outline: none; }

.pop { position: relative; }

.pop summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 1.05rem;
  border: 1px solid var(--paper);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  user-select: none;
}

.pop summary::-webkit-details-marker { display: none; }
.pop[open] summary { background: var(--paper); color: var(--ink); }

.pop-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  min-width: 13rem;
  padding: 0.45rem;
  display: grid;
  gap: 2px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 20px;
}

.pop-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.95rem;
}

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

.strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.1rem var(--pad) 0.75rem;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }

.strip a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid #4d4d4d;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.strip a:hover,
.strip a:focus-visible { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: clamp(3.5rem, 12vw, 9rem) var(--pad);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 5vw));
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  background-image: repeating-linear-gradient(115deg, transparent 0 38px, rgba(255, 255, 255, 0.08) 38px 39px);
}

.hero-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15);
  opacity: 0.42;
}

.hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 20ch;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1.6rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--paper);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.2rem, 9vw, 7.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

/* ---------- 主体 ---------- */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: start;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(2.6rem, 8vw, 6rem) var(--pad);
}

.toc {
  position: sticky;
  top: calc(var(--bar) + 16px);
  border: 1px solid var(--ink);
  border-radius: var(--r);
  padding: 1.15rem 1rem 1.1rem;
}

.toc small {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #6a6a6a;
}

.toc h2 {
  margin: 0.15rem 0 0.9rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.toc-list { display: grid; gap: 1px; }
.toc-list li[hidden] { display: none; }

.toc-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.6rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.3;
}

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

.stage { min-width: 0; }

.stage > article {
  padding: clamp(2.6rem, 7vw, 5rem) 0;
  border-top: 1px solid var(--ink);
}

.stage > article:first-child { border-top: 0; padding-top: 0; }
.stage > article:last-child { padding-bottom: 0; }

.stage h2 {
  margin: 0 0 1.15rem;
  font-size: clamp(1.65rem, 4.4vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 700;
  text-wrap: balance;
}

.stage h3 {
  margin: 1.9rem 0 0.7rem;
  font-size: clamp(1.2rem, 2.8vw, 1.6rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.stage p { margin: 0 0 1.1rem; max-width: 66ch; }

.stage ul,
.stage ol { margin: 0 0 1.2rem; padding-left: 1.25rem; }
.stage li { margin-bottom: 0.4rem; }

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

.stage strong { font-weight: 700; }

.stage blockquote {
  margin: 1.6rem 0;
  padding: 0.9rem 0 0.9rem 1.3rem;
  border-left: 6px solid var(--ink);
  font-size: 1.08rem;
  line-height: 1.6;
}

.stage figure { margin: 1.6rem 0; }

.stage figure img {
  display: block;
  border: 1px solid var(--ink);
  border-radius: var(--r);
}

.stage figcaption {
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: #5c5c5c;
}

.stage img { border-radius: var(--r); height: auto; }

.stage table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3rem;
  font-size: 0.94rem;
}

.stage th,
.stage td {
  border: 1px solid var(--ink);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.stage hr {
  border: 0;
  border-top: 1px solid var(--ink);
  margin: 2rem 0;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(3.4rem, 8vw, 5.5rem) var(--pad) 1.6rem;
  background: var(--ink);
  color: var(--paper);
  clip-path: polygon(0 3.4vw, 100% 0, 100% 100%, 0 100%);
}

.foot-brand { flex: 1 1 300px; min-width: 0; }

.foot-logo {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.9rem, 6.5vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.foot-desc {
  margin: 1.1rem 0 0;
  max-width: 40ch;
  font-size: 0.93rem;
  line-height: 1.7;
  color: #b9b9b9;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 260px;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.85rem;
  border: 1px solid #4d4d4d;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.83rem;
}

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

.foot-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 1rem;
  border-top: 1px solid #333333;
  font-size: 0.83rem;
  color: #b9b9b9;
}

.foot-copy a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  color: var(--paper);
}

/* ---------- 动效 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

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

  .toc { position: static; }

  .toc-list {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.35rem;
  }

  .toc-list a { border: 1px solid #cfcfcf; border-radius: 999px; font-size: 0.85rem; }
}

@media (max-width: 560px) {
  body { font-size: 16.5px; }

  .hero { min-height: 62vh; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 8vw)); }

  .foot { clip-path: polygon(0 2.2vw, 100% 0, 100% 100%, 0 100%); }

  .stage > article { padding: 2.4rem 0; }
}

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