@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --paper: #ffffff;
  --ink: #000000;
  --line: rgba(255, 255, 255, 0.16);
  --hair: rgba(255, 255, 255, 0.07);
  --soft: rgba(255, 255, 255, 0.62);
  --rail: 236px;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* ---------- 左侧固定栏 ---------- */

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: var(--rail);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--ink);
  border-right: 1px solid var(--line);
}

.brand {
  display: block;
  min-height: 44px;
  padding: 4px 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--paper);
}

.brand::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin-bottom: 14px;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand:hover::before {
  transform: rotate(-90deg);
}

.mnav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--soft);
}

.mnav summary::-webkit-details-marker {
  display: none;
}

.mnav summary::after {
  content: '';
  width: 9px;
  height: 9px;
  border: 1px solid var(--paper);
  transition: transform 0.35s ease, background 0.35s ease;
}

.mnav[open] summary::after {
  transform: rotate(45deg);
  background: var(--paper);
}

.mnav menu {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  counter-reset: n;
}

.mnav menu li {
  counter-increment: n;
}

.mnav menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.28;
  transition: padding-left 0.22s ease, color 0.22s ease;
}

.mnav menu a::before {
  content: counter(n, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--soft);
}

.mnav menu a:hover {
  padding-left: 8px;
  color: var(--paper);
}

/* ---------- 主骨架 ---------- */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--rail);
}

.ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--soft);
  text-transform: uppercase;
}

.ticker::before {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--paper);
  flex: none;
}

.frame {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 206px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 40px 28px 0;
}

.frame > main {
  min-width: 0;
}

/* ---------- 侧栏 ---------- */

.side {
  position: sticky;
  top: 28px;
  padding: 20px 18px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 26px 62px -34px rgba(255, 255, 255, 0.75);
}

.side-h {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.26em;
}

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

.side-list li {
  counter-increment: s;
}

.side-list a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 40px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: #101010;
  font-size: 15px;
  line-height: 1.3;
  transition: padding-left 0.2s ease, color 0.2s ease;
}

.side-list a::before {
  content: counter(s, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
}

.side-list a:hover {
  padding-left: 5px;
  color: #000;
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 'm c';
  gap: 32px;
  align-items: end;
  min-height: 70vh;
  padding-bottom: 46px;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: -40px;
  bottom: -1px;
  left: calc(50% - 14px);
  width: 28px;
  background: var(--paper);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.hero-copy {
  grid-area: c;
  text-align: right;
  padding-bottom: 6px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 58px);
}

.hero-desc {
  max-width: 42ch;
  margin: 20px 0 0 auto;
  color: var(--soft);
  font-size: 16px;
}

.hero-media {
  grid-area: m;
  position: relative;
  align-self: stretch;
  min-height: 340px;
  overflow: hidden;
  border-radius: 10px;
  background: repeating-linear-gradient(135deg, #111111 0 6px, #000000 6px 14px);
  box-shadow: 0 30px 70px -40px rgba(255, 255, 255, 0.6);
}

.hero-media img {
  position: absolute;
  top: -15%;
  left: 0;
  width: 100%;
  height: 130%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  will-change: transform;
}

/* ---------- 正文 ---------- */

.doc {
  max-width: 72ch;
  padding: 0 0 44px;
  counter-reset: d;
}

.doc section {
  counter-increment: d;
  padding: 54px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.doc section:first-child {
  border-top: 0;
  padding-top: 48px;
}

.doc section::before {
  content: counter(d, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--soft);
}

.doc h2 {
  margin: 0 0 18px;
  font-size: clamp(23px, 2.6vw, 32px);
}

.doc h2 span {
  display: inline;
}

.doc h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  font-weight: 600;
}

.doc p {
  max-width: 66ch;
  margin: 0 0 18px;
}

.doc ul,
.doc ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.doc li {
  margin: 0 0 9px;
}

.doc a {
  color: var(--paper);
  text-underline-offset: 3px;
}

.doc strong {
  font-weight: 600;
}

.doc blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--paper);
  color: var(--soft);
}

.doc code,
.doc pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: auto;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
}

.foot address {
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--soft);
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 13px;
  text-decoration: none;
  color: var(--soft);
  transition: color 0.2s ease;
}

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

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  .rail {
    position: sticky;
    top: 0;
    bottom: auto;
    z-index: 40;
    width: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
  }

  .brand {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 18px;
  }

  .brand::before {
    display: none;
  }

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

  .mnav summary {
    justify-content: space-between;
    min-width: 92px;
    border-top: 0;
    padding: 0;
  }

  .mnav menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(272px, 78vw);
    max-height: 66vh;
    overflow: auto;
    padding: 6px 14px 10px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.95);
  }

  .shell {
    margin-left: 0;
  }

  .ticker {
    padding: 10px 16px;
    letter-spacing: 0.18em;
    font-size: 11px;
  }

  .ticker::before {
    width: 22px;
  }

  .frame {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 14px 16px 0;
  }

  .frame > main {
    order: 1;
    width: 100%;
  }

  .side {
    order: 2;
    position: static;
    width: 100%;
  }

  .side-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: 'c' 'm';
    min-height: 0;
    gap: 18px;
    padding: 2px 0 22px;
  }

  .hero::after {
    display: none;
  }

  .hero-copy {
    text-align: left;
    padding-bottom: 0;
  }

  .hero h1 {
    font-size: clamp(27px, 8.2vw, 40px);
  }

  .hero-desc {
    margin: 12px 0 0;
    font-size: 16px;
  }

  .hero-media {
    min-height: 0;
    height: 46vw;
    max-height: 280px;
  }

  .doc section {
    padding: 34px 0;
    scroll-margin-top: 84px;
  }

  .doc section:first-child {
    padding-top: 26px;
  }

  .foot {
    padding: 14px 16px;
  }
}

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

  .hero-media img {
    transform: none !important;
    height: 100%;
    top: 0;
  }

  .brand::before,
  .mnav summary::after,
  .mnav menu a,
  .side-list a {
    transition: none;
  }
}

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