:root {
  --brand: #2563eb;
  --brand-soft: #eaf1ff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  color: #0b3a82;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-link {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

.nav-link.active {
  color: var(--brand);
}

.search {
  margin-left: auto;
  position: relative;
  width: min(520px, 38vw);
}

.search input {
  width: 100%;
  height: 42px;
  border: 1px solid #d7deea;
  border-radius: 4px;
  padding: 0 42px 0 16px;
  font-size: 14px;
  outline: none;
}

.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-result-panel {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  padding: 8px;
}

.search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  color: #374151;
}

.search-result:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  min-height: calc(100vh - 72px);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  overflow: auto;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
}

.sidebar-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.category-link {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  color: #374151;
  font-size: 14px;
  line-height: 1.4;
}

.category-link:hover,
.category-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.main {
  padding: 36px 56px 72px;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  color: #9ca3af;
  font-size: 14px;
  margin-bottom: 32px;
}

.article-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: 0;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0 36px;
}

.doc-content {
  font-size: 16px;
  line-height: 1.9;
}

.doc-content h2 {
  margin: 42px 0 18px;
  font-size: 26px;
  line-height: 1.35;
}

.doc-content h3 {
  margin: 28px 0 12px;
  font-size: 20px;
}

.doc-content p {
  margin: 12px 0;
}

.doc-content img,
.doc-content video,
.doc-content iframe {
  max-width: 100%;
  border-radius: 6px;
}

.doc-content blockquote {
  margin: 18px 0;
  padding: 10px 18px;
  border-left: 4px solid #cfd8e6;
  color: #4b5563;
  background: var(--panel);
}

.post-list {
  display: grid;
  gap: 12px;
}

.post-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}

.post-card:hover {
  border-color: #bfcef5;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.post-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.rightbar {
  border-left: 1px solid var(--line);
  padding: 34px 28px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: auto;
}

.feedback-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.feedback-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 36px;
}

.feedback-actions button {
  height: 42px;
  border: 0;
  border-radius: 4px;
  background: #f3f5f9;
  color: #4b5563;
  font-weight: 600;
  cursor: pointer;
}

.toc {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.toc-link {
  display: block;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.5;
  padding: 7px 0 7px 14px;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--brand);
  border-left-color: var(--brand);
}

.toc-h3 {
  padding-left: 28px;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border-radius: 6px;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .rightbar {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 16px;
    gap: 14px;
  }

  .nav-link {
    display: none;
  }

  .search {
    width: 100%;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 28px 20px 56px;
  }

  .article-title {
    font-size: 30px;
  }
}
