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

:root {
  --bg: #000000;
  --surface: #121212;
  --line: #1e2531;
  --line-2: #2b3546;
  --ink: #eef2f8;
  --soft: #ccd5e3;
  --muted: #94a1b5;
  --accent: #4f7dff;
  --accent-soft: #9db8ff;
  --midnight: #0a1530;
  --radius: 4px;
  --maxw: 1180px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Rubik", "Nunito Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 540px;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0, var(--midnight) 0%, rgba(10, 21, 48, 0) 72%);
  opacity: .85;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

img {
  max-width: 100%;
}

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

/* ---------- 顶栏 ---------- */
.top-wrap {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tick {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  color: var(--muted);
  letter-spacing: .05em;
  border-bottom: 1px solid #0d121b;
  text-shadow: 0 0 10px rgba(79, 125, 255, .22);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  order: 2;
  min-width: 0;
}

.brand-name {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .02em;
  padding: 8px 2px;
  white-space: nowrap;
}

.brand-name:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(79, 125, 255, .55);
}

.logo-img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  object-fit: cover;
}

.menu {
  display: none;
}

.menu ol,
.anchorbar ol,
.rail-list,
.f-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.anchorbar {
  overflow-x: auto;
  scrollbar-width: none;
  background: #05070c;
  border-top: 1px solid var(--line);
}

.anchorbar::-webkit-scrollbar {
  display: none;
}

.anchorbar ol {
  display: flex;
  gap: 4px;
  padding: 4px 12px;
}

.anchorbar a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.anchorbar a:hover,
.anchorbar a.is-active {
  color: #fff;
  background: #0c1220;
  border-color: var(--line-2);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px 18px;
  display: grid;
  gap: 20px;
}

.hero-copy {
  text-align: center;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 5.4vw, 3rem);
  line-height: 1.26;
  letter-spacing: -.02em;
  text-shadow: 0 0 18px rgba(79, 125, 255, .3);
}

.lead {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--soft);
}

.hero-more {
  margin: 20px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: #dde8ff;
  background: linear-gradient(180deg, #111c33, #0a1220);
}

.btn:hover {
  background: #17274a;
  border-color: var(--accent-soft);
  color: #fff;
}

.hero-fig {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 340px;
  will-change: transform;
}

/* ---------- 正文骨架 ---------- */
.post {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 18px 56px;
  display: grid;
  gap: 24px;
}

.rail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.rail-h {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--muted);
}

.rail-h > span {
  display: inline-block;
}

.rail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rail-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rail-list a:hover,
.rail-list a.is-active {
  color: #fff;
  background: #0d1526;
  border-color: var(--accent);
}

.doc {
  min-width: 0;
  overflow-wrap: break-word;
}

.doc section {
  scroll-margin-top: 170px;
  padding: 26px 0 10px;
  border-top: 1px solid var(--line);
}

.doc section:first-child {
  padding-top: 0;
  border-top: 0;
}

.doc h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  line-height: 1.35;
  letter-spacing: -.01em;
}

.doc h2 > span,
.doc h3 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent);
}

.doc h3 {
  margin: 26px 0 10px;
  font-size: 1.16rem;
  line-height: 1.45;
}

.doc p {
  margin: 0 0 16px;
  color: var(--soft);
}

.doc ul,
.doc ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
  color: var(--soft);
}

.doc li {
  margin: 0 0 8px;
}

.doc strong {
  color: #fff;
}

.doc a {
  border-bottom: 1px solid var(--line-2);
}

.doc a:hover {
  color: #fff;
  border-color: var(--accent);
}

.doc blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 2px solid var(--accent);
  background: #0a0f1a;
  color: var(--soft);
}

.doc img {
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc th,
.doc td {
  padding: 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
}

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  background: #05070c;
}

.foot {
  display: grid;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px 34px;
  justify-items: center;
  text-align: center;
}

.f-brand a {
  color: var(--ink);
  font-weight: 600;
}

.f-brand a:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(79, 125, 255, .5);
}

.f-nav ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  color: var(--muted);
  border-radius: var(--radius);
}

.f-nav a:hover {
  color: #fff;
  background: #0e1522;
}

.f-meta {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.f-h {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--muted);
}

.f-h > span {
  display: inline-block;
}

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.sub-input {
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #0b0f18;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}

.sub-input::placeholder {
  color: var(--muted);
}

.sub-input:focus {
  border-color: var(--accent);
}

.sub-btn {
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  color: #dde8ff;
  background: #101c33;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
}

.sub-btn:hover {
  background: #18294a;
  color: #fff;
}

.copy {
  margin: 0;
  color: var(--muted);
}

.to-top-wrap {
  margin: 0;
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.to-top:hover {
  color: #fff;
  border-color: var(--accent);
}

/* ---------- 大屏 ---------- */
@media (min-width: 900px) {
  .bar {
    justify-content: space-between;
    padding: 8px 26px;
  }

  .menu {
    display: block;
    order: 1;
  }

  .menu-right {
    order: 3;
  }

  .menu ol {
    display: flex;
    gap: 2px;
  }

  .menu a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: var(--soft);
    border-radius: var(--radius);
  }

  .menu a:hover {
    color: #fff;
    background: #101827;
  }

  .anchorbar ol {
    justify-content: center;
    padding: 5px 20px;
  }

  .hero {
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 38px;
    min-height: 45vh;
    padding: 46px 28px 38px;
  }

  .hero-fig {
    order: 2;
  }

  .post {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 44px;
    padding: 36px 28px 72px;
  }

  .rail {
    position: sticky;
    top: 136px;
    align-self: start;
    padding: 18px;
  }

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

  .rail-list a {
    width: 100%;
    padding: 0 10px;
    border: 0;
    border-left: 2px solid var(--line-2);
    border-radius: 0;
  }

  .rail-list a:hover,
  .rail-list a.is-active {
    background: #0b1220;
    border-left-color: var(--accent);
  }

  .foot {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 28px;
    padding: 30px 28px 38px;
  }

  .f-brand {
    justify-self: start;
  }

  .f-nav {
    justify-self: center;
  }

  .f-meta {
    justify-self: end;
    justify-items: end;
  }

  .doc section {
    scroll-margin-top: 150px;
  }
}

@media (max-width: 640px) {
  .doc table {
    display: block;
    overflow-x: auto;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: .001s !important;
    animation-duration: .001s !important;
  }
}

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