/* VulWiki's presentation layer. Markdown and hash routes remain owned by Docsify. */
:root {
  color-scheme: light;
  --theme-color: #187553;
  --bg: #ffffff;
  --sidebar-bg: #f4f6f4;
  --surface: #edf2ef;
  --toolbar: rgba(255, 255, 255, .92);
  --text: #29332f;
  --heading: #17251e;
  --muted: #5f7067;
  --line: #d9e2dc;
  --hover: #e8f1eb;
  --selected: #e1f3e9;
  --code: #f4f6f4;
  --sidebar-width: 280px;
  --blog-nav-height: 24px;
  --toolbar-height: 58px;
  --header-height: calc(var(--blog-nav-height) + var(--toolbar-height));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-color: #2bbc8a;
  --bg: #000000;
  --sidebar-bg: #090c0b;
  --surface: #151b18;
  --toolbar: rgba(0, 0, 0, .96);
  --text: #d1d8d4;
  --heading: #f2f5f3;
  --muted: #93a299;
  --line: #27342c;
  --hover: #131e18;
  --selected: #112d21;
  --code: #080d0a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.8 "Fira Code", "PingFang SC", "Microsoft YaHei", Monaco, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: var(--theme-color); }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--theme-color);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 80px; z-index: 50; background: var(--bg); padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.wiki-header {
  position: fixed; inset: var(--blog-nav-height) 0 auto; height: var(--toolbar-height); z-index: 30;
  display: flex; align-items: center; gap: 28px; padding: 0 24px 0 64px;
  background: var(--toolbar); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.wiki-brand { display: flex; align-items: baseline; gap: 12px; color: var(--heading); text-decoration: none; flex-shrink: 0; font: 24px/1 DOS, monospace; }
.wiki-brand small { font: 11px/1.5 "PingFang SC", sans-serif; letter-spacing: 1px; color: var(--muted); }
.wiki-cursor { color: var(--theme-color); }
.wiki-topnav { position: static; display: flex; gap: 22px; margin: 0 0 0 25px; }
.wiki-topnav a, .wiki-github { font-size: 13px; text-decoration: none; color: var(--muted); white-space: nowrap; }
.wiki-topnav a:hover, .wiki-topnav a[aria-current], .wiki-github:hover { color: var(--theme-color); }
.wiki-tools { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.wiki-theme { flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 3px; color: var(--text); background: var(--bg); font-size: 21px; line-height: 1; }
.wiki-theme:hover { background: var(--hover); }
body .sidebar {
  top: var(--header-height); bottom: 0; left: 0; width: var(--sidebar-width); padding: 18px 14px 40px;
  background: var(--sidebar-bg); border-right: 1px solid var(--line); color: var(--text);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain;
}
.sidebar > h1 { font-size: 11px; font-weight: 600; text-align: left; margin: 22px 12px 10px; letter-spacing: 1.5px; color: var(--muted); }
.sidebar > h1 a { color: inherit; }
.sidebar .search { margin: 0 0 18px; padding: 0; border: 0; }
.sidebar .search .input-wrap { align-items: center; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); padding: 2px 8px; }
.sidebar .search input { color: var(--text); background: transparent; font-size: 12px; min-height: 38px; padding: 8px 3px; }
.sidebar .search input::placeholder { color: var(--muted); }
.sidebar .search input:focus { box-shadow: none; }
.sidebar .search .input-wrap:focus-within { outline: 2px solid var(--theme-color); outline-offset: 2px; }
.sidebar .search .clear-button { color: var(--muted); width: 24px; }
.sidebar .search svg { fill: currentColor; width: 20px; height: 20px; }
.sidebar .search .matching-post { border-bottom: 1px solid var(--line); }
.sidebar .search h2 { font-size: 13px; line-height: 1.6; color: var(--heading); }
.sidebar .search p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.sidebar .search a { color: var(--text); }
.sidebar .search .search-keyword { background: var(--selected); color: var(--theme-color); }
.sidebar-nav { line-height: 1.6; padding: 0; }
.sidebar ul { margin: 0; padding: 0; }
.sidebar ul li { margin: 2px 0; padding: 0; line-height: 1.6; }
.sidebar-nav > ul > li { margin-bottom: 5px; }
.sidebar ul ul { margin-left: 13px; padding-left: 9px; border-left: 1px solid var(--line); }
.sidebar ul li a { display: block; color: var(--muted); font-size: 12px; padding: 7px 9px; border-radius: 3px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.sidebar ul li a:hover { text-decoration: none; background: var(--hover); color: var(--heading); }
.sidebar ul li.active > a { color: var(--theme-color); border-right: 0; background: var(--selected); font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
.wiki-folder-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent;
  text-align: left; color: var(--text); padding: 8px 9px; border-radius: 3px; font-size: 12px; font-weight: 600; line-height: 1.5;
}
.wiki-folder-toggle::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted); transform: rotate(45deg); flex: 0 0 6px; margin-right: 2px; transition: transform .15s; }
.wiki-folder-toggle[aria-expanded="true"]::before { transform: rotate(135deg); }
.wiki-folder-toggle:hover { background: var(--hover); }
.wiki-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-folder-count { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.wiki-tree-heading { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; padding: 18px 9px 8px; border-top: 1px solid var(--line); margin-top: 18px; }
.wiki-tree-heading button { background: transparent; color: var(--muted); border: 0; padding: 4px 0 4px 8px; font-size: 10px; }
.wiki-tree-heading button:hover { color: var(--theme-color); }
.sidebar .wiki-search input { width: 100%; border: 0; outline: 0; }
.wiki-search select { width: 100%; margin-top: 8px; border: 1px solid var(--line); padding: 6px; font-size: 11px; color: var(--muted); background: var(--sidebar-bg); border-radius: 3px; }
.wiki-search-status:empty { display: none; }
.wiki-search-status { padding: 5px 3px; overflow-wrap: anywhere; }
.wiki-search-result { display: block; padding: 13px 4px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.wiki-search-result p { white-space: pre-wrap; }
.wiki-search-result:hover { background: var(--hover); text-decoration: none; }
.wiki-search-result strong { display: block; font-size: 12px; line-height: 1.7; color: var(--heading); text-transform: none; }
.wiki-search-result small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; text-transform: none; }
.wiki-search-result small::before { content: none; }
.wiki-search-result .wiki-result-cve { color: var(--theme-color); }
.sidebar-nav .app-sub-sidebar { display: none !important; } /* Page headings have their own outline. */
.sidebar-toggle { top: calc(var(--blog-nav-height) + 11px); bottom: auto; left: 16px; width: 36px; height: 36px; padding: 10px; border-radius: 3px; z-index: 40; background: transparent; }
.sidebar-toggle:hover { background: var(--hover); opacity: 1; }
body .sidebar-toggle { position: fixed; translate: none; }
body:has(.sidebar.show) .sidebar-toggle { width: 36px; translate: none; }
body .sidebar-toggle-button { width: 16px; height: 16px; margin: 0; border-radius: 0; background: transparent; }
.sidebar-toggle span { background: var(--muted); width: 16px; height: 2px; margin-bottom: 4px; }
.sidebar-pin, .github-corner { display: none; }
body main > .content { top: var(--header-height); left: var(--sidebar-width); padding: 0; min-height: calc(100vh - var(--header-height)); }
.markdown-section { width: 100%; max-width: 880px; margin: 0 auto; padding: 38px 48px 90px; color: var(--text); font-size: 15px; line-height: 1.9; }
.markdown-section > :first-child { margin-top: 0; }
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4, .markdown-section strong { color: var(--heading); }
.markdown-section h1 { text-transform: none; }
.markdown-section h1 { font-size: clamp(26px, 2.7vw, 36px); letter-spacing: -.65px; line-height: 1.45; font-weight: 700; margin: 24px 0; overflow-wrap: anywhere; }
.markdown-section h2 { font-size: 23px; line-height: 1.5; margin: 44px 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.markdown-section h3 { font-size: 18px; margin-top: 30px; }
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4 { scroll-margin-top: calc(var(--header-height) + 24px); }
.markdown-section p, .markdown-section ul, .markdown-section ol { margin: 18px 0; }
.markdown-section a { color: var(--theme-color); text-underline-offset: 3px; font-weight: 500; overflow-wrap: anywhere; }
.markdown-section .anchor { color: inherit; }
.markdown-section .anchor span { color: inherit; }
.markdown-section blockquote { background: var(--sidebar-bg); border-left: 3px solid var(--theme-color); border-radius: 0 8px 8px 0; padding: 12px 20px; color: var(--muted); margin: 24px 0; }
.markdown-section blockquote p { font-weight: 400; }
.markdown-section hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.markdown-section img { max-width: 100%; height: auto; border-radius: 7px; }
.markdown-section table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: 13px; }
.markdown-section th, .markdown-section td { border-color: var(--line); padding: 10px 14px; }
.markdown-section th { background: var(--surface); color: var(--heading); }
.markdown-section tr { border-color: var(--line); }
.markdown-section tr:nth-child(2n) { background: var(--sidebar-bg); }
.markdown-section code, .markdown-section pre { font-family: "Fira Code", "SFMono-Regular", Consolas, monospace; }
.markdown-section code { font-size: .88em; color: var(--theme-color); background: var(--surface); border-radius: 4px; padding: 3px 5px; margin: 0 2px; white-space: break-spaces; }
.markdown-section pre { padding: 20px 22px; background: var(--code); border: 1px solid var(--line); border-radius: 3px; line-height: 1.65; margin: 24px 0; }
.markdown-section pre > code { display: block; overflow: auto; padding: 12px 0; margin: 0; font-size: 13px; color: var(--text); background: transparent; white-space: pre; }
.markdown-section pre::after { color: var(--muted); right: 85px; top: 10px; font-size: 10px; }
.markdown-section pre .docsify-copy-code-button { top: 8px; right: 8px; padding: 5px 9px; font-family: inherit; font-size: 11px; line-height: 1.5; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); opacity: 1; }
.markdown-section pre .docsify-copy-code-button:hover { color: var(--heading); }
.docsify-copy-code-button .label { font: inherit; padding: 0; color: inherit; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--muted); }
:root[data-theme="dark"] .token.string, :root[data-theme="dark"] .token.attr-value { color: #a9d896; }
:root[data-theme="dark"] .token.keyword, :root[data-theme="dark"] .token.selector { color: #c4adfa; }
:root[data-theme="dark"] .token.function, :root[data-theme="dark"] .token.number { color: #eac08e; }
:root[data-theme="dark"] .token.operator, :root[data-theme="dark"] .token.punctuation { color: #aebdd0; background: transparent; }
.wiki-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; margin-bottom: 22px; }
.wiki-breadcrumb a { text-decoration: none; color: var(--muted); }
.wiki-breadcrumb span + span::before { content: '/'; margin-right: 8px; color: var(--muted); opacity: .6; }
.wiki-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.wiki-meta-item { font-size: 11px; line-height: 1.7; padding: 5px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); overflow-wrap: anywhere; max-width: 100%; }
.wiki-meta-item b { margin-right: 7px; color: var(--text); font-weight: 600; }
.wiki-meta-cve { background: var(--selected); border-color: transparent; color: var(--theme-color); }
.wiki-shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 38px; }
.markdown-section .wiki-shortcut { padding: 18px; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; background: var(--sidebar-bg); }
.wiki-shortcut:hover { border-color: var(--theme-color); }
.wiki-shortcut strong { display: block; font-size: 15px; margin-bottom: 6px; }
.wiki-shortcut small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; line-height: 1.8; }
.wiki-toc { display: none; position: fixed; right: 28px; top: calc(var(--header-height) + 44px); width: 180px; max-height: calc(100vh - 155px); overflow: auto; font-size: 11px; scrollbar-width: thin; }
.wiki-toc p { color: var(--muted); font-size: 11px; font-weight: 600; margin: 0 0 16px; letter-spacing: 1px; }
.wiki-toc a { display: block; padding: 7px 0 7px 14px; border-left: 1px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.5; overflow-wrap: anywhere; }
.wiki-toc a:hover { color: var(--theme-color); border-color: var(--theme-color); }
.wiki-toc .wiki-toc-sub { padding-left: 24px; }
@media (min-width: 1280px) { body main > .content { padding-right: 220px; } .wiki-toc { display: block; } }
@media (max-width: 1000px) { .wiki-topnav { margin-left: 0; gap: 16px; } .markdown-section { padding: 30px 32px 72px; } }
@media (min-width: 641px) { .sidebar:not(.show) { transform: translateX(calc(-1 * var(--sidebar-width))); } .sidebar:not(.show) ~ .content { left: 0; } }
@media (max-width: 640px) {
  :root { --toolbar-height: 54px; --sidebar-width: min(300px, 85vw); }
  .wiki-header { padding: 0 14px 0 58px; gap: 12px; }
  .wiki-brand { font-size: 23px; }
  .wiki-brand small { font-size: 9px; }
  .wiki-topnav, .wiki-github { display: none; }
  .wiki-tools { gap: 0; }
  .sidebar { transform: translateX(-100%); z-index: 25; }
  .sidebar.show { transform: translateX(0); box-shadow: 20px 0 60px rgba(0, 0, 0, .2); }
  .sidebar-toggle { top: calc(var(--blog-nav-height) + 9px); left: 12px; }
  .sidebar-toggle[aria-expanded="true"] { background: var(--selected); }
  body main > .content, body:has(.sidebar.show) main > .content { position: relative; top: var(--header-height); left: 0; transform: none; padding: 0; }
  .markdown-section { padding: 24px 22px 60px; }
  .markdown-section h1 { font-size: 27px; }
  .markdown-section h2 { font-size: 21px; }
  .markdown-section pre { padding: 16px; }
  .wiki-shortcuts { grid-template-columns: 1fr; gap: 8px; }
  .markdown-section .wiki-shortcut { padding: 14px 16px; }
  .wiki-shortcut strong { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (prefers-reduced-transparency: reduce) { .wiki-header { background: var(--bg); backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --muted: var(--text); } .wiki-header { background: var(--bg); } }
@media print { #main-nav, .wiki-header, .sidebar, .sidebar-toggle, .wiki-toc, .docsify-copy-code-button { display: none !important; } .content { left: 0; top: 0; padding: 0; } .markdown-section { max-width: none; padding: 0; } }

/* Use the blog's existing Bootstrap navigation and bundled DOS font. */
@font-face { font-family: "Fira Code"; src: url('/css/fonts/FiraCode.ttf') format('truetype'); font-display: swap; }
#main-nav { margin: 0; top: 0; right: 0; left: 0; text-align: left; font: 18px/20px DOS, Monaco, monospace; background: #000; color: #bbb; z-index: 45; }
#main-nav ul { list-style: none; }
#main-nav li { margin: 0; }
#main-nav a { font-weight: normal; color: #bbb; text-decoration: none; }
#main-nav a:hover { color: #000; background: #999; }
#main-nav i { margin: 0 5px; }
#main-nav a[aria-current] { color: #2bbc8a; }
#main-nav .navbar-brand { font-size: 18px; }
#main-nav .navbar-toggle { min-height: 24px; min-width: 30px; margin: 0; padding: 3px 6px; border: 1px solid #333; border-radius: 3px; background: #000; color: #bbb; }
#main-nav .navbar-toggle .icon-bar { display: block; width: 16px; height: 2px; margin: 2px 0; background: #bbb; }
.wiki-header small::before, .wiki-shortcuts small::before { content: none; }
.wiki-header small, .wiki-shortcuts small { text-transform: none; }
.wiki-breadcrumb { position: static; text-align: left; }
.markdown-section ul { list-style: disc; }
.markdown-section h1 ~ h1 { font-size: 25px; }
@media (max-width: 767px) {
  #main-nav .navbar-nav { margin: 8px 0; }
  #main-nav .navbar-nav a { padding: 8px 20px; }
}
