:root {
  color-scheme: light;
  --background: #fbfaf7;
  --surface: #fff;
  --ink: #222b27;
  --muted: #5a665f;
  --line: #e1e5df;
  --accent: #22634e;
  --accent-soft: #eaf2ed;
  --topbar-height: 4rem;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
a { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
ul { padding-inline-start: 1.4em; }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 10; padding: .5rem; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.topbar { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 93rem; height: var(--topbar-height); margin: 0 auto; padding: 0 2rem; display: flex; align-items: center; gap: .85rem; }
.brand { flex-shrink: 0; display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--accent); }
.brand-icon::before { content: ""; width: .78rem; height: .92rem; border: 1.5px solid white; border-radius: 2px; background: linear-gradient(white, white) 50% 55% / .3rem 1px no-repeat, linear-gradient(white, white) 50% 75% / .3rem 1px no-repeat; }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: .8rem; font-size: .875rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; color: var(--muted); }
.breadcrumbs a { flex-shrink: 0; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .current { min-width: 4rem; overflow: hidden; text-overflow: ellipsis; }
.separator { color: #8a958c; }

.index-page { width: min(100% - 3rem, 56rem); margin: 0 auto; padding: 4rem 0 5rem; }
.index-page h1 { margin: 0 0 1.5rem; font-size: clamp(1.85rem, 4vw, 2.7rem); letter-spacing: -.035em; overflow-wrap: anywhere; }
.back-link { display: inline-flex; align-items: center; min-height: 2.75rem; margin-bottom: .5rem; color: var(--muted); font-size: .875rem; text-decoration: none; }
.back-link:hover { color: var(--accent); text-decoration: underline; }
.directory-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
.directory-list li + li { border-top: 1px solid var(--line); }
.directory-list a { min-height: 3.65rem; padding: .85rem 1.15rem; display: flex; align-items: center; gap: .9rem; color: var(--ink); text-decoration: none; border-radius: inherit; }
.directory-list li:first-child a { border-radius: .8rem .8rem 0 0; }
.directory-list li:last-child a { border-radius: 0 0 .8rem .8rem; }
.directory-list li:only-child a { border-radius: .8rem; }
.directory-list a:hover { background: var(--accent-soft); color: var(--accent); }
.entry-name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.entry-kind { color: var(--muted); font-size: .78rem; }
.entry-arrow { color: var(--accent); font-size: 1.4rem; line-height: 1; }
.entry-icon { display: inline-block; flex-shrink: 0; border: 1.5px solid currentColor; color: var(--accent); position: relative; margin: 0 .15rem; }
.entry-icon.folder { width: 1rem; height: .72rem; border-radius: 2px; background: var(--accent-soft); }
.entry-icon.folder::before { content: ""; position: absolute; width: .44rem; height: .22rem; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; top: -.27rem; left: -1.5px; background: var(--accent-soft); }
.entry-icon.file { width: .77rem; height: .93rem; border-radius: 2px; background: linear-gradient(currentColor, currentColor) 50% 42% / .3rem 1px no-repeat, linear-gradient(currentColor, currentColor) 50% 67% / .3rem 1px no-repeat; }
.empty-state { color: var(--muted); }

.reader-layout { max-width: 93rem; margin: 0 auto; display: grid; grid-template-columns: 14rem minmax(0, 55rem); gap: clamp(1.5rem, 3vw, 3.5rem); padding: 2.5rem 2rem 5rem; }
.reader-layout.with-toc { grid-template-columns: 14rem minmax(0, 1fr) minmax(10rem, 14rem); }
.reader-nav, .reader-toc { position: sticky; top: calc(var(--topbar-height) + 2rem); align-self: start; max-height: calc(100vh - var(--topbar-height) - 3rem); overflow-y: auto; }
.reader-nav { border-right: 1px solid var(--line); padding-right: 1rem; }
.reader-nav-title { display: flex; align-items: center; gap: .6rem; padding: .65rem; font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.reader-nav ul, .toc-list { list-style: none; padding: 0; margin: .25rem 0 0; }
.reader-nav li a { display: block; padding: .55rem .65rem; border-radius: .4rem; color: var(--muted); text-decoration: none; font-size: .875rem; overflow-wrap: anywhere; }
.reader-nav li a:hover, .reader-nav li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.reader-nav li a[aria-current="page"] { font-weight: 650; }
.reader-toc { border-left: 1px solid var(--line); padding-left: 1rem; }
.reader-toc h2, .mobile-toc summary { margin: 0 0 .5rem; font-size: .875rem; font-weight: 700; }
.toc-list a { display: block; padding: .28rem 0; color: var(--muted); text-decoration: none; font-size: .82rem; line-height: 1.5; overflow-wrap: anywhere; }
.toc-list a:hover { color: var(--accent); text-decoration: underline; }
.toc-h3 { padding-left: .7rem; }
.toc-h4 { padding-left: 1.4rem; }
.mobile-toc, .mobile-back { display: none; }

.markdown { max-width: 55rem; min-width: 0; line-height: 1.78; overflow-wrap: break-word; }
.markdown > :first-child { margin-top: 0; }
.markdown :is(h1, h2, h3, h4, h5, h6) { line-height: 1.32; scroll-margin-top: calc(var(--topbar-height) + 1rem); overflow-wrap: anywhere; }
.markdown h1 { font-size: clamp(1.85rem, 3.5vw, 2.8rem); letter-spacing: -.035em; margin: 1.7em 0 .65em; }
.markdown h2 { font-size: clamp(1.3rem, 2vw, 1.62rem); margin: 1.7em 0 .7em; padding-bottom: .45em; border-bottom: 1px solid var(--line); }
.markdown h3 { font-size: 1.2rem; margin: 1.45em 0 .6em; }
.markdown p, .markdown ul, .markdown ol { margin: .8em 0; }
.markdown li + li { margin-top: .25em; }
.markdown a { text-underline-offset: .18em; }
.markdown blockquote { margin: 1.2rem 0; padding: .25rem 1rem; border-left: 3px solid #6c9d87; background: var(--accent-soft); color: #3b5046; }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.markdown img { display: block; max-width: 100%; height: auto; margin: 1.35rem auto; border-radius: .4rem; }
.markdown code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }
.markdown :not(pre) > code { padding: .13em .35em; border-radius: .24rem; color: #255342; background: var(--accent-soft); overflow-wrap: anywhere; }
.markdown pre { max-width: 100%; margin: 1.2rem 0; padding: 1rem 1.15rem; border-radius: .65rem; overflow: auto; background: #111820; color: #ebeff3; line-height: 1.55; }
.markdown pre code { white-space: pre; overflow-wrap: normal; }
.markdown table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: .925rem; margin: 1.25rem 0; }
.markdown th, .markdown td { padding: .55rem .8rem; border: 1px solid var(--line); min-width: 5rem; }
.markdown th { background: var(--accent-soft); text-align: left; }
.markdown td { background: var(--surface); }
.markdown .align-center { text-align: center; }
.markdown .align-right { text-align: right; }

@media (max-width: 65rem) {
  .reader-layout, .reader-layout.with-toc { grid-template-columns: 11rem minmax(0, 1fr); }
  .reader-toc { display: none; }
  .mobile-toc { display: block; padding: .75rem 1rem; margin-bottom: 1.35rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
  .mobile-toc summary { cursor: pointer; margin: 0; }
  .mobile-toc .toc-list a { padding-block: .45rem; }
}

@media (max-width: 43rem) {
  :root { --topbar-height: 3.45rem; }
  .topbar-inner { padding: 0 1rem; gap: .65rem; }
  .breadcrumbs { gap: .55rem; }
  .index-page { width: calc(100% - 2rem); padding: 2rem 0 3rem; }
  .directory-list a { padding-inline: .85rem; gap: .65rem; }
  .reader-layout, .reader-layout.with-toc { display: block; padding: .45rem 1rem 3rem; }
  .reader-nav { display: none; }
  .mobile-back { display: inline-flex; }
  .markdown { line-height: 1.72; }
  .markdown pre { padding: .8rem; }
}
