/* ============================================================
   诺亚看台 · 共享站点层 /assets/site.css
   夜间赛场指挥屏：深空蓝网格底 + 记分牌堆叠面板
   ============================================================ */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 8rem;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

hr { border: 0; }

/* ---------- 2. Tokens ---------- */
:root {
  /* 品牌色 */
  --nx-deep:   #081022;
  --nx-night:  #101E3C;
  --nx-stand:  #1C3766;
  --nx-cyan:   #45E6E6;
  --nx-lava:   #FF5C24;
  --nx-signal: #F4F7FF;
  --nx-mist:   #9DAECB;
  --nx-ink:    #040912;
  --nx-paper:  #E8EDF5;
  --nx-warn:   #FFC857;

  /* 线与透明层 */
  --nx-line:      rgba(69, 230, 230, .16);
  --nx-line-soft: rgba(157, 174, 203, .22);
  --nx-glow:      rgba(69, 230, 230, .08);

  /* 尺度 */
  --nx-max: 1320px;
  --nx-gutter: clamp(1rem, 3.6vw, 2.75rem);
  --nx-radius: 2px;
  --nx-gap: clamp(1rem, 2.2vw, 1.75rem);
  --nx-ease: cubic-bezier(.22, .61, .36, 1);

  /* 字体栈 */
  --nx-font-display: "Barlow Condensed", "Oswald", "DIN Condensed",
                     "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
                     "Microsoft YaHei", sans-serif;
  --nx-font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
                  "Microsoft YaHei", system-ui, -apple-system, "Segoe UI",
                  Roboto, sans-serif;
  --nx-font-num: "DIN Condensed", "Barlow Condensed", "Oswald",
                 "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

/* ---------- 3. Base ---------- */
html:focus-within { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--nx-deep);
  background-image:
    repeating-linear-gradient(to right, rgba(69, 230, 230, .045) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(to bottom, rgba(69, 230, 230, .045) 0 1px, transparent 1px 88px);
  background-attachment: fixed;
  color: var(--nx-signal);
  font-family: var(--nx-font-body);
  font-size: clamp(15px, .32vw + 14.2px, 17px);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-display);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.015em;
  color: var(--nx-signal);
  text-wrap: balance;
}

p { text-wrap: pretty; }

strong { font-weight: 700; color: var(--nx-signal); }

::selection {
  background: var(--nx-lava);
  color: var(--nx-ink);
}

[id] { scroll-margin-top: 7.5rem; }

:focus-visible {
  outline: 2px solid var(--nx-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

.nx-skip {
  position: absolute;
  left: 1rem;
  top: -6rem;
  z-index: 240;
  padding: .62rem 1.1rem;
  background: var(--nx-cyan);
  color: #06131F;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
  border-radius: var(--nx-radius);
  transition: top .22s var(--nx-ease);
}

.nx-skip:focus { top: .55rem; }

/* ---------- 4. Shell / Layout utilities ---------- */
.nx-shell {
  width: 100%;
  max-width: var(--nx-max);
  margin-inline: auto;
  padding-inline: var(--nx-gutter);
}

.nx-section { padding-block: clamp(2.25rem, 5.5vw, 4.5rem); }
.nx-section--tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }

.nx-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--nx-line);
}

.nx-section__title {
  font-size: clamp(1.55rem, 3.4vw, 2.6rem);
  letter-spacing: -.02em;
}

.nx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}

.nx-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--nx-lava);
  flex: 0 0 auto;
}

.nx-muted { color: var(--nx-mist); }

#main-content {
  display: block;
  padding-bottom: clamp(2rem, 6vw, 4.5rem);
}

/* 网格 */
.nx-grid {
  display: grid;
  gap: var(--nx-gap);
}

.nx-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nx-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nx-grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.nx-grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* ---------- 5. Panels / materials ---------- */
.nx-panel {
  position: relative;
  background: var(--nx-night);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
  padding: clamp(1.15rem, 2.6vw, 2rem);
}

.nx-panel--stand {
  background: var(--nx-stand);
  border-color: rgba(69, 230, 230, .22);
}

.nx-panel--paper {
  background: var(--nx-paper);
  border-color: #C3CFE1;
  color: #16233A;
}

.nx-panel--paper h1,
.nx-panel--paper h2,
.nx-panel--paper h3,
.nx-panel--paper h4,
.nx-panel--paper strong { color: #0B1526; }

.nx-panel--paper .nx-muted { color: #4E5F7A; }

.nx-stack {
  box-shadow:
    9px 9px 0 rgba(28, 55, 102, .62),
    9px 9px 0 1px rgba(69, 230, 230, .16);
}

/* 扫描光效 */
.nx-scan { position: relative; overflow: hidden; }

.nx-scan::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(69, 230, 230, .85), transparent);
  transform: translateY(-6px);
  animation: nx-scan 4.2s var(--nx-ease) infinite;
  pointer-events: none;
}

@keyframes nx-scan {
  0%   { transform: translateY(-6px); opacity: 0; }
  12%  { opacity: .9; }
  82%  { opacity: .9; }
  100% { transform: translateY(240px); opacity: 0; }
}

/* ---------- 6. Text / numeric / tags ---------- */
.nx-num {
  font-family: var(--nx-font-num);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: .86;
  color: var(--nx-lava);
}

.nx-tag {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .2rem .55rem;
  font-family: var(--nx-font-body);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nx-cyan);
  background: rgba(69, 230, 230, .08);
  border: 1px solid rgba(69, 230, 230, .42);
  border-radius: var(--nx-radius);
  white-space: nowrap;
}

.nx-tag--lava {
  color: #FFB399;
  background: rgba(255, 92, 36, .12);
  border-color: rgba(255, 92, 36, .5);
}

.nx-tag--warn {
  color: #2A1D00;
  background: var(--nx-warn);
  border-color: var(--nx-warn);
}

.nx-tag--paper {
  color: #1C3766;
  background: #FFFFFF;
  border-color: #B9C6DA;
}

/* ---------- 7. Buttons ---------- */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.25rem;
  font-family: var(--nx-font-display);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.1;
  text-transform: uppercase;
  color: #0A0F1C;
  background: var(--nx-signal);
  border: 1px solid transparent;
  border-radius: var(--nx-radius);
  clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
  transition: transform .2s var(--nx-ease), background-color .2s, color .2s, box-shadow .2s;
}

.nx-btn:hover { transform: translateY(-1px); }
.nx-btn:active { transform: translateY(0); }

.nx-btn:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--nx-cyan);
}

.nx-btn--lava { background: var(--nx-lava); color: #0A0F1C; }
.nx-btn--lava:hover { background: #FF7442; }

.nx-btn--cyan { background: var(--nx-cyan); color: #06131F; }
.nx-btn--cyan:hover { background: #6FF1F1; }

.nx-btn--ghost {
  background: transparent;
  color: var(--nx-signal);
  border-color: rgba(244, 247, 255, .34);
}
.nx-btn--ghost:hover {
  border-color: var(--nx-cyan);
  color: var(--nx-cyan);
}

.nx-btn--sm {
  padding: .5rem .85rem;
  font-size: .82rem;
  letter-spacing: .05em;
}

/* ---------- 8. Breadcrumbs ---------- */
.nx-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .1rem;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nx-mist);
}

.nx-crumbs li { display: inline-flex; align-items: center; }

.nx-crumbs li + li::before {
  content: "/";
  margin: 0 .55rem;
  color: rgba(157, 174, 203, .5);
}

.nx-crumbs a { color: var(--nx-mist); transition: color .2s; }
.nx-crumbs a:hover { color: var(--nx-cyan); }
.nx-crumbs [aria-current="page"] { color: var(--nx-signal); }

/* ---------- 9. Media containers ---------- */
.nx-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--nx-stand);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius);
}

.nx-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.nx-media--wide { aspect-ratio: 21 / 9; }
.nx-media--tall { aspect-ratio: 3 / 4; }
.nx-media--square { aspect-ratio: 1 / 1; }

.nx-media--cut {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 0 100%);
  border: 0;
}

.nx-media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .35rem;
  text-align: center;
  padding: 1rem;
  background:
    repeating-linear-gradient(to right, rgba(69, 230, 230, .1) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(to bottom, rgba(69, 230, 230, .1) 0 1px, transparent 1px 32px),
    var(--nx-stand);
  color: var(--nx-mist);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.nx-media__caption {
  margin-top: .55rem;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--nx-mist);
}

/* ---------- 10. Chapter TOC ---------- */
.nx-toc {
  position: sticky;
  top: 7.5rem;
  align-self: start;
}

.nx-toc__title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--nx-mist);
  margin-bottom: .65rem;
}

.nx-toc__list {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--nx-line);
}

.nx-toc__list a {
  display: block;
  margin-left: -1px;
  padding: .42rem .8rem;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--nx-mist);
  border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, background-color .2s;
}

.nx-toc__list a:hover {
  color: var(--nx-signal);
  background: rgba(28, 55, 102, .5);
}

.nx-toc__list a[aria-current="location"] {
  color: var(--nx-cyan);
  border-left-color: var(--nx-lava);
  background: var(--nx-glow);
}

/* ---------- 11. Header ---------- */
.nx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nx-deep);
  border-bottom: 1px solid var(--nx-line);
}

/* 11.1 上层：品牌通道条 */
.nx-topbar {
  background: var(--nx-ink);
  border-bottom: 1px solid rgba(69, 230, 230, .12);
}

.nx-topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .3rem 1.5rem;
  min-height: 34px;
  padding-block: .32rem;
}

.nx-topbar__brand {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--nx-cyan);
  white-space: nowrap;
}

.nx-topbar__note {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--nx-mist);
}

.nx-topbar__pulse {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nx-warn);
  animation: nx-pulse 2.6s ease-out infinite;
}

@keyframes nx-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 200, 87, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 200, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 200, 87, 0); }
}

/* 11.2 下层：品牌 + 栏目通道 */
.nx-navbar { position: relative; }

.nx-navbar__inner {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.75rem);
  min-height: 68px;
  padding-block: .55rem;
}

.nx-brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  flex: 0 0 auto;
}

.nx-brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  font-family: var(--nx-font-display);
  font-size: 1.15rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.04em;
  color: #100A05;
  background: var(--nx-lava);
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}

.nx-brand__text {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  line-height: 1;
}

.nx-brand__name {
  font-family: var(--nx-font-display);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--nx-signal);
}

.nx-brand__sub {
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--nx-mist);
}

.nx-brand:hover .nx-brand__sub { color: var(--nx-cyan); }

/* 11.3 导航 */
.nx-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nx-nav__list {
  display: flex;
  align-items: center;
  gap: .1rem;
}

.nx-nav__list a {
  display: block;
  padding: .55rem .62rem;
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--nx-mist);
  border-left: 2px solid transparent;
  border-radius: 0 var(--nx-radius) var(--nx-radius) 0;
  transition: color .2s, background-color .2s, border-color .2s;
}

.nx-nav__list a:hover {
  color: var(--nx-signal);
  background: rgba(28, 55, 102, .62);
}

.nx-nav__list a[aria-current="page"] {
  color: var(--nx-signal);
  border-left-color: var(--nx-lava);
  background: rgba(255, 92, 36, .1);
}

.nx-nav__cta { flex: 0 0 auto; }

/* 11.4 移动端切换按钮 */
.nx-nav-toggle {
  display: none;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
  padding: .5rem .75rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--nx-signal);
  background: rgba(28, 55, 102, .5);
  border: 1px solid rgba(69, 230, 230, .38);
  border-radius: var(--nx-radius);
}

.nx-nav-toggle__bars {
  display: grid;
  gap: 3px;
  width: 16px;
}

.nx-nav-toggle__bars span {
  display: block;
  height: 2px;
  background: var(--nx-cyan);
  transition: transform .26s var(--nx-ease), opacity .18s linear;
}

.nx-header[data-open] .nx-nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nx-header[data-open] .nx-nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nx-header[data-open] .nx-nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nx-header[data-open] .nx-nav-toggle {
  border-color: var(--nx-cyan);
  color: var(--nx-cyan);
}

/* 11.5 中屏：导航换行成第二排 */
@media (max-width: 1120px) and (min-width: 960px) {
  .nx-navbar__inner { flex-wrap: wrap; }
  .nx-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: .35rem;
    border-top: 1px solid var(--nx-line);
    justify-content: space-between;
  }
}

/* 11.6 移动端：下拉看板 */
@media (max-width: 959px) {
  .nx-nav-toggle { display: inline-flex; }

  .nx-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: .9rem;
    margin-left: 0;
    padding: .9rem var(--nx-gutter) 1.4rem;
    background: var(--nx-night);
    border-top: 1px solid var(--nx-line);
    border-bottom: 2px solid var(--nx-lava);
    box-shadow: 0 22px 44px rgba(4, 9, 18, .68);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
  }

  .nx-header[data-open] .nx-nav { display: flex; }

  .nx-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .12rem;
  }

  .nx-nav__list a {
    padding: .72rem .8rem;
    font-size: .95rem;
    border-left-width: 3px;
    border-radius: 0 var(--nx-radius) var(--nx-radius) 0;
  }

  .nx-nav__cta {
    width: 100%;
    clip-path: none;
    padding-block: .72rem;
  }
}

/* ---------- 12. Footer ---------- */
.nx-footer {
  position: relative;
  margin-top: clamp(2rem, 6vw, 4rem);
  padding-block: clamp(2.25rem, 5vw, 3.5rem) 1.25rem;
  background: var(--nx-ink);
  border-top: 1px solid var(--nx-line);
  color: var(--nx-mist);
}

.nx-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--nx-lava) 0 42px,
    var(--nx-cyan) 42px 84px,
    transparent 84px 126px
  );
  opacity: .8;
}

.nx-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.nx-footer__brandcol { min-width: 0; }

.nx-brand--footer { margin-bottom: .9rem; }

.nx-brand--footer .nx-brand__mark {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.nx-brand--footer .nx-brand__name { font-size: 1.05rem; }

.nx-footer__line {
  font-size: .86rem;
  color: var(--nx-signal);
  letter-spacing: .02em;
}

.nx-footer__region {
  margin-top: .55rem;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--nx-mist);
  max-width: 30ch;
}

.nx-footer__title {
  font-family: var(--nx-font-display);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}

.nx-footer__links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .1rem .85rem;
  margin-top: .8rem;
}

.nx-footer__links a {
  display: inline-block;
  padding: .3rem 0;
  font-size: .85rem;
  color: var(--nx-mist);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}

.nx-footer__links a:hover {
  color: var(--nx-cyan);
  border-bottom-color: rgba(69, 230, 230, .55);
}

.nx-contact {
  display: grid;
  gap: .7rem;
  margin-top: .8rem;
}

.nx-contact li {
  display: grid;
  gap: .12rem;
  padding-left: .8rem;
  border-left: 2px solid rgba(69, 230, 230, .32);
}

.nx-contact__k {
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--nx-cyan);
}

.nx-contact__v {
  font-size: .86rem;
  color: var(--nx-signal);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.nx-footer__note {
  margin-top: .85rem;
  font-size: .74rem;
  line-height: 1.7;
  color: rgba(157, 174, 203, .85);
}

.nx-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1.5rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(157, 174, 203, .18);
}

.nx-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1rem;
}

.nx-legal a {
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--nx-mist);
  transition: color .2s;
}

.nx-legal a:hover { color: var(--nx-cyan); }

.nx-footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.1rem;
  font-size: .74rem;
  letter-spacing: .06em;
  color: rgba(157, 174, 203, .8);
}

.nx-footer__icp {
  padding: .1rem .45rem;
  border: 1px solid rgba(157, 174, 203, .3);
  border-radius: var(--nx-radius);
}

.nx-footer__copy { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .nx-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-footer__contact { grid-column: 1 / -1; }
  .nx-footer__region { max-width: none; }
}

@media (max-width: 620px) {
  .nx-footer__grid { grid-template-columns: minmax(0, 1fr); }
  .nx-footer__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- 13. JS 注入组件 ---------- */
.nx-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: 3px;
  background: var(--nx-lava);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
  transition: transform .12s linear;
}

.nx-backtop {
  position: fixed;
  right: clamp(.75rem, 3vw, 1.75rem);
  bottom: clamp(.75rem, 3vw, 1.75rem);
  z-index: 180;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem .9rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nx-signal);
  background: rgba(16, 30, 60, .94);
  border: 1px solid rgba(69, 230, 230, .45);
  border-radius: var(--nx-radius);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .26s var(--nx-ease), transform .26s var(--nx-ease), visibility .26s;
}

.nx-backtop:hover {
  border-color: var(--nx-cyan);
  color: var(--nx-cyan);
}

.nx-backtop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 显现动画 */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .44s var(--nx-ease), transform .44s var(--nx-ease);
}

.has-js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 14. Responsive grid ---------- */
@media (max-width: 980px) {
  .nx-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nx-grid--2,
  .nx-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .nx-grid--12 { grid-template-columns: minmax(0, 1fr); }
  .nx-toc {
    position: static;
    margin-bottom: 1.25rem;
  }
  .nx-toc__list {
    flex-direction: row;
    flex-wrap: wrap;
    border-left: 0;
    gap: .35rem;
  }
  .nx-toc__list a {
    margin-left: 0;
    padding: .3rem .6rem;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
  }
  .nx-toc__list a[aria-current="location"] {
    border-color: var(--nx-cyan);
    background: var(--nx-glow);
  }
}

/* ---------- 15. Motion / contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html:focus-within { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .nx-scan::after { display: none; }
  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --nx-mist: #C6D3E8;
    --nx-line: rgba(69, 230, 230, .38);
  }
}
