:root {
  --ink: #000000;
  --paper: #ffffff;
  --pad: clamp(1.15rem, 5vw, 6rem);
  --rail-w: 232px;
  --bar-h: 4.5rem;
}

*,
*::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: Epilogue, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

/* ---------- top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem var(--pad);
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
}

.mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 10px;
  overflow: hidden;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.find {
  margin-left: auto;
}

.find-input {
  width: clamp(7rem, 26vw, 15rem);
  min-height: 44px;
  padding: 0 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
}

.find-input::placeholder {
  color: var(--ink);
  opacity: 0.45;
}

.drawer {
  position: relative;
  flex: 0 0 auto;
}

.drawer-btn {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  user-select: none;
}

.drawer-btn::-webkit-details-marker {
  display: none;
}

.drawer[open] .drawer-btn {
  background: var(--ink);
  color: var(--paper);
}

.drawer-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 40;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  min-width: min(74vw, 17rem);
  background: var(--ink);
  border-radius: 10px;
}

.drawer-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
}

.drawer-link:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- sticky anchors ---------- */

.anchors {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  background: var(--ink);
  color: var(--paper);
  overflow-x: auto;
  padding: 0 var(--pad);
  scrollbar-width: thin;
}

.anchors a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 1rem;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}

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

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.6rem, 6vw, 4.5rem) var(--pad) 0;
  border-bottom: 3px solid var(--ink);
}

.hero-type {
  max-width: 22ch;
}

.badge {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.3rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-family: Anton, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: clamp(2.5rem, 10.5vw, 8.5rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.hero-fig {
  margin: 0;
  width: 100%;
}

.hero-shot {
  display: block;
  width: 100%;
  height: clamp(11rem, 33vh, 22rem);
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.hero-block {
  display: grid;
  place-items: center;
  height: clamp(11rem, 33vh, 22rem);
  background: var(--ink);
  border-radius: 10px 10px 0 0;
}

.hero-block span {
  font-family: Anton, "PingFang SC", sans-serif;
  font-size: clamp(3.4rem, 15vw, 9rem);
  line-height: 1;
  color: var(--paper);
}

/* ---------- deck / rail / prose ---------- */

.deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 var(--pad) clamp(2rem, 7vw, 5rem);
}

.rail {
  border-bottom: 3px solid var(--ink);
  padding: 1.8rem 0;
}

.rail-h {
  margin: 0 0 0.15rem;
  font-family: Anton, "PingFang SC", sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  opacity: 0.55;
  line-height: 1.5;
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
}

.rail-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.2rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.rail-link:hover {
  background: var(--ink);
  color: var(--paper);
  padding-left: 0.6rem;
}

.prose {
  min-width: 0;
  padding: 1.4rem 0 0;
}

.prose > article {
  padding: clamp(2.2rem, 6vw, 4.5rem) 0;
  border-top: 3px solid var(--ink);
  scroll-margin-top: 4.6rem;
}

.prose > article:first-child {
  border-top: 0;
  padding-top: 0.6rem;
}

.prose h2 {
  margin: 0 0 0.9rem;
  font-family: Anton, "PingFang SC", sans-serif;
  font-size: clamp(1.85rem, 5.4vw, 3.4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: clamp(1.18rem, 3vw, 1.5rem);
  font-weight: 800;
  line-height: 1.3;
}

.prose p {
  margin: 0 0 1.1rem;
  max-width: 64ch;
  line-height: 1.85;
}

.prose p.subtitle,
.prose p.lead,
.prose p.desc,
.prose p.subhead {
  margin-bottom: 1.4rem;
  font-size: 1rem;
  opacity: 0.6;
}

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

.prose li {
  margin-bottom: 0.55rem;
  line-height: 1.75;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

.prose strong {
  font-weight: 800;
}

.prose img {
  display: block;
  margin: 1.6rem 0;
  border-radius: 10px;
}

.prose figure {
  margin: 1.6rem 0;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 1.1rem 1.3rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
}

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

.prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.prose th,
.prose td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--ink);
  color: var(--paper);
  border-bottom-color: var(--ink);
}

.prose code {
  padding: 0.1em 0.35em;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-size: 0.94em;
}

/* ---------- footer ---------- */

.foot {
  margin-top: clamp(1.5rem, 5vw, 3rem);
  padding: clamp(1.8rem, 5vw, 3.5rem) var(--pad) 2rem;
  border-top: 3px solid var(--ink);
}

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

.foot-id {
  font-style: normal;
}

.foot-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.1rem;
}

.foot-id strong {
  display: block;
  font-family: Anton, "PingFang SC", sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.foot-id p {
  margin: 0.55rem 0 0;
  max-width: 38ch;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.68;
}

.foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.2rem;
}

.foot-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
}

.foot-link:hover {
  opacity: 0.55;
}

.foot-sub {
  margin: 2.2rem 0 1.2rem;
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}

.sub-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.sub-form label {
  font-weight: 800;
  margin-right: 0.2rem;
}

.sub-form input {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 46px;
  padding: 0 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.sub-form input::placeholder {
  color: var(--ink);
  opacity: 0.45;
}

.sub-form button {
  min-height: 46px;
  padding: 0 1.7rem;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sub-form button:hover {
  background: var(--paper);
  color: var(--ink);
}

.foot-base {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.6;
}

/* ---------- reveal ---------- */

.is-off {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html.js .rail,
  html.js .prose > article {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  html.js .rail.in,
  html.js .prose > article.in {
    opacity: 1;
    transform: none;
  }

  .rail-link,
  .drawer-link,
  .foot-link,
  .anchors a,
  .sub-form button {
    transition: background 0.18s ease, color 0.18s ease, padding 0.18s ease, opacity 0.18s ease;
  }
}

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

  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- widening ---------- */

@media (min-width: 900px) {
  .deck {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    gap: clamp(1.8rem, 4vw, 3.5rem);
  }

  .rail {
    border-bottom: 0;
    border-right: 2px solid var(--ink);
    padding: 2.2rem 1.4rem 2rem 0;
    position: sticky;
    top: 3.2rem;
    align-self: start;
    max-height: calc(100svh - 3.2rem);
    overflow-y: auto;
  }

  .prose {
    padding-top: 2.2rem;
  }

  .foot-top {
    grid-template-columns: 1.15fr 1fr;
    gap: 3rem;
  }

  .hero-type {
    max-width: 26ch;
  }
}

@media (max-width: 560px) {
  .bar {
    gap: 0.5rem;
    padding: 0.75rem var(--pad);
  }

  .find-input {
    width: 6.4rem;
  }

  .drawer-btn {
    padding: 0 0.8rem;
  }

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

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