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

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

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
p { margin: 0 0 1rem; }
img { max-width: 100%; }

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

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 44px);
}

/* 页头：品牌独占一行，菜单第二行 */
.mast {
  padding-top: clamp(14px, 2.4vw, 24px);
  border-bottom: 2px solid #000000;
}

.mast-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(10px, 1.8vw, 16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: clamp(1rem, 2.1vw, 1.375rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 220ms ease, letter-spacing 220ms ease;
}

.brand:hover {
  letter-spacing: 0.26em;
  border-bottom-color: #000000;
}

.mast-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid #000000;
  border-radius: 10px;
  transition: background-color 220ms ease, color 220ms ease;
}

.mast-link:hover {
  background: #000000;
  color: #ffffff;
}

/* 菜单：nav > ol > li > a */
.menu {
  padding-bottom: 2px;
}

.menu ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.menu li { flex: 0 0 auto; }

.menu ol > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 1rem;
  white-space: nowrap;
  text-decoration: none;
  border-left: 1px solid #d4d4d4;
  transition: background-color 200ms ease, color 200ms ease;
}

.menu li:last-child > a { border-right: 1px solid #d4d4d4; }

.menu ol > li > a:hover,
.menu ol > li > a.is-on {
  background: #000000;
  color: #ffffff;
}

/* Hero：右对齐、紧凑、斜切底边 */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  min-height: 45vh;
  margin-top: clamp(20px, 4vw, 44px);
  padding: clamp(24px, 5vw, 56px) 0 clamp(52px, 9vw, 96px);
  text-align: right;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.88) 56%, #ffffff 100%);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -2;
  overflow: hidden;
}

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

.hero-mark {
  position: absolute;
  left: -0.04em;
  bottom: clamp(44px, 8vw, 88px);
  z-index: 0;
  font-size: clamp(88px, 24vw, 240px);
  line-height: 0.8;
  font-weight: 500;
  letter-spacing: -0.06em;
  color: #000000;
  opacity: 0.08;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 24ch;
}

.hero h1 {
  margin: 0 0 clamp(10px, 1.6vw, 18px);
  font-size: clamp(26px, 5.2vw, 54px);
  line-height: 1.14;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #000000;
}

.hero-cut {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(26px, 6vw, 58px);
  z-index: 2;
  background: #000000;
  clip-path: polygon(0 100%, 100% 0, 100% 100%, 0 100%);
}

/* 主体网格：aside 在左 */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: clamp(28px, 5vw, 52px) 0 clamp(36px, 6vw, 64px);
}

.rail {
  position: sticky;
  top: 24px;
  border-top: 3px solid #000000;
  padding-top: 14px;
}

.rail-h {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.28em;
}

.rail hr,
.doc hr {
  height: 0;
  margin: 0 0 14px;
  border: 0;
  border-top: 1px solid #000000;
}

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

.rail-list li { counter-increment: rail; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid #dcdcdc;
  transition: padding-left 220ms ease, color 220ms ease;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  font-size: 0.9em;
  color: #808080;
}

.rail-list a:hover,
.rail-list a.is-on {
  padding-left: 8px;
  color: #000000;
  border-bottom-color: #000000;
}

/* 正文 */
.doc {
  min-width: 0;
}

.doc > section {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 22px rgba(0, 0, 0, 0.06);
  padding: clamp(20px, 3.4vw, 36px);
  margin: 0 0 clamp(16px, 2.6vw, 28px);
  scroll-margin-top: 24px;
  animation: rise 420ms ease both;
}

.doc > section:nth-child(2) { animation-delay: 40ms; }
.doc > section:nth-child(3) { animation-delay: 80ms; }
.doc > section:nth-child(4) { animation-delay: 120ms; }
.doc > section:nth-child(5) { animation-delay: 160ms; }
.doc > section:nth-child(6) { animation-delay: 200ms; }
.doc > section:nth-child(7) { animation-delay: 240ms; }

.doc h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.7vw, 28px);
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.doc h2 + hr { margin: 0 0 18px; }

.doc h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 500;
}

.doc h3 + hr { margin: 0 0 14px; }

.doc p,
.doc li {
  font-size: 1rem;
  line-height: 1.75;
}

.doc ul,
.doc ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.doc li { margin-bottom: 0.5rem; }

.doc a {
  text-underline-offset: 3px;
  transition: background-color 200ms ease;
}

.doc a:hover { background: #000000; color: #ffffff; }

.doc strong { font-weight: 500; }

.doc blockquote {
  margin: 1.2rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid #000000;
  font-style: italic;
}

.doc img {
  display: block;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
}

.doc code {
  font-family: inherit;
  background: #f2f2f2;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* 页脚：三列 dl + 底栏分列 */
.foot {
  border-top: 2px solid #000000;
  padding: clamp(24px, 3.6vw, 36px) 0 clamp(20px, 3vw, 28px);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 40px);
  margin-bottom: clamp(18px, 3vw, 28px);
}

.foot dl { margin: 0; }

.foot dt {
  margin-bottom: 6px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #666666;
}

.foot dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 2px 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 220ms ease;
}

.foot dd a:hover { border-bottom-color: #000000; }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  border-top: 1px solid #d4d4d4;
  padding-top: clamp(12px, 2vw, 18px);
}

.foot-bar p { margin: 0; }

.foot-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  text-decoration: none;
  border: 1px solid #000000;
  border-radius: 10px;
  transition: background-color 200ms ease, color 200ms ease;
}

.foot-bar a:hover { background: #000000; color: #ffffff; }

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

.rail-list li {
  animation: rise 380ms ease both;
}

.rail-list li:nth-child(2) { animation-delay: 30ms; }
.rail-list li:nth-child(3) { animation-delay: 60ms; }
.rail-list li:nth-child(4) { animation-delay: 90ms; }
.rail-list li:nth-child(5) { animation-delay: 120ms; }
.rail-list li:nth-child(6) { animation-delay: 150ms; }
.rail-list li:nth-child(7) { animation-delay: 180ms; }

@media (max-width: 820px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(18px, 4vw, 26px);
    padding-top: clamp(22px, 5vw, 32px);
  }

  .rail {
    position: static;
  }

  .rail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
  }

  .hero {
    min-height: 44vh;
    padding-bottom: clamp(46px, 12vw, 76px);
  }

  .hero-copy { max-width: 20ch; }

  .hero-mark { bottom: clamp(38px, 11vw, 70px); }

  .foot-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .rail-list { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(24px, 7.4vw, 32px); }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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