:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #252a31;
  --muted: #59616d;
  --line: #e7e9ed;
  --canvas: #f5f6f8;
  --paper: #fff;
  --blue: #245ee8;
  --blue-soft: #e8eefb;
  --sidebar-width: 288px;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { color: var(--ink); background: var(--canvas); font-size: 14px; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-150%); border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
#reader.app-shell { display: grid; position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 0; grid-template-columns: var(--sidebar-width) minmax(0,1fr); background: #fff; }
.sidebar { grid-column: 1; grid-row: 1; z-index: 2; display: flex; min-width: 0; min-height: 0; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.brand { display: flex; min-height: 68px; flex: 0 0 68px; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 7px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 650; }
.brand-name { font-size: 16px; font-weight: 600; }
.sidebar-heading { margin: 0; padding: 20px 16px 12px; color: var(--muted); font-size: 16px; font-weight: 550; }
.nav-search-wrap { display: flex; min-height: 40px; flex: 0 0 40px; align-items: center; gap: 9px; margin: 0 12px 14px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.nav-search:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
.nav-search-wrap:focus-within { border-color: #8ea9e6; }
.search-icon { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; }
.nav-search { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.nav-search::placeholder { color: #777f8b; }
kbd { display: grid; min-width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border: 1px solid #e2e5ea; border-radius: 4px; color: #69717d; background: #fff; font: 12px/1 ui-monospace,monospace; }
.folder-nav { min-height: 0; flex: 1 1 auto; overflow: auto; padding: 0 10px 24px; overscroll-behavior: contain; scrollbar-color: #d7dbe2 transparent; scrollbar-width: thin; }
.loading { padding: 12px; color: var(--muted); line-height: 1.6; }
.folder { margin: 2px 0; }
.folder-toggle, .doc-link { display: flex; width: 100%; min-height: 42px; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; color: #3b424c; text-align: left; text-decoration: none; cursor: pointer; }
.folder-toggle { padding: 0 9px; font-weight: 550; }
.folder-toggle:hover, .doc-link:hover { background: #f4f6f9; }
.folder-toggle:focus-visible, .doc-link:focus-visible, .repo-link:focus-visible, .sidebar-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.folder-chevron { width: 12px; flex: 0 0 12px; color: #7a8491; font-size: 15px; transition: transform 150ms ease; }
.folder-toggle[aria-expanded="true"] .folder-chevron { transform: rotate(90deg); }
.folder-icon { width: 15px; height: 15px; flex: 0 0 15px; color: #7c8796; }
.folder-label { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { flex: 0 0 auto; color: #68717e; font-size: 12px; font-variant-numeric: tabular-nums; }
.folder-children { margin-left: 12px; padding-left: 8px; border-left: 1px solid #eceef1; }
.folder-children[hidden] { display: none; }
.doc-link { min-height: 40px; padding: 6px 8px 6px 10px; color: #4a5360; font-size: 13px; line-height: 1.45; }
.doc-link[aria-current="page"] { background: var(--blue-soft); color: #173f9c; font-weight: 550; }
.doc-icon { display: grid; width: 16px; height: 18px; flex: 0 0 16px; place-items: center; border: 1px solid #cdd5e1; border-radius: 3px; color: #63718a; font: 9px/1 ui-monospace,monospace; }
.doc-link[aria-current="page"] .doc-icon { border-color: #9bb2e4; color: var(--blue); }
.doc-title { display: block; min-width: 0; overflow-wrap: anywhere; }
.empty-folder { padding: 9px 12px; color: var(--muted); font-size: 13px; }
.sidebar-foot { display: flex; min-height: 48px; flex: 0 0 48px; align-items: center; gap: 9px; padding: 0 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; background: #fff; }
.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #399b73; }
.workspace { grid-column: 2; grid-row: 1; display: grid; min-width: 0; min-height: 0; grid-template-rows: 68px minmax(0,1fr); background: #fff; }
.topbar { display: flex; min-width: 0; height: 68px; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: #fff; }
.page-title { flex: 0 0 auto; margin: 0; color: #303741; font-size: 18px; font-weight: 600; }
.breadcrumb { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; overflow: hidden; color: #626c79; font-size: 13px; white-space: nowrap; }
.breadcrumb span:last-child { overflow: hidden; color: #343a43; text-overflow: ellipsis; }
.crumb-separator { color: #89919c; }
.repo-link { display: inline-flex; min-height: 44px; flex: 0 0 auto; align-items: center; gap: 6px; color: #525c69; font-size: 13px; text-decoration: none; }
.repo-link:hover { color: var(--blue); }
.sidebar-toggle { display: none; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.sidebar-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.5; }
.reader { position: relative; display: grid; min-width: 0; min-height: 0; overflow: auto; background: #fff; }
#welcome { display: grid; min-width: 0; min-height: 100%; place-items: center; }
.welcome-content { display: grid; width: min(100%, 760px); justify-items: start; align-content: center; gap: 16px; padding: 64px 40px; text-align: left; }
.welcome-icon { display: none; }
.welcome-title { margin: 0; color: #303741; font-size: 32px; line-height: 1.2; font-weight: 600; }
.welcome p { max-width: 52ch; margin: 0; color: #525d6b; font-size: 16px; line-height: 1.6; }
.welcome-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; margin-top: 4px; padding: 0 18px; border: 1px solid #aeb7c4; border-radius: var(--r-btn, 8px); color: #303741; background: #fff; font-size: 15px; font-weight: 500; text-decoration: none; }
.welcome-action:hover,.welcome-action:focus-visible { background: #f4f6fa; }
.welcome-action:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.welcome-visual { display: grid; width: min(100%, 640px); min-height: 190px; align-content: center; justify-items: center; gap: 14px; margin-top: 20px; padding: 28px 40px; border: 1px solid #dfe3e9; border-radius: 8px; background: #f7f8fa; }
.welcome-visual__line { display: block; width: 72%; height: 14px; border-radius: 6px; background: #e2e6ed; }
.welcome-visual__line--long { width: 92%; height: 18px; background: #dce2ec; }
.welcome-visual__line--medium { width: 48%; }
#welcome[hidden], #preview-frame[hidden] { display: none !important; }
#preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.frame-loading { position: absolute; z-index: 1; top: 12px; right: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; color: #505b6b; background: #fff; font-size: 13px; }
.sidebar-backdrop { display: none; }
@media (max-width: 1023px) { :root { --sidebar-width: 248px; } }
@media (max-width: 760px) {
  :root { --sidebar-width: min(360px,calc(100vw - 48px)); }
  #reader.app-shell { grid-template-columns: minmax(0,1fr); }
  .workspace { grid-column: 1; grid-row: 1; grid-template-rows: 68px minmax(0,1fr); }
  .topbar { gap: 10px; padding-inline: 12px; }
  .page-title { font-size: 16px; }
  .breadcrumb { gap: 7px; }
  .repo-link { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 12; width: var(--sidebar-width); max-width: 100vw; transform: translateX(-100%); transition: transform 220ms cubic-bezier(.2,.8,.2,1); box-shadow: 12px 0 36px rgb(23 31 44 / .12); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scroll { height: 100%; overflow-y: auto; padding-bottom: 48px; }
  .sidebar-backdrop:not([hidden]) { position: fixed; inset: 0; z-index: 11; display: block; width: 100%; height: 100%; border: 0; background: rgb(24 31 42 / .3); }
  .sidebar-toggle { display: grid; }
}
@media (max-width: 420px) { .topbar { gap: 8px; padding-inline: 10px; } .welcome-content { padding: 32px 20px; } .welcome-title { font-size: 26px; } .welcome-visual { min-height: 150px; padding: 20px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
