@font-face {
  font-family: "Tansontech Serif";
  src: url("../fonts/NotoSerifNPHmong-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050812;
  --panel: #0b1220;
  --panel-2: #101827;
  --ink: #e6f3ff;
  --muted: #91a4b8;
  --line: rgba(98, 168, 255, .22);
  --cyan: #48a7ff;
  --mint: #7cc7ff;
  --amber: #b8ddff;
  --danger: #ff6b78;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 8%, rgba(51, 214, 255, .13), transparent 30%),
    linear-gradient(180deg, #050812 0%, #07101c 48%, #050812 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 211, 252, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, .07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(180deg, black 0%, transparent 80%);
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 18, .82);
  backdrop-filter: blur(16px);
}
.nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Tansontech Serif", Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  text-decoration: none;
}
.mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0)),
    conic-gradient(from 210deg, var(--mint), var(--cyan), #2f6dff, var(--mint));
  box-shadow: 0 0 22px rgba(72, 167, 255, .24);
}
.nav-links { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--cyan); }
.nav-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
}
.hero {
  position: relative;
  padding: 74px 0 36px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: end;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--amber); }
h1 {
  max-width: 920px;
  margin: 16px 0 18px;
  font-size: clamp(36px, 5.4vw, 70px);
  line-height: 1.03;
  letter-spacing: 0;
}
.lead {
  max-width: 840px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}
.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16,24,39,.88), rgba(7,16,28,.88));
  box-shadow: var(--shadow);
  padding: 20px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(125, 211, 252, .15);
  color: var(--muted);
  font-size: 14px;
}
.status-row:last-child { border-bottom: 0; }
.status-row strong { color: var(--ink); text-align: right; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(102, 240, 194, .24);
  border-radius: 6px;
  background: rgba(102, 240, 194, .08);
  color: var(--mint);
  font-size: 13px;
  font-weight: 800;
}
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 34px 0 74px;
}
.toc {
  position: sticky;
  top: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 32, .76);
  padding: 18px;
}
.toc h2 {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.toc a {
  display: block;
  padding: 8px 0;
  border-top: 1px solid rgba(125, 211, 252, .12);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover { color: var(--cyan); }
.article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 32, .88);
  box-shadow: var(--shadow);
  padding: min(5vw, 54px);
}
.article h2 {
  margin: 2.2em 0 .75em;
  padding-left: 14px;
  border-left: 4px solid var(--cyan);
  color: #f4fbff;
  font-size: 1.72rem;
  line-height: 1.28;
}
.article h2:first-child { margin-top: 0; }
.article section:first-child h2 { margin-top: 0; }
.article h3 {
  margin: 1.8em 0 .55em;
  color: #d9fbff;
  font-size: 1.28rem;
}
.article h4 {
  margin: 1.5em 0 .45em;
  color: var(--mint);
  font-size: 1.05rem;
}
.article p { margin: 0 0 1em; color: #c7d7e6; }
.article strong { color: #f5fbff; }
.article ul, .article ol { margin: 0 0 1.1em 1.35em; padding: 0; color: #c7d7e6; }
.article li { margin: .32em 0; }
.article table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #c7d7e6;
}
.article th, .article td {
  padding: 12px 14px;
  border: 1px solid rgba(125, 211, 252, .16);
  vertical-align: top;
}
.article th { background: rgba(51, 214, 255, .12); color: var(--ink); }
.article code {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(51, 214, 255, .10);
  color: var(--cyan);
}
.article pre {
  max-width: 100%;
  overflow-x: auto;
}
.article .note,
.article .warning,
.article .summary-card,
.article .formula {
  margin: 1.35rem 0;
  padding: 1rem 1.2rem;
  border-radius: 8px;
}
.article .note {
  border-left: 4px solid var(--cyan);
  background: rgba(72, 167, 255, .10);
}
.article .warning {
  border-left: 4px solid var(--danger);
  background: rgba(255, 107, 120, .09);
}
.article .summary-card {
  border: 1px solid var(--line);
  background: rgba(5, 8, 18, .54);
}
.article .formula {
  border: 1px solid rgba(125, 211, 252, .18);
  background: rgba(5, 8, 18, .72);
  color: #d9fbff;
  font-family: "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}
.article .matrix {
  font-size: .88rem;
  line-height: 1.65;
  white-space: pre;
}
.article .table-wrap {
  margin: 1.5em 0;
  overflow-x: auto;
}
.article .table-wrap table { margin: 0; }
.article .checklist { list-style: none; margin-left: 0; }
.article .checklist li { position: relative; padding-left: 1.8rem; }
.article .checklist li::before {
  position: absolute;
  left: 0;
  content: "✓";
  color: var(--mint);
  font-weight: 800;
}
.article .range-figure {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 18, .54);
}
.article .range-figure p { margin: .2rem 0 .45rem; font-size: .9rem; font-weight: 700; }
.article .range-bar {
  display: grid;
  height: 2rem;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 6px;
  color: white;
  font-size: .76rem;
  font-weight: 700;
  line-height: 2rem;
  text-align: center;
}
.article .range-bar.limited { grid-template-columns: 16fr 219fr 20fr; }
.article .range-bar.full { grid-template-columns: 1fr; }
.article .range-reserved { min-width: 1.6rem; color: #91a4b8; background: #1b2b3d; }
.article .range-active { background: linear-gradient(90deg, #172b36, #087ca3 55%, #bedee8); }
.article figure {
  margin: 1.8em 0;
  border: 1px solid rgba(125, 211, 252, .18);
  border-radius: 8px;
  background: rgba(5, 8, 18, .58);
  padding: 14px;
}
.article figure img, .article p img, .article div img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid rgba(125, 211, 252, .2);
}
.article figcaption, .caption {
  margin-top: .65em;
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
}
.missing-image {
  margin: 1.4em 0;
  padding: 18px;
  border: 1px dashed rgba(247, 185, 85, .42);
  border-radius: 8px;
  color: var(--amber);
  background: rgba(247, 185, 85, .07);
}
.article-index {
  padding: 44px 0 78px;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}
.note-card {
  min-height: 290px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16,24,39,.9), rgba(7,16,28,.9));
  padding: 24px;
  text-decoration: none;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .22);
}
.note-card:hover { border-color: rgba(51, 214, 255, .52); transform: translateY(-2px); }
.note-card small { color: var(--amber); font-weight: 700; }
.note-card h2 { margin: 16px 0 10px; font-size: 1.35rem; line-height: 1.25; }
.note-card p { margin: 0; color: var(--muted); }
.backline {
  padding: 0 0 34px;
}
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}
footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
}
@media (max-width: 920px) {
  .nav-links { display: none; }
  .hero-grid, .layout, .article-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 46px; }
  .toc { position: static; }
  .article { padding: 26px 20px; }
}
