:root {
  color-scheme: dark;
  --bg: #0c0f15;
  --panel: #121720;
  --raised: #1a202b;
  --line: #2a313e;
  --ink: #f0f2f6;
  --muted: #a6afbf;
  --gold: #f4bf5c;
  --gold-hover: #ffda8a;
  --radius: 8px;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shell: min(1152px, calc(100% - 64px));
  --site-font: "Geist", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-family: var(--site-font);
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; line-height: 1.6; font-size: .95rem; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p, figure, dl { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { color: var(--bg); background: var(--gold); }

.wrap { width: var(--shell); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; z-index: 2; inset: 8px auto auto 8px; padding: .6rem 1rem; background: var(--bg); transform: translateY(-160%); }
.skip:focus { transform: none; }
.page-main { flex: 1; padding-block: 28px 45px; }
section[id] { scroll-margin-top: 20px; }

.masthead { border-bottom: 1px solid var(--line); color: var(--ink); background: #0e1118; font: .95rem/1.6 var(--site-font); }
.nav { display: flex; min-height: 60px; align-items: center; gap: 39px; }
.nav a { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.04rem; font-weight: 850; letter-spacing: .04em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 1px solid #644d2c;
  border-radius: 5px;
  color: var(--gold);
  background: #251f19;
  font: 700 .9rem var(--mono);
  letter-spacing: -.09em;
}
.nav nav { display: flex; align-self: stretch; gap: 27px; color: var(--muted); font-size: .87rem; }
.nav nav a { position: relative; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.nav nav a[aria-current], .nav nav .parent-link, .nav nav a:hover { color: var(--gold); }
.nav nav a[aria-current]::after, .nav nav .parent-link::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  content: "";
  background: var(--gold);
}
.nav nav span { font: .78rem var(--mono); }
.nav a.language {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 11px;
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}
.nav a.language:hover { color: var(--gold); border-color: #644d2c; }

@media (max-width: 880px) {
  :root { --shell: calc(100% - 44px); }
}
@media (max-width: 670px) {
  :root { --shell: calc(100% - 32px); }
  .nav { min-height: 52px; gap: 17px; }
  .page-main { padding-block: 16px 29px; }
}
@media (max-width: 800px) {
  .nav-with-menu { display: grid; grid-template-columns: 1fr auto; row-gap: 0; padding-top: 9px; }
  .nav-with-menu nav { grid-column: 1 / -1; grid-row: 2; flex-wrap: wrap; gap: 0 13px; min-height: 39px; font-size: .81rem; }
  .nav-with-menu nav a { min-height: 36px; }
  .nav-with-menu a.language { justify-self: end; }
}

.shell-notice {
  display: grid;
  gap: .85rem;
  width: min(100%, 42rem);
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.shell-notice h1 { font-size: clamp(1.35rem, 5vw, 1.8rem); }
.shell-notice a { color: var(--gold); }
.shell-notice a + a { margin-left: .8rem; }
.shell-notice button {
  padding: .5rem .9rem;
  border: 0;
  border-radius: 5px;
  background: var(--gold);
  color: #161007;
  font-weight: 700;
  cursor: pointer;
}
.shell-notice button:hover { background: var(--gold-hover); }
