:root {
  --primary-color: #2E8555;
  --accent-color: #2E8555;
  --header-bg: #2E8555;
  --footer-bg: #1A1C32;
  --sidebar-bg: #F5F6F7;
  --bg-color: #FFFFFF;
  --text-color: #24292E;
  --border-color: #E1E4E8;
  --font-family: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-color);
  overscroll-behavior: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

/* Header */
header {
  height: 60px;
  background-color: var(--header-bg);
  color: white;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}

header .container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

header .logo {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  margin-left: 20px;
  opacity: 0.9;
  transition: opacity 0.2s;
  font-weight: 500;
}

nav a:hover {
  opacity: 1;
}

/* Page Layout */
.page-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  width: 300px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 20px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 0.9rem;
  color: #6A737D;
  text-transform: uppercase;
  padding: 0 20px 10px;
  margin: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li a {
  display: block;
  padding: 8px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
}

.sidebar li a:hover {
  background-color: rgba(46, 133, 85, 0.1);
  color: var(--primary-color);
}

.sidebar li.active a {
  color: var(--primary-color);
  font-weight: bold;
  border-left: 3px solid var(--primary-color);
  background-color: rgba(46, 133, 85, 0.05);
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px 60px;
  max-width: 800px;
}

/* Table of Contents */
.toc {
  width: 250px;
  padding: 40px 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.toc h4 {
  font-size: 0.8rem;
  color: #6A737D;
  text-transform: uppercase;
  margin: 0 0 16px;
  letter-spacing: 0.05em;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border-color);
}

.toc li a {
  display: block;
  padding: 4px 16px;
  color: #586069;
  text-decoration: none;
  font-size: 13px;
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.toc li a:hover {
  color: var(--primary-color);
}

/* Global Links */
a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.main-content h1 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.main-content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

/* Code Blocks */
/**
 * Prism.js Tomorrow Night theme
 * Based on https://github.com/chriskempson/tomorrow-theme
 */
code[class*="language-"],
pre[class*="language-"] {
  color: #ccc;
  background: none;
  font-family: var(--mono-font);
  font-size: 14px;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1em;
  margin: .5em 0;
  overflow: auto;
  border-radius: 6px;
}

:not(pre)>code[class*="language-"],
pre[class*="language-"] {
  background: #2d2d2d;
}

/* Inline code */
:not(pre)>code[class*="language-"] {
  padding: .1em;
  border-radius: .3em;
  white-space: normal;
}

.token.comment,
.token.block-comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #999;
}

.token.punctuation {
  color: #ccc;
}

.token.tag,
.token.attr-name,
.token.namespace,
.token.deleted {
  color: #e2777a;
}

.token.function-name {
  color: #6196cc;
}

.token.boolean,
.token.number,
.token.function {
  color: #f08d49;
}

.token.property,
.token.class-name,
.token.constant,
.token.symbol {
  color: #f8c555;
}

.token.selector,
.token.important,
.token.atrule,
.token.keyword,
.token.builtin {
  color: #cc99cd;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
  color: #7ec699;
}

.token.operator,
.token.entity,
.token.url {
  color: #67cdcc;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

.token.entity {
  cursor: help;
}

.token.inserted {
  color: green;
}

.description pre {
  background-color: #F7F9FA;
  color: #24292E;
  border: 1px solid var(--border-color);
}

code {
  font-family: var(--mono-font);
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: #8b949e;
  padding: 3rem 0;
}

footer .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
}

/* Mobile Problems List (Homepage) */
.mobile-problems {
  display: none;
}

/* Responsive */
@media (max-width: 1000px) {
  .mobile-problems {
    display: block;
  }

  .sidebar,
  .toc {
    display: none;
  }

  .main-content {
    padding: 20px;
    width: 100%;
    max-width: 100%;
  }

  header .container {
    padding: 0 15px;
  }

  header .logo span {
    font-size: 1.1rem;
  }
}