:root {
  --page: #f6f7f9;
  --surface: #ffffff;
  --ink: #182033;
  --muted: #6b7280;
  --blue: #2856d8;
  --blue-dark: #1d3f9f;
  --blue-soft: #eef3ff;
  --line: #e1e5ec;
  --content-width: 1120px;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
  min-height: 520px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 8px 12px;
  color: #fff;
  background: var(--blue);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.section-shell,
.header-inner,
.site-notice > div,
.site-footer > div {
  width: min(calc(100% - 40px), var(--content-width));
  margin-right: auto;
  margin-left: auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  font-size: 17px;
}

.site-intro {
  padding: 24px 26px;
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-intro h1 {
  margin: 0 0 7px;
  font-size: 23px;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.site-intro-copy > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-intro-notes {
  display: grid;
  grid-template-columns: 1fr;
  padding-top: 12px;
  margin-top: 17px;
  color: #697180;
  border-top: 1px solid #e6e9ee;
}

.site-intro-notes p {
  position: relative;
  padding: 6px 0 6px 16px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.site-intro-notes p::before {
  position: absolute;
  top: 14px;
  left: 2px;
  width: 4px;
  height: 4px;
  background: #939aa7;
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.search-section {
  padding-top: 20px;
  padding-bottom: 6px;
}

.quick-search {
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quick-search label {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  background: var(--page);
  border: 1px solid transparent;
  border-radius: 7px;
}

.quick-search label:focus-within {
  background: #fff;
  border-color: var(--blue);
}

.quick-search-icon {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 14px;
}

.quick-search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px 10px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  line-height: 22px;
}

.browser-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  padding-top: 18px;
  padding-bottom: 60px;
  gap: 22px;
}

.tree-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tree-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.tree-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.tree-panel-head span {
  color: var(--muted);
  font-size: 9px;
}

.tree-level {
  padding: 0;
  margin: 9px 0 0;
  list-style: none;
}

.tree-level .tree-level {
  padding-left: 11px;
  margin: 2px 0 5px 8px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tree-category-button {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  padding: 6px 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  gap: 10px;
}

.tree-depth-0 > li > .tree-row > .tree-category-button {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.tree-category-button:hover,
.tree-category-button[aria-pressed="true"] {
  color: var(--blue);
  background: var(--blue-soft);
}

.tree-level small {
  color: #98a0b0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
}

.tree-toggle-button {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 7px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  place-items: center;
}

.tree-toggle-button:hover,
.tree-toggle-button:focus-visible {
  background: var(--blue-soft);
  outline: 0;
}

.tree-toggle-icons {
  position: relative;
  width: 16px;
  height: 16px;
}

.tree-toggle-icon {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  transition: opacity 160ms ease, transform 160ms ease;
}

.tree-toggle-icon-down {
  opacity: 0;
  transform: translateY(-2px);
}

.tree-toggle-button[aria-expanded="false"] .tree-toggle-icon-up {
  opacity: 0;
  transform: translateY(2px);
}

.tree-toggle-button[aria-expanded="false"] .tree-toggle-icon-down {
  opacity: 1;
  transform: translateY(0);
}

.resource-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.resource-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}

.resource-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.resource-panel-head span {
  color: var(--muted);
  font-size: 10px;
}

.resource-name-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.resource-name-list li {
  border-bottom: 1px solid var(--line);
}

.resource-name-list li:last-child {
  border-bottom: 0;
}

.resource-name-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  gap: 16px;
}

.resource-name-list a:hover {
  background: #f8f9fb;
}

.resource-link-name {
  min-width: 0;
  color: var(--ink);
}

.resource-link-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 4px 9px;
  color: #555d6b;
  background: #f4f5f7;
  border: 1px solid #d9dde4;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
}

.search-empty {
  padding: 34px 20px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-notice {
  color: #d7dce8;
  background: #202a43;
}

.site-notice > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  padding-top: 20px;
  padding-bottom: 20px;
  gap: 18px;
}

.site-notice strong {
  color: #fff;
}

.site-notice p {
  margin: 0;
  font-size: 12px;
}

.site-footer {
  color: #9098aa;
  background: #182033;
}

.site-footer > div {
  display: flex;
  justify-content: space-between;
  padding-top: 17px;
  padding-bottom: 17px;
  gap: 20px;
}

.site-footer p {
  margin: 0;
  font-size: 11px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  padding-top: 18px;
  color: var(--muted);
  font-size: 11px;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumb a:hover {
  color: var(--blue);
}

.breadcrumb span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-hero {
  position: relative;
  padding-top: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.2;
}

.page-hero > p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-hero > strong {
  position: absolute;
  right: 0;
  bottom: 28px;
  color: var(--blue);
  font-size: 11px;
}

.resource-list {
  padding: 0;
  margin-top: 34px;
  margin-bottom: 54px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 15px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.not-found {
  min-height: 64vh;
  padding-top: 85px;
  padding-bottom: 85px;
}

.not-found h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.2;
}

.not-found > p:not(.eyebrow) {
  margin: 15px 0 24px;
  color: var(--muted);
}

.not-found .primary-button {
  width: auto;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #9eb5f6;
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .browser-layout {
    grid-template-columns: 1fr;
  }

  .tree-panel {
    position: static;
  }

  .tree-panel nav > .tree-level {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

}

@media (max-width: 640px) {
  .section-shell,
  .header-inner,
  .site-notice > div,
  .site-footer > div {
    width: min(calc(100% - 28px), var(--content-width));
  }

  .site-intro {
    padding: 19px 18px;
    margin-top: 14px;
  }

  .browser-layout {
    padding-top: 12px;
    padding-bottom: 44px;
    gap: 12px;
  }

  .tree-panel nav > .tree-level {
    grid-template-columns: 1fr;
  }

  .resource-name-list a {
    padding: 10px 12px;
  }

  .site-notice > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-footer > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .page-hero {
    padding-top: 28px;
    padding-bottom: 23px;
  }

  .page-hero > strong {
    position: static;
    display: block;
    margin-top: 11px;
  }

  .resource-list {
    margin-top: 30px;
    margin-bottom: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
