* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #1e2a3a;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.sidebar {
  width: 20%;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 2rem 1rem 2rem 1.5rem;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 2px 0 8px rgba(0,0,0,0.02);
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li {
  margin-bottom: 0.4rem;
}
.sidebar a {
  display: block;
  padding: 0.4rem 0.6rem;
  color: #2c3e50;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar a:hover {
  background: #eef6ff;
  color: #1a4d8f;
  border-left-color: #2a6bb0;
}
.sidebar a.active {
  background: #e1edfc;
  color: #1a4d8f;
  border-left-color: #1a4d8f;
  font-weight: 500;
}
.sidebar .toc-sub {
  padding-left: 1.2rem;
  font-size: 0.85rem;
}
.sidebar .toc-sub a {
  border-left-color: transparent;
}
.main-content {
  width: 80%;
  padding: 2rem 2.5rem 3rem;
  overflow-y: auto;
  background: #ffffff;
  height: 100vh;
}
.main-content .doc-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0b1e33;
  margin-bottom: 0.3rem;
  letter-spacing: -0.3px;
}
.main-content .doc-meta {
  color: #5e6f8d;
  font-size: 0.9rem;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 1.2rem;
  margin-bottom: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.main-content .doc-meta span {
  background: #f2f5f9;
  padding: 0.1rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
}
.main-content h1, .main-content h2, .main-content h3, .main-content h4 {
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}
.main-content h1 { font-size: 1.6rem; border-left: 4px solid #2a6bb0; padding-left: 0.8rem; }
.main-content h2 { font-size: 1.3rem; border-bottom: 1px solid #e4e9f2; padding-bottom: 0.3rem; }
.main-content h3 { font-size: 1.1rem; margin-top: 1.4rem; }
.main-content p {
  margin: 0.8rem 0;
  text-align: justify;
}
.main-content ul, .main-content ol {
  margin: 0.6rem 0 0.8rem 1.8rem;
}
.main-content li {
  margin-bottom: 0.25rem;
}
.main-content .highlight-box {
  background: #f8faff;
  border-left: 4px solid #2a6bb0;
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 6px 6px 0;
}
.main-content .bold {
  font-weight: 600;
}
.main-content .small-meta {
  color: #4a5b74;
  font-size: 0.9rem;
}
.main-content hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2rem 0;
}
.footer-bar {
  text-align: center;
  padding: 1rem 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #3d4e66;
  width: 100%;
  flex-shrink: 0;
}
.footer-bar a {
  color: #1a4d8f;
  text-decoration: none;
  font-weight: 500;
}
.footer-bar a:hover {
  text-decoration: underline;
}
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem;
    box-shadow: none;
  }
  .main-content {
    width: 100%;
    height: auto;
    padding: 1.5rem 1rem;
  }
  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.6rem;
  }
  .sidebar li {
    margin-bottom: 0;
  }
  .sidebar a {
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .sidebar a.active {
    border-left-color: transparent;
    border-bottom-color: #1a4d8f;
    background: transparent;
  }
}