@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-muted: #fafafa;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-soft: #f0f1f3;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "SF Pro Text", "SF Pro Display", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  gap: 20px;
  padding: 24px;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
  height: calc(100vh - 48px);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
}

.title {
  font-weight: 600;
  font-size: 17px;
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  outline: none;
  font-size: 14px;
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s ease;
}

.list-item:hover {
  border-color: var(--line);
  background: var(--panel-muted);
}

.list-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.list-title {
  font-weight: 600;
  font-size: 14px;
}

.list-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.topbar-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.topbar-title {
  font-weight: 600;
  font-size: 16px;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  line-height: 1;
  min-width: 112px;
  text-align: center;
}

.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.icon-btn {
  display: none;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.detail {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 160px);
}

.detail h2 {
  margin-top: 0;
  font-size: 22px;
}


.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.tag {
  background: var(--panel-muted);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.code-block {
  background: #0f1115;
  color: #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  font-family: "IBM Plex Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13px;
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-title {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}

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

.markdown h2,
.markdown h3,
.markdown h4 {
  margin-top: 24px;
  margin-bottom: 8px;
}

.markdown p {
  margin: 0 0 12px;
}

.markdown ul {
  margin: 0 0 12px 18px;
  padding: 0;
}

.markdown code {
  font-family: "IBM Plex Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 23, 42, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.92em;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    max-height: calc(100vh - 40px);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
    z-index: 20;
    height: calc(100vh - 40px);
  }

  .sidebar.open {
    transform: translateY(0);
  }

  .icon-btn {
    display: inline-block;
  }
}
.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding-right: 6px;
  flex: 1;
  min-height: 0;
}
