/* The knowledge app (/demos/knowledge/): directory on the left, document on the right.
   Shown in a window on the home page and on /knowledge/, or opened on its own. */
:root{color-scheme:dark;--bg:#141414;--side:#181818;--line:#2e2e2e;--text:#dcdcdc;--muted:#909090;--sans:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);-webkit-font-smoothing:antialiased;line-height:1.7;display:grid;grid-template-columns:280px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);overflow:hidden}
.kb-side{grid-row:2}.kb-main{grid-row:2}
/* Top bar: 目录 (phones) and 返回网站 (phones, or the app opened on its own). Hidden inside the site's window. */
.kb-bar{grid-column:1/-1;display:none;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px;background:#141414;border-bottom:1px solid var(--line)}
.kb-standalone .kb-bar{display:flex}
.kb-back{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font-size:12.5px;color:#cfcfcf;border:1px solid #444;border-radius:30px;padding:5px 12px}
.kb-back:hover{border-color:#888}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid #f2f2f2;outline-offset:2px}
.ico{display:inline-block;width:1em;height:1em;vertical-align:-.15em;flex:none}
h1,h2,h3,h4,h5,p{margin:0}

.kb-side{background:var(--side);border-right:1px solid var(--line);overflow:auto;padding:14px 10px 24px;font-size:13px;scrollbar-width:thin}
.kb-side-head{display:flex;align-items:center;justify-content:space-between;padding:2px 10px 10px;font-size:11px;letter-spacing:.14em;color:var(--muted)}
.kb-close{display:none;font-size:18px;padding:4px}
.kb-tree ul{list-style:none;margin:2px 0 6px;padding-left:12px}
.kb-tree li{margin:1px 0}
.kb-home{display:flex;align-items:center;gap:8px;padding:7px 10px;margin-bottom:6px;border-radius:9px;color:#e6e6e6;font-weight:500}
.kb-home:hover{background:#222}
.kb-home.is-current{background:#f2f2f2;color:#141414}
.kb-tree summary{list-style:none;display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:9px;cursor:pointer;color:#e6e6e6}
.kb-tree summary::-webkit-details-marker{display:none}
.kb-tree summary::before{content:'';flex:none;width:6px;height:6px;border-right:1.5px solid #888;border-bottom:1.5px solid #888;transform:rotate(-45deg);transition:transform .2s;margin-right:2px}
.kb-tree details[open]>summary::before{transform:rotate(45deg)}
.kb-tree summary>span,.kb-tree summary>a{flex:1;min-width:0}
.kb-tree summary:hover{background:#222}
.kb-notebook>summary{font-weight:500;font-size:13.5px}
.kb-tree b{flex:none;font-weight:500;font-size:11px;color:#a8a8a8;background:#262626;border-radius:20px;padding:1px 8px}
.kb-tree li>a{display:block;padding:5px 10px;border-radius:8px;color:#c4c4c4;line-height:1.5}
.kb-tree li>a:hover{background:#222;color:#fff}
.kb-tree li>a[aria-current]{background:#f2f2f2;color:#141414}
.kb-tree summary>a[aria-current]{color:#fff;text-decoration:underline;text-underline-offset:4px}

.kb-main{overflow:auto;padding:26px 44px 48px}
.kb-head{display:flex;align-items:flex-start;gap:14px;max-width:880px;margin-bottom:18px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.kb-head p{font-size:12px;color:var(--muted)}
.kb-head h1{font-size:23px;font-weight:500;line-height:1.45;color:#f4f4f4;margin-top:2px}
.kb-open{display:none;align-items:center;gap:6px;flex:none;border:1px solid #444;border-radius:30px;padding:5px 12px;font-size:12px}

.kb-doc{max-width:880px;font-size:15px;line-height:1.95}
.kb-doc>:first-child{margin-top:0}
.kb-doc h2{font-size:20px;font-weight:500;line-height:1.5;color:#f4f4f4;margin:32px 0 10px}
.kb-doc h3{font-size:17px;font-weight:500;color:#eee;margin:24px 0 8px}
.kb-doc h4,.kb-doc h5{font-size:15px;font-weight:600;color:#e8e8e8;margin:18px 0 6px}
.kb-doc p{margin:10px 0}
.kb-doc ul,.kb-doc ol{margin:8px 0;padding-left:22px}
.kb-doc li{margin:3px 0}
.kb-doc li>ul,.kb-doc li>ol{margin:3px 0}
.kb-doc strong{color:#fff;font-weight:600}
.kb-doc a{text-decoration:underline;text-underline-offset:3px;text-decoration-color:#777}
.kb-doc blockquote{margin:16px 0;padding:6px 18px;border-left:3px solid #666;background:#1d1d1d;border-radius:0 10px 10px 0;color:#bdbdbd}
.kb-doc blockquote p{margin:6px 0}
.kb-doc pre{margin:14px 0;padding:14px 16px;background:#0f0f0f;border:1px solid #303030;border-radius:10px;overflow:auto;font-size:13px;line-height:1.75}
.kb-doc code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em;background:#262626;border-radius:5px;padding:1px 5px}
.kb-doc pre code{background:none;padding:0}
.kb-table{overflow-x:auto;margin:14px 0}
.kb-doc table{border-collapse:collapse;min-width:100%;font-size:13.5px;line-height:1.7}
.kb-doc th,.kb-doc td{border:1px solid #383838;padding:8px 11px;text-align:left;vertical-align:top}
.kb-doc th{background:#202020;color:#eee;font-weight:500;white-space:nowrap}
.kb-task{color:#999}
.kb-children{margin-top:30px;padding-top:22px;border-top:1px solid var(--line)}
.kb-children h2{display:flex;align-items:baseline;gap:10px;margin:0 0 12px}
.kb-children h2 span{font-size:12px;color:var(--muted);font-weight:400}
.kb-children ul{list-style:none;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px}
.kb-children li{border-bottom:1px solid #262626;padding:6px 0}
.kb-pager{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:40px;padding-top:22px;border-top:1px solid var(--line)}
.kb-pager a{display:block;border:1px solid #363636;border-radius:12px;padding:12px 16px;text-decoration:none;color:#e8e8e8;line-height:1.6}
.kb-pager a:last-child{text-align:right}
.kb-pager a:hover{border-color:#777}
.kb-pager small{display:block;font-size:11px;color:var(--muted)}

/* Guide page */
.kb-lead{font-size:15px;color:#c8c8c8;margin-bottom:20px}
.kb-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.kb-card{display:flex;flex-direction:column;gap:10px;background:#1b1b1b;border:1px solid #2f2f2f;border-radius:14px;padding:18px 20px}
.kb-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.kb-card h2{font-size:18px;font-weight:500;color:#f2f2f2;margin:0}
.kb-card-head b{font-weight:500;font-size:12px;color:var(--muted)}
.kb-card p{font-size:13.5px;line-height:1.85;color:#b8b8b8;margin:0}
.kb-card-groups{display:flex;flex-wrap:wrap;gap:6px}
.kb-card-groups a,.kb-loose{display:inline-flex;align-items:center;gap:6px;font-size:12px;border:1px solid #3a3a3a;border-radius:30px;padding:3px 10px;color:#d6d6d6;text-decoration:none}
.kb-card-groups a span{color:var(--muted)}
.kb-card-groups a:hover{border-color:#777}
.kb-loose{color:var(--muted);border-style:dashed}
.kb-card-go{margin-top:auto;font-size:13px;color:#e8e8e8;text-decoration:none!important}
.kb-card-go:hover{text-decoration:underline!important}

/* Narrow windows and phones: the page scrolls as a whole, the bar stays on top, the directory slides in. */
@media(max-width:720px){
 html,body{height:auto}
 body{display:block;overflow:visible}
 .kb-bar{display:flex;position:sticky;top:0;z-index:8}
 .kb-side{position:fixed;z-index:10;top:0;bottom:0;left:0;width:min(86vw,320px);transform:translateX(-100%);transition:transform .25s;box-shadow:0 0 0 100vmax transparent}
 body.kb-menu .kb-side{transform:none;box-shadow:0 0 0 100vmax #000000a6}
 body.kb-menu{overflow:hidden}
 .kb-close{display:inline-flex}
 .kb-open{display:inline-flex}
 .kb-main{overflow:visible;padding:16px 16px 40px}
 .kb-head h1{font-size:19px}
 .kb-doc{font-size:14.5px}
 .kb-cards,.kb-children ul,.kb-pager{grid-template-columns:1fr}
 .kb-pager a:last-child{text-align:left}
}
