:root {
  --primary-color: #2c3e50;
  --highlight-color: #2ecc71;
  --bg-color: #f9f9f9;
  --text-color: #333;
  --code-bg: #2d2d2d;
  --border-color: #ddd;
  --table-header-bg: #f2f2f2;
}
[data-theme="dark"] {
  --primary-color: #60a5fa;
  --highlight-color: #10b981;
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --code-bg: #2d2d2d;
  --border-color: #444;
  --table-header-bg: #333;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}
#home {
  font-size: 3rem;
  background: none;
  border: navajowhite;
  padding: 0;
  text-decoration: none;
}
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}
h1,
h2,
h3 {
  color: var(--primary-color);
  margin-top: 60px;
  scroll-margin-top: 80px;
}
h1 {
  text-align: center;
  margin-bottom: 40px;
}
ul,
ol {
  padding-left: 20px;
  line-height: 1.7;
  margin-top: 20px;
  margin-bottom: 40px;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 40px 0;
  overflow-x: auto;
  display: block;
}
@media (min-width: 768px) {
  table {
    display: table;
  }
}
th,
td {
  border: 1px solid var(--border-color);
  padding: 12px;
  text-align: center;
}
th {
  background-color: var(--table-header-bg);
}
pre {
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
  line-height: 1.6;
  margin-top: 20px;
  margin-bottom: 40px;
  background-color: var(--code-bg);
}
code:not([class*="language-"]) {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: Consolas, "Courier New", monospace;
}
hr {
  margin: 40px 0;
  border: none;
  border-top: 1px solid var(--border-color);
}
.highlight {
  background-color: rgba(46, 204, 113, 0.1);
  padding: 10px 20px;
  border-left: 5px solid var(--highlight-color);
  margin: 20px 0 40px 0;
  border-radius: 0 8px 8px 0;
}
.warning {
  background-color: rgba(231, 76, 60, 0.1);
  padding: 10px 20px;
  border-left: 5px solid #e74c3c;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}
.toc {
  background-color: rgba(52, 152, 219, 0.1);
  padding: 20px;
  border-radius: 8px;
  margin: 30px 0;
}
.toc ul {
  list-style-type: none;
  padding-left: 0;
}
.toc li {
  margin-bottom: 8px;
}
.toc a {
  color: var(--primary-color);
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}
.toc-sub {
  padding-left: 20px;
}
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1000;
}
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}
.code-playground {
  margin-bottom: 40px;
}
.code-playground textarea {
  width: 100%;
  height: 150px;
  font-family: Consolas, "Courier New", monospace;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: var(--code-bg);
  color: #f8f8f2;
  border: 1px solid var(--border-color);
}
.code-playground button {
  background-color: var(--highlight-color);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
}
.code-output {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
  min-height: 50px;
}
@media print {
  #theme-toggle,
  .back-to-top {
    display: none !important;
  }
  body {
    font-size: 12pt;
    background-color: white !important;
    color: black !important;
  }
  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }
  table,
  pre,
  .highlight,
  .warning,
  .toc {
    page-break-inside: avoid;
  }
  a {
    color: black !important;
    text-decoration: underline;
  }
}
