@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #101418;
  --panel: #161c22;
  --acc: #FF4A1C;
  --ink: #F4F1EA;
  --line: #2b333b;
  --dim: #98a3ac;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.ovl-lock {
  overflow: hidden;
}

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

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 .5em;
  line-height: 1.28;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.menu-btn {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.2;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--acc);
  border-radius: 0;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  background: var(--acc);
  color: var(--bg);
}

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

/* ------- 顶栏 ------- */
.topbar {
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}

.tb-in {
  max-width: 1260px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
  border-left: 6px solid var(--acc);
  padding-left: 10px;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.nav-l,
.nav-r {
  display: none;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  gap: 2px;
}

.nav-l a,
.nav-r a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.nav-l a:hover,
.nav-r a:hover {
  color: var(--acc);
  border-color: var(--acc);
}

/* ------- 锚点条 ------- */
.anchors {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}

.anchors-in {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 8px;
  display: flex;
  overflow-x: auto;
}

.anchors-in a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.anchors-in a:hover {
  color: var(--acc);
  border-color: var(--acc);
}

/* ------- 首屏 ------- */
.hero {
  position: relative;
  min-height: 45vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.05);
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: rgba(16, 20, 24, .62);
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: 960px;
  padding: 30px 18px;
  text-align: center;
}

.hero-in h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 52px);
  line-height: 1.22;
  letter-spacing: .01em;
}

/* ------- 主体骨架 ------- */
.wrap {
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px 16px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.rail {
  min-width: 0;
}

.rail-h {
  margin: 0 0 10px;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  line-height: 1.5;
  color: var(--acc);
  border-left: 6px solid var(--acc);
  padding-left: 10px;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rail-list a {
  display: block;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 24px;
  text-decoration: none;
  border: 2px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}

.rail-list a:hover {
  color: var(--acc);
  border-color: var(--acc);
}

.doc {
  min-width: 0;
  border-top: 3px solid var(--acc);
  padding-top: 22px;
}

.doc-main > * {
  scroll-margin-top: 72px;
}

.doc-main > article {
  margin: 0 0 30px;
  padding: 0 0 30px;
  border-bottom: 2px solid var(--line);
}

.doc-main > article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.doc-main h2 {
  font-size: clamp(23px, 3.2vw, 32px);
  margin: 0 0 14px;
  letter-spacing: .01em;
}

.doc-main h2::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--acc);
  margin-right: 10px;
}

.doc-main h3 {
  font-size: clamp(19px, 2.3vw, 23px);
  margin: 26px 0 10px;
  color: var(--acc);
}

.doc-main p,
.doc-main li {
  font-size: 17px;
  line-height: 1.78;
}

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

.doc-main li {
  margin-bottom: .4em;
}

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

.doc-main strong {
  color: var(--acc);
}

.doc-main blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 6px solid var(--acc);
  background: var(--panel);
}

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

.doc-main time {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  color: var(--dim);
}

/* ------- 页脚 ------- */
.foot {
  max-width: 1260px;
  margin: 0 auto;
  padding: 34px 16px 46px;
  border-top: 2px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.fbrand a {
  display: inline-block;
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
}

.fnav dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
}

.fnav dt {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  color: var(--acc);
  line-height: 40px;
}

.fnav dd {
  margin: 0;
}

.fnav a {
  display: inline-block;
  min-height: 40px;
  line-height: 40px;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.fnav a:hover {
  color: var(--acc);
  border-color: var(--acc);
}

.fcopy {
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 16px;
  color: var(--dim);
  line-height: 1.6;
}

/* ------- 全屏菜单 ------- */
.ovl {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: none;
  padding: 16px;
  overflow-y: auto;
}

.ovl.open {
  display: block;
}

.ovl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.ovl-brand {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--acc);
}

.ovl-nav {
  display: grid;
}

.ovl-nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 10px 4px;
  font-size: 21px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  transition: color .18s ease, padding-left .18s ease;
}

.ovl-nav a:hover {
  color: var(--acc);
  padding-left: 14px;
}

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

.ovl.open .ovl-nav a {
  animation: sl .2s ease both;
}

.ovl.open .ovl-nav a:nth-child(1) { animation-delay: .02s; }
.ovl.open .ovl-nav a:nth-child(2) { animation-delay: .06s; }
.ovl.open .ovl-nav a:nth-child(3) { animation-delay: .1s; }
.ovl.open .ovl-nav a:nth-child(4) { animation-delay: .14s; }
.ovl.open .ovl-nav a:nth-child(5) { animation-delay: .18s; }
.ovl.open .ovl-nav a:nth-child(6) { animation-delay: .22s; }
.ovl.open .ovl-nav a:nth-child(7) { animation-delay: .26s; }

/* ------- 滚动显现 ------- */
html.js .rv {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .18s ease, transform .18s ease;
}

html.js .rv.in {
  opacity: 1;
  transform: none;
}

/* ------- 断点 ------- */
@media (min-width: 860px) {
  .foot {
    grid-template-columns: minmax(0, 1.5fr) 1fr 1fr auto;
    gap: 26px;
    align-items: start;
  }

  .fcopy {
    text-align: right;
  }
}

@media (min-width: 960px) {
  .tb-in {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    min-height: 76px;
  }

  .nav-l,
  .nav-r {
    display: flex;
    align-items: center;
  }

  .nav-l {
    justify-self: end;
  }

  .nav-r {
    justify-self: start;
  }

  .wrap {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 34px;
    padding-top: 34px;
  }

  .rail {
    position: sticky;
    top: 64px;
    align-self: start;
  }

  .rail-list {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .rail-list a {
    border: 0;
    border-left: 2px solid var(--line);
    padding: 6px 10px;
    min-height: 40px;
    line-height: 28px;
  }

  .rail-list a:hover {
    border-left-color: var(--acc);
  }
}

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

  html.js .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ovl.open .ovl-nav a {
    animation: none;
  }

  .anchors-in a,
  .nav-l a,
  .nav-r a,
  .fnav a,
  .rail-list a,
  .menu-btn {
    transition: none;
  }
}

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