:root {
  --ink: #000000;
  --paper: #ffffff;
  --maxw: 1180px;
  --gut: clamp(16px, 3.2vw, 40px);
  --gap: clamp(16px, 2vw, 24px);
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
.brand,
.cta,
.foot-brand {
  font-family: "Fredoka", "Nunito", "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

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

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

.skip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-size: 16px;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

/* 头部 */
.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.brand-row {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.02em;
}

.brand .mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: "Fredoka", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  white-space: nowrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 22px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cta:hover,
.cta:focus-visible {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

/* 导航 */
.nav {
  border-top: 1px solid var(--ink);
}

.nav ol {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.nav li {
  border-right: 1px solid var(--ink);
}

.nav li:nth-child(2) {
  border-right: 2px solid var(--ink);
}

.nav li:last-child {
  border-right: 0;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}

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

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--paper);
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 38vh;
  padding: clamp(28px, 5vw, 56px) var(--gut) clamp(52px, 8vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
}

.hero h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(38px, 8.6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(14px, 3vw, 30px);
  background: var(--ink);
  clip-path: polygon(0 0, 100% 55%, 100% 100%, 0 100%);
}

/* 版心 */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding: clamp(26px, 4vw, 48px) 0 clamp(40px, 6vw, 72px);
}

.sheet-head {
  grid-column: 1 / -1;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
}

.sheet-head h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.2;
}

p.subtitle {
  margin: 0;
  max-width: 66ch;
  font-size: 17px;
  color: var(--ink);
  opacity: 0.82;
}

/* 正文 */
.prose {
  grid-column: 1 / 10;
  min-width: 0;
}

.prose section[id] {
  scroll-margin-top: 18px;
}

.prose section + section {
  margin-top: clamp(28px, 4vw, 46px);
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid var(--ink);
}

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

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.22;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.3;
}

.prose p {
  margin: 0 0 15px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

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

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

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--paper);
}

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

.prose blockquote a {
  color: var(--paper);
}

.prose table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 16px;
}

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

.prose th {
  font-weight: 700;
}

.prose hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--ink);
}

.prose code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.94em;
}

.prose img {
  width: 100%;
  height: auto;
  margin: 0 0 18px;
}

/* 侧栏 */
.rail {
  grid-column: 10 / 13;
  align-self: start;
  position: sticky;
  top: 16px;
  background: var(--ink);
  color: var(--paper);
  padding: 18px 18px 22px;
}

.rail-title {
  margin: 0 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 17px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rail;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.rail-list li:last-child a {
  border-bottom: 0;
}

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

/* 页脚 */
.foot {
  margin-top: clamp(30px, 5vw, 60px);
  background: var(--ink);
  color: var(--paper);
  padding: clamp(26px, 4vw, 46px) 0 24px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

.foot address {
  font-style: normal;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
  font-size: clamp(20px, 2.4vw, 24px);
}

.foot-brand:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.foot-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.foot-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy {
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 16px;
  line-height: 1.5;
}

/* 动效 */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* 窄屏 */
@media (max-width: 880px) {
  .sheet {
    grid-template-columns: 1fr;
  }

  .prose,
  .rail {
    grid-column: 1 / -1;
  }

  .rail {
    position: static;
  }

  .foot-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    min-height: 34vh;
  }
}

@media (max-width: 560px) {
  .brand-row {
    padding: 12px var(--gut);
    gap: 10px;
  }

  .cta {
    padding: 10px 16px;
  }

  .nav a {
    padding: 12px 13px;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(32px, 11vw, 56px);
  }

  .foot-links {
    grid-template-columns: 1fr;
  }
}

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

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

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