:root {
  --ink: #000000;
  --paper: #ffffff;
  --r: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
  --pad: clamp(1rem, 4vw, 2.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: "Space Grotesk", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  overflow-wrap: anywhere;
}

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

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

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem var(--pad);
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.9rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

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

.nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.pills {
  display: flex;
  gap: 0.45rem;
  margin: 0;
  padding: 0 0 0.15rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  height: 0;
}

.pills a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

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

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 2.5rem);
  align-items: center;
  min-height: 70vh;
  padding: clamp(2rem, 8vw, 5rem) var(--pad) clamp(2rem, 6vw, 4rem);
  border-bottom: 3px solid var(--ink);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 12rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.lede {
  margin: clamp(1rem, 3vw, 1.6rem) 0 0;
  max-width: 34ch;
  padding-left: 1rem;
  border-left: 6px solid var(--ink);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.6;
}

.hero-fig {
  margin: 0;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
}

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

.hero-mark {
  padding: 1rem;
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  text-align: center;
  line-height: 1;
}

/* 滚动字带 */
.ticker {
  overflow: hidden;
  padding: 0.55rem 0;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.ticker-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: slide 28s linear infinite;
}

@keyframes slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

/* 主体网格 */
.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3rem);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.8rem, 5vw, 4rem) var(--pad) clamp(3rem, 7vw, 6rem);
}

.prose {
  min-width: 0;
}

.prose div {
  padding: clamp(1.8rem, 5vw, 3.5rem) 0;
  border-top: 3px solid var(--ink);
  scroll-margin-top: 130px;
}

.prose div:first-child {
  padding-top: 0;
  border-top: 0;
}

.prose small {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.prose h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.prose h3 {
  margin: 2rem 0 0.6rem;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.prose p {
  margin: 0 0 1.1rem;
  max-width: 62ch;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  max-width: 62ch;
}

.prose li {
  margin: 0.35rem 0;
}

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

.prose img {
  margin: 1.5rem 0;
  border: 3px solid var(--ink);
  border-radius: var(--r);
}

.prose figure {
  margin: 1.5rem 0;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.8rem 0 0.8rem 1.2rem;
  border-left: 8px solid var(--ink);
  font-size: 1.15rem;
  line-height: 1.5;
}

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

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

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

.prose hr {
  height: 3px;
  margin: 2rem 0;
  border: 0;
  background: var(--ink);
}

div[id] {
  scroll-margin-top: 130px;
}

/* 侧栏 */
.rail {
  order: -1;
  align-self: start;
  padding: 1.4rem;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  background: var(--paper);
}

.rail small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.rail h2 {
  margin: 0.15rem 0 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--ink);
  font-size: 1.55rem;
  letter-spacing: -0.035em;
}

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

.rail a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.16);
  font-size: 0.98rem;
  text-decoration: none;
}

.rail a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 页脚 */
.foot {
  padding: clamp(2.4rem, 6vw, 4.5rem) var(--pad) 1.4rem;
  background: var(--ink);
  color: var(--paper);
}

.foot-word {
  margin: 0;
  font-size: clamp(2.5rem, 11vw, 9rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.foot-cols {
  display: grid;
  gap: 2rem;
  margin: 2.2rem 0;
  padding-top: 1.8rem;
  border-top: 2px solid var(--paper);
}

.foot-addr {
  display: grid;
  gap: 0.35rem;
  max-width: 34ch;
  font-style: normal;
}

.foot-addr strong {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.foot-addr span {
  font-size: 0.95rem;
  opacity: 0.72;
}

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

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 1rem;
  text-decoration: none;
  padding: 0 0.2rem;
  transition: background 0.16s ease, color 0.16s ease;
}

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

.foot-base {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.1rem;
  border-top: 2px solid var(--paper);
  font-size: 0.9rem;
}

.foot-base ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot-base a:hover {
  border-bottom-color: var(--paper);
}

.foot :focus-visible {
  outline-color: var(--paper);
}

/* 滚动浮现 */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

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

/* 断点 */
@media (min-width: 760px) {
  .foot-cols {
    grid-template-columns: 1.15fr 1fr;
  }
}

@media (min-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  }
}

@media (min-width: 960px) {
  .body-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(2rem, 5vw, 4.5rem);
  }

  .rail {
    order: 0;
    position: sticky;
    top: 118px;
  }
}

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