@import url("https://registry.npmmirror.com/lxgw-wenkai-screen-web/latest/files/style.css");

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --radius: 16px;
  --shadow: 0 12px 42px rgba(15, 23, 42, 0.08);
  font-family: "LXGW WenKai Screen", "Manrope", "Segoe UI", "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 20px;
  background: radial-gradient(120% 120% at 6% 6%, #e8eeff, transparent),
    radial-gradient(120% 120% at 92% 0%, #f5e8ff, transparent),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 40px);
}

body[data-page="docs"], body[data-page="log"] {
  overflow: hidden;
}

body[data-page="docs"] .page,
body[data-page="log"] .page {
  height: calc(100vh - 40px);
}

.docs-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.doc-split {
  --toc-w: 140px;
  position: relative;
  display: grid;
  grid-template-columns: var(--toc-w) 1fr;
  gap: 24px;
  min-height: 0;
}

.toc {
  padding: 8px 10px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.toc::-webkit-scrollbar { display: none; }

.toc__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc__item {
  color: var(--text);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.toc__item:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.toc__item.is-active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toc__item--h1 { font-weight: 700; }
.toc__item--h2 { padding-left: 12px; font-weight: 600; }
.toc__item--h3 { padding-left: 20px; color: var(--muted); font-weight: 500; }
.toc__item--h4 { padding-left: 28px; color: var(--muted); font-size: 13px; font-weight: 500; }

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  gap: 12px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent);
}

.links { display: flex; gap: 10px; align-items: center; }

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.nav-link:hover { color: var(--accent); }
.nav-link.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.home { display: flex; flex-direction: column; gap: 16px; }

.home__hero {
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home__cta { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.home__glass {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.16);
}

.home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.card {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.project-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 0 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
}

.chip {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.chip--active {
  color: #0f172a;
  border-color: transparent;
  background: transparent;
  font-weight: 800;
}

.content-shell {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.content-shell--docs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.content-shell--log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.markdown { line-height: 1.7; color: var(--text); }

.doc-split .markdown {
  overflow: auto;
  scrollbar-width: none;
}

.doc-split .markdown::-webkit-scrollbar { display: none; }

.log-body {
  padding: 0 48px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.log-body .markdown {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.log-body .markdown::-webkit-scrollbar { display: none; }

.markdown--log {
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.markdown--log::-webkit-scrollbar { display: none; }

.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  margin: 18px 0 10px;
  letter-spacing: -0.2px;
}

.markdown h1 { font-size: 26px; }
.markdown h2 { font-size: 22px; }
.markdown h3 { font-size: 18px; }
.markdown h4 { font-size: 16px; }

.markdown p { margin: 12px 0; color: var(--text); }

.markdown ul, .markdown ol { margin: 10px 0 16px 22px; padding: 0; }
.markdown li { margin-bottom: 8px; }

.markdown code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.markdown pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 12px;
  overflow-x: auto;
}

.markdown blockquote {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
  color: var(--muted);
  border-radius: 10px;
}

.markdown a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.markdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.lede { margin: 6px 0 0; color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.pill--ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.placeholder { color: var(--muted); margin: 0; }

@media (max-width: 960px) {
  body { padding: 14px; }
  .page { gap: 12px; }
  .home__glass { min-width: auto; }
  .doc-split { grid-template-columns: 1fr; }
  .doc-split::after { display: none; }
  .toc { order: 2; }
  .markdown { order: 1; }
}
