:root {
  color-scheme: dark;
  --page: #07090f;
  --page-soft: #0c1019;
  --panel: rgba(14, 19, 30, 0.78);
  --text: #eef3f8;
  --muted: #9ca9b8;
  --line: rgba(150, 178, 205, 0.18);
  --cyan: #69e9ff;
  --magenta: #ff72c7;
  --green: #7af0ac;
  --yellow: #ffd56a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(111, 218, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 218, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 72% 12%, rgba(68, 119, 255, 0.12), transparent 31%),
    radial-gradient(circle at 13% 34%, rgba(255, 87, 188, 0.07), transparent 25%),
    var(--page);
  background-size: 56px 56px, 56px 56px, auto, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.82;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.reading-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green) 45%, var(--magenta));
  box-shadow: 0 0 14px rgba(105, 233, 255, 0.68);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 58px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(154, 201, 228, 0.14);
  background: rgba(7, 9, 15, 0.84);
  backdrop-filter: blur(18px) saturate(1.2);
}

.reader-home,
.reader-source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: #c8d4df;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease;
}

.reader-home:hover,
.reader-source:hover {
  color: var(--cyan);
}

.reader-source {
  justify-self: end;
}

.reader-id {
  color: rgba(204, 222, 238, 0.54);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

main {
  overflow: clip;
}

.article-hero {
  position: relative;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0 72px;
}

.article-hero::before {
  content: "";
  position: absolute;
  top: 70px;
  right: -12vw;
  width: 46vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105, 233, 255, 0.74), transparent);
  box-shadow: 0 0 18px rgba(105, 233, 255, 0.32);
}

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.article-eyebrow span {
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.article-hero h1 {
  max-width: 960px;
  margin: 0;
  color: #fff;
  font-size: 64px;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 16px 52px rgba(0, 0, 0, 0.58), 0 0 34px rgba(95, 180, 255, 0.1);
}

.article-deck {
  max-width: 780px;
  margin: 28px 0 0;
  color: #b8c4d0;
  font-size: 20px;
  line-height: 1.7;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.article-tags li {
  padding: 5px 10px;
  border: 1px solid rgba(114, 231, 255, 0.22);
  border-radius: 4px;
  color: #aebbc7;
  background: rgba(17, 25, 38, 0.64);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.article-tags li:nth-child(2n) {
  border-color: rgba(255, 114, 199, 0.22);
}

.article-tags li:nth-child(3n) {
  border-color: rgba(122, 240, 172, 0.22);
}

.article-cover {
  position: relative;
  margin: 64px 0 0;
}

.article-cover::before,
.article-cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 74px;
  height: 2px;
  pointer-events: none;
}

.article-cover::before {
  top: -1px;
  left: 26px;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(105, 233, 255, 0.72);
}

.article-cover::after {
  right: 26px;
  bottom: -1px;
  background: var(--magenta);
  box-shadow: 0 0 16px rgba(255, 114, 199, 0.64);
}

.article-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.6;
  border: 1px solid rgba(154, 201, 228, 0.2);
  border-radius: 6px;
  object-fit: cover;
  background: #090d15;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.5);
}

.article-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  gap: 76px;
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0 120px;
}

.article-toc {
  align-self: start;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 124px);
  overflow: auto;
  scrollbar-width: thin;
}

.article-toc > p {
  margin: 0 0 18px;
  color: rgba(105, 233, 255, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.article-toc nav {
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.article-toc a {
  position: relative;
  display: block;
  padding: 7px 0 7px 16px;
  color: #718092;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.article-toc a::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -1px;
  width: 2px;
  background: transparent;
}

.article-toc a:hover,
.article-toc a.is-current {
  color: #dce8f2;
  transform: translateX(3px);
}

.article-toc a.is-current::before {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(105, 233, 255, 0.62);
}

.article-toc .toc-level-3 {
  padding-left: 28px;
  color: #627083;
}

.article-body {
  min-width: 0;
  color: #c7d0da;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  scroll-margin-top: 94px;
  color: #f8fbff;
  letter-spacing: 0;
  text-wrap: balance;
}

.article-body h2 {
  position: relative;
  margin: 84px 0 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 34px;
  line-height: 1.35;
}

.article-body h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 12px rgba(105, 233, 255, 0.45);
}

.article-body h3 {
  margin: 58px 0 20px;
  color: #e7edf4;
  font-size: 25px;
  line-height: 1.45;
}

.article-body p {
  margin: 0 0 26px;
}

.article-body strong {
  color: #fff;
  font-weight: 760;
}

.article-body a {
  color: var(--cyan);
  text-decoration-color: rgba(105, 233, 255, 0.38);
  text-underline-offset: 4px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 30px;
  padding-left: 1.4em;
}

.article-body li {
  margin: 10px 0;
  padding-left: 6px;
}

.article-body li::marker {
  color: var(--cyan);
  font-weight: 800;
}

.article-body blockquote {
  position: relative;
  margin: 38px 0;
  padding: 24px 30px;
  border-left: 2px solid var(--magenta);
  background: linear-gradient(90deg, rgba(255, 114, 199, 0.09), rgba(105, 233, 255, 0.035));
  color: #e5eaf0;
  font-size: 20px;
  line-height: 1.72;
}

.article-body blockquote::after {
  content: "SIGNAL / NOTE";
  position: absolute;
  top: 8px;
  right: 12px;
  color: rgba(255, 255, 255, 0.17);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}

.article-body blockquote p {
  margin: 0;
}

.article-body figure {
  margin: 54px 0 48px;
}

.article-body figure img {
  display: block;
  width: 100%;
  border: 1px solid rgba(148, 194, 220, 0.2);
  border-radius: 6px;
  background: #090d15;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.4);
}

.article-body figcaption {
  margin-top: 14px;
  color: #758395;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.article-body code {
  padding: 2px 6px;
  border: 1px solid rgba(105, 233, 255, 0.14);
  border-radius: 4px;
  color: #c7f7ff;
  background: rgba(7, 17, 26, 0.86);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.article-body pre {
  margin: 34px 0;
  padding: 22px;
  overflow: auto;
  border: 1px solid rgba(105, 233, 255, 0.16);
  border-radius: 6px;
  background: #080c13;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.table-scroll {
  margin: 42px 0;
  overflow-x: auto;
  border-top: 1px solid rgba(105, 233, 255, 0.3);
  border-bottom: 1px solid var(--line);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 14px;
  line-height: 1.6;
}

.article-body th,
.article-body td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  color: var(--cyan);
  background: rgba(105, 233, 255, 0.045);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.article-body tr:last-child td {
  border-bottom: 0;
}

.reader-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  width: min(1060px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 54px;
  border-top: 1px solid var(--line);
  color: #748295;
  font-size: 13px;
}

.reader-footer p {
  margin: 0;
}

.reader-footer a {
  color: #d7e5ef;
  font-weight: 700;
  text-decoration: none;
}

.reader-footer a:hover {
  color: var(--cyan);
}

@media (max-width: 900px) {
  .article-hero h1 {
    font-size: 48px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    width: min(760px, calc(100% - 40px));
    padding-top: 60px;
  }

  .article-toc {
    position: static;
    max-height: none;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .article-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
  }

  .article-toc a {
    padding-left: 0;
  }

  .article-toc a::before {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .reader-bar {
    grid-template-columns: 1fr auto;
    min-height: 54px;
    padding: 0 18px;
  }

  .reader-id {
    display: none;
  }

  .reader-source {
    font-size: 12px;
  }

  .article-hero {
    width: calc(100% - 36px);
    padding: 62px 0 48px;
  }

  .article-eyebrow {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
  }

  .article-eyebrow span {
    width: 14px;
  }

  .article-hero h1 {
    font-size: 39px;
    line-height: 1.18;
  }

  .article-deck {
    margin-top: 22px;
    font-size: 17px;
  }

  .article-cover {
    margin-top: 42px;
  }

  .article-cover img {
    aspect-ratio: 4 / 3;
  }

  .article-layout {
    width: calc(100% - 36px);
    padding: 48px 0 84px;
  }

  .article-toc nav {
    grid-template-columns: 1fr;
  }

  .article-toc .toc-level-3 {
    padding-left: 14px;
  }

  .article-body h2 {
    margin-top: 64px;
    font-size: 28px;
  }

  .article-body h3 {
    margin-top: 44px;
    font-size: 22px;
  }

  .article-body blockquote {
    padding: 24px 20px;
    font-size: 18px;
  }

  .article-body figure {
    margin: 42px -4px 38px;
  }

  .reader-footer {
    display: grid;
    width: calc(100% - 36px);
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
