* {
  box-sizing: border-box;
}

html {
  color: #202124;
  background: #f6f7f8;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.62;
}

body {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #d7dde6;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(31, 41, 55, 0.08);
}

.site-nav {
  display: flex;
  width: min(1680px, 96vw);
  margin: 0 auto;
  padding: 10px 36px;
  align-items: center;
  gap: 24px;
}

.brand {
  flex: 0 0 auto;
  color: #17202a;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-links a {
  display: inline-flex;
  min-height: 32px;
  padding: 5px 10px;
  align-items: center;
  border-radius: 6px;
  color: #3c4856;
  text-decoration: none;
}

.nav-links a:hover {
  background: #edf2f7;
  color: #1f4f8a;
}

.nav-links a.active {
  background: #e6eef8;
  color: #1d4f8f;
  font-weight: 600;
}

.search-toggle {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #2f4054;
  cursor: pointer;
  font: inherit;
}

.search-toggle:hover,
.search-toggle:focus-visible {
  border-color: #8aa8ce;
  background: #edf2f7;
  color: #1f4f8a;
}

.page {
  width: min(1680px, 96vw);
  margin: 0 auto;
  padding: 32px 36px 56px;
  background: #ffffff;
  min-height: 100vh;
  box-shadow: 0 0 0 1px #e4e7eb;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d9dee5;
  color: #5b6470;
  font-size: 14px;
}

.topbar a {
  color: #2f5f9f;
  text-decoration: none;
}

.content {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  color: #17202a;
  line-height: 1.3;
}

h1 {
  margin-top: 0;
  font-size: 30px;
}

h2 {
  margin-top: 36px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e4e7eb;
  font-size: 24px;
}

h3 {
  margin-top: 28px;
  font-size: 19px;
}

a {
  color: #245a9c;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 16px 0;
}

th,
td {
  border: 1px solid #d8dde5;
  padding: 7px 10px;
  vertical-align: top;
}

th {
  background: #eef2f6;
  font-weight: 600;
}

tr:nth-child(even) td {
  background: #fafbfc;
}

code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: #eef2f6;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 6px;
  background: #111827;
  color: #f8fafc;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

blockquote {
  margin: 16px 0;
  padding-left: 14px;
  border-left: 4px solid #cbd5e1;
  color: #4b5563;
}

.search-open {
  overflow: hidden;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 18px 24px;
  background: rgba(15, 23, 42, 0.36);
}

.search-overlay[hidden] {
  display: none;
}

.search-dialog {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.search-head {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b8c4d4;
  border-radius: 6px;
  color: #17202a;
  font: inherit;
}

.search-input:focus {
  border-color: #2f6fab;
  outline: 2px solid #d8e7f7;
}

.search-close {
  flex: 0 0 40px;
  width: 40px;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.search-close:hover,
.search-close:focus-visible {
  background: #edf2f7;
}

.search-status {
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 14px;
}

.search-results {
  max-height: calc(min(720px, 100vh - 120px) - 112px);
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: #17202a;
  text-decoration: none;
}

.search-result:hover,
.search-result:focus-visible {
  background: #eef4fb;
}

.search-result-title {
  display: block;
  margin-bottom: 4px;
  color: #1d4f8f;
  font-weight: 600;
}

.search-result-excerpt {
  display: block;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.search-result-excerpt mark {
  border-radius: 3px;
  background: #fff2a8;
  color: inherit;
}

@media (max-width: 760px) {
  .site-nav {
    display: block;
    padding: 8px 16px;
  }

  .brand {
    display: block;
    margin-bottom: 6px;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-links a {
    min-height: 30px;
    padding: 4px 8px;
  }

  .search-toggle {
    margin-top: 8px;
    width: 100%;
  }

  .page {
    padding: 20px 16px 40px;
  }

  .topbar {
    display: block;
  }

  .search-overlay {
    padding-top: 56px;
  }

  .search-dialog {
    max-height: calc(100vh - 80px);
  }

  .search-results {
    max-height: calc(100vh - 196px);
  }
}
