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

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

:root {
  --ink: #0E0E12;
  --acid: #E8FF3A;
  --violet: #6C7BFF;
  --paper: #E7E7F0;
  --dim: #A6A6BC;
  --line: rgba(232, 255, 58, .26);
  --line-v: rgba(108, 123, 255, .34);
  --hair: rgba(255, 255, 255, .1);
  --r: 18px;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Exo", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 40px);
}

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

body {
  margin: 0;
  max-width: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: clip;
  font-weight: 400;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(232, 255, 58, .05) 0 1px, transparent 1px 3px);
  opacity: .75;
}

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

a { color: var(--acid); text-decoration: none; }

button, input { font: inherit; color: inherit; }

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

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 120;
  background: var(--acid);
  color: #0B0B0F;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 16px;
  transition: top .2s;
}
.skip:focus { top: 12px; }

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px var(--pad);
  background: rgba(14, 14, 18, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-v);
}

.bar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.bar-nav.tail { justify-content: flex-end; }

.bar-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: -.01em;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .18s, background .18s, transform .18s;
}

.bar-nav a:hover {
  color: var(--acid);
  background: rgba(232, 255, 58, .07);
  transform: translateY(-1px);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 42px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--acid);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .22em;
  text-transform: none;
  justify-self: center;
  white-space: nowrap;
}

.mark span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mark img { border-radius: 8px; flex: 0 0 auto; }

.bar-tail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line-v);
  border-radius: 10px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 16px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color .18s, color .18s, background .18s, transform .18s;
}

.ico:hover {
  border-color: var(--acid);
  color: var(--acid);
  background: rgba(232, 255, 58, .08);
  transform: translateY(-1px);
}

/* ---------- 搜索面板 ---------- */
.searchpane {
  position: fixed;
  top: 62px;
  left: 0; right: 0;
  z-index: 45;
  padding: 16px var(--pad) 20px;
  background: rgba(11, 11, 16, .98);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .22s, transform .22s, visibility .22s;
}

body.search-open .searchpane {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  background: #14141B;
  border: 1px solid var(--line-v);
  border-radius: 12px;
  font-size: 16px;
}

.search-form input::placeholder { color: #7C7C93; }

.search-form button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 20px;
  background: var(--acid);
  color: #0B0B0F;
  border: 0;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .18s, filter .18s;
}

.search-form button:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* ---------- 主体 ---------- */
.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  gap: 24px;
  padding: clamp(56px, 11vh, 128px) 0 clamp(40px, 8vh, 80px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -12% -18% 0 22%;
  pointer-events: none;
  background: radial-gradient(circle at 72% 42%, rgba(108, 123, 255, .22), transparent 62%);
}

.hero > * {
  position: relative;
  max-width: 100%;
}

.badge {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid var(--acid);
  border-radius: 999px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: .24em;
  animation: float 5.5s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-9px); }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8.2vw, 6rem);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(115deg, var(--acid) 0%, #FFFFFF 44%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 span {
  display: inline-block;
  animation: rise .78s cubic-bezier(.2, .8, .25, 1) both;
  animation-delay: calc(var(--i) * 44ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(.45em) rotate(5deg); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.cue {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .18s, border-color .18s, transform .18s;
}

.cue:hover {
  color: var(--acid);
  border-color: var(--acid);
  transform: translateY(2px);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding: 44px 0 56px;
  border-top: 1px dashed var(--line-v);
}

/* ---------- 正文 ---------- */
.content {
  min-width: 0;
  max-width: 100%;
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.content > * { max-width: 100%; }

.content section {
  scroll-margin-top: 108px;
  padding-bottom: 30px;
  margin-bottom: 30px;
  border-bottom: 1px dashed var(--hair);
}

.content section:last-child { border-bottom: 0; margin-bottom: 0; }

.content h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3.1vw, 2rem);
  line-height: 1.28;
  letter-spacing: .01em;
  color: #fff;
}

.content h2::before {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, var(--acid), var(--violet));
  border-radius: 3px;
}

.content h3 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--acid);
  font-weight: 600;
}

.content p { margin: 0 0 16px; color: #D8D8E4; }

.content ul, .content ol { margin: 0 0 16px; padding-left: 1.4em; color: #D8D8E4; }

.content li { margin-bottom: 8px; }

.content strong { color: #fff; font-weight: 600; }

.content a {
  color: var(--acid);
  border-bottom: 1px solid rgba(232, 255, 58, .45);
  transition: background .18s, border-color .18s;
}

.content a:hover { background: rgba(232, 255, 58, .14); border-color: var(--acid); }

.content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--violet);
  border-radius: 0 var(--r) var(--r) 0;
  background: rgba(108, 123, 255, .1);
  color: #E4E4F2;
}

.content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 16px;
}

.content th, .content td {
  border: 1px solid var(--line-v);
  padding: 9px 12px;
  text-align: left;
}

.content th { background: rgba(108, 123, 255, .16); color: #fff; }

.content pre {
  overflow-x: auto;
  max-width: 100%;
  padding: 14px;
  border: 1px solid var(--line-v);
  border-radius: var(--r);
  background: #111118;
  font-family: var(--mono);
  font-size: 16px;
}

.content code { font-family: var(--mono); font-size: .95em; }

.content figure { margin: 0 0 18px; }

.content figure img { border: 1px solid var(--line-v); border-radius: var(--r); }

.content figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: var(--dim);
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 96px;
  min-width: 0;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(232, 255, 58, .07), rgba(14, 14, 18, 0) 58%);
}

.rail h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--acid);
  letter-spacing: .04em;
}

.rail .subtitle {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--dim);
  overflow-wrap: break-word;
}

.rail dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2em;
  gap: 0 8px;
  margin: 0;
}

.rail dt { grid-column: 1; border-top: 1px solid var(--hair); }

.rail dt a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: #DDDDEA;
  transition: color .18s, transform .18s;
}

.rail dt a:hover { color: var(--acid); transform: translateX(3px); }

.rail dd {
  grid-column: 2;
  align-self: center;
  margin: 0;
  border-top: 1px solid var(--hair);
  line-height: 42px;
  text-align: right;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--violet);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 48px;
  padding: 46px var(--pad) 24px;
  border-top: 1px solid var(--line-v);
  background: linear-gradient(180deg, rgba(108, 123, 255, .09), rgba(14, 14, 18, 0) 46%);
}

.foot-top {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr;
  gap: 36px;
  max-width: 1160px;
  margin: 0 auto;
}

.mark-sm {
  font-size: 17px;
  letter-spacing: .22em;
  padding-left: 0;
}

.sub {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  max-width: 340px;
}

.sub input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  background: #13131A;
  border: 1px solid var(--line-v);
  border-radius: 10px;
  font-size: 16px;
}

.sub input::placeholder { color: #7C7C93; }

.sub button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--acid);
  border-radius: 10px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 16px;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.sub button:hover { background: var(--acid); color: #0B0B0F; }

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.foot dl { margin: 0; min-width: 0; }

.foot dt a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: #CFCFDE;
  border-bottom: 1px solid var(--hair);
  overflow-wrap: break-word;
  transition: color .18s, padding-left .18s;
}

.foot dt a:hover { color: var(--acid); padding-left: 4px; }

.foot dd {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 16px;
  color: rgba(108, 123, 255, .85);
}

.copy {
  max-width: 1160px;
  margin: 34px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 16px;
  color: #8F8FA6;
  overflow-wrap: break-word;
}

/* ---------- 全屏菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 22px var(--pad) 48px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 8%, rgba(108, 123, 255, .24), transparent 58%),
    radial-gradient(circle at 6% 92%, rgba(232, 255, 58, .12), transparent 52%),
    var(--ink);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s, visibility .28s;
}

body.nav-open .drawer { opacity: 1; visibility: visible; }

body.nav-open { overflow: hidden; }

.drawer-in { max-width: 820px; margin: 0 auto; }

.drawer-close {
  display: block;
  margin-left: auto;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--acid);
  border-radius: 10px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 16px;
  cursor: pointer;
}

.drawer-close:hover { background: var(--acid); color: #0B0B0F; }

.drawer-search { margin: 26px 0 20px; max-width: none; }

.drawer-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-v);
}

.drawer-nav li { border-bottom: 1px solid var(--line-v); }

.drawer-nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 6px;
  min-height: 52px;
  color: var(--paper);
  font-size: clamp(1.15rem, 3.6vw, 1.6rem);
  font-weight: 500;
  transition: color .18s, transform .2s, background .2s;
}

.drawer-nav a:hover {
  color: var(--acid);
  transform: translateX(6px);
  background: rgba(232, 255, 58, .06);
}

.drawer-nav .no {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--violet);
  min-width: 2.4em;
}

/* 滚动显现 */
.js .content section {
  opacity: 0;
  transform: translateY(18px);
}

.js .content section.in {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .25, 1);
}

/* ---------- 断点 ---------- */
@media (max-width: 1000px) {
  .bar-nav { display: none; }
  .rail { position: static; }
  .stage { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
  }
  .mark {
    flex: 1 1 auto;
    justify-self: auto;
    font-size: 16px;
    letter-spacing: .12em;
    padding: 8px 4px;
  }
  .bar-tail { flex: 0 0 auto; gap: 6px; }
  .ico { padding: 0 12px; }
  .searchpane { top: 60px; padding: 12px var(--pad) 16px; }
  .search-form button { padding: 0 14px; }
  .hero {
    min-height: 62vh;
    align-items: flex-start;
    text-align: left;
    gap: 18px;
  }
  .hero::before { inset: -6% -10% 0 -6%; }
  .hero h1 { font-size: clamp(2.15rem, 10.4vw, 3.4rem); }
  .stage { padding: 34px 0 44px; }
  .foot { padding: 36px var(--pad) 20px; }
  .foot-top { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .copy { margin-top: 26px; font-size: 16px; }
  .content section { scroll-margin-top: 96px; }
}

@media (max-width: 420px) {
  .mark { letter-spacing: .06em; }
  .ico { padding: 0 10px; }
  .hero h1 { font-size: clamp(2rem, 11vw, 2.6rem); }
  .content { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 span { animation: none; }
  .badge { animation: none; }
  .js .content section { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}

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