/* --- Atom One Dark (highlight.js) --- */
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
}

code.hljs {
  padding: 3px 5px;
}

.hljs {
  color: #abb2bf;
  background: #282c34;
}

.hljs-comment,
.hljs-quote {
  color: #5c6370;
  font-style: italic;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula {
  color: #c678dd;
}

.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
  color: #e06c75;
}

.hljs-literal {
  color: #56b6c2;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
  color: #98c379;
}

.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
  color: #d19a66;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
  color: #61aeee;
}

.hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
  color: #e6c07b;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: bold;
}

.hljs-link {
  text-decoration: underline;
}

/* --- Code block layout (exclude mermaid) --- */
pre:not(.mermaid) {
  background: #282c34;
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  width: 100%;
}

pre.mermaid {
  background: #eee;
  padding: 0;
  border-radius: 0;
  overflow-x: auto;
  width: 100%;
}

/* --- highlight.js-line-numbers plugin --- */
.hljs-ln-numbers {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  text-align: center;
  color: #ccc;
  border-right: 1px solid #ccc;
  vertical-align: top;
  padding-right: 15px;
}

table.hljs-ln tr td.hljs-ln-numbers {
  padding-right: 0.5em;
  text-align: right;
}

table.hljs-ln tr td.hljs-ln-code {
  padding-left: 0.5em;
}

/* --- Code cards (all code blocks) --- */
.code-card {
  margin: 1rem 0;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  background: #282c34;
}

.code-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid #dee2e6;
}

.code-card__lang {
  font-size: 0.875rem;
  font-weight: 600;
  color: #abb2bf;
  text-transform: lowercase;
}

.code-card__tabs {
  display: flex;
  gap: 0;
}

.code-card__tab {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  color: #abb2bf;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.code-card__tab:hover {
  color: #e06c75;
  background: rgba(255, 255, 255, 0.06);
}

.code-card__tab--active {
  color: #61aeee;
  background: rgba(255, 255, 255, 0.08);
}

.code-card__body {
  padding: 0;
  overflow-x: auto;
}

.code-card__body pre {
  margin: 0;
  border-radius: 0;
}

.code-card__panel {
  display: block;
}

.code-card__panel[hidden] {
  display: none !important;
}

code {
  border: 1px solid #ccc;
  padding: 1px;
  border-radius: 3px;
  font-size: 1rem;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  background-color: rgba(221, 221, 221, 0.8666666667);
  color: #333;
  user-select: all;
}
code:hover {
  background-color: #fff;
  color: #000;
  border-color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
  z-index: 1;
}

.folder-index .folder-index__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.folder-index .folder-index__theme-toggle {
  background: #e8e8e8;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.folder-index .folder-index__theme-toggle:hover {
  background: #ddd;
}
.folder-index .folder-index__title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: #333;
}
.folder-index .folder-index__breadcrumb {
  margin-bottom: 1rem;
  color: #666;
  font-size: 0.95rem;
}
.folder-index .folder-index__breadcrumb a {
  color: #0066cc;
  text-decoration: none;
}
.folder-index .folder-index__breadcrumb a:hover {
  text-decoration: underline;
}
.folder-index .folder-index__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.2rem;
}
.folder-index .folder-index__table th, .folder-index .folder-index__table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}
.folder-index .folder-index__table th {
  background: #f5f5f5;
  font-weight: 600;
  color: #555;
}
.folder-index .folder-index__table tbody tr:nth-child(even) {
  background: #fafafa;
}
.folder-index .folder-index__table a {
  color: #0066cc;
  text-decoration: none;
}
.folder-index .folder-index__table a:hover {
  text-decoration: underline;
}
.folder-index.dark-mode {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem;
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 5rem !important;
}
.folder-index.dark-mode .folder-index__theme-toggle {
  background: #313244;
  border-color: #45475a;
  color: #cdd6f4;
}
.folder-index.dark-mode .folder-index__theme-toggle:hover {
  background: #45475a;
}
.folder-index.dark-mode .folder-index__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #89b4fa;
  font-weight: 600;
}
.folder-index.dark-mode .folder-index__breadcrumb {
  background: #2e2e3e;
  margin-bottom: 1rem;
  color: #a6adc8;
  font-size: 0.85rem;
}
.folder-index.dark-mode .folder-index__breadcrumb a {
  color: #89b4fa;
  text-decoration: none;
}
.folder-index.dark-mode .folder-index__breadcrumb a:hover {
  color: #b4befe;
  text-decoration: underline;
}
.folder-index.dark-mode .folder-index__table {
  width: 100%;
  border-collapse: collapse;
}
.folder-index.dark-mode .folder-index__table th, .folder-index.dark-mode .folder-index__table td {
  padding: 0.35rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #313244;
}
.folder-index.dark-mode .folder-index__table th {
  background: #2e2e3e;
  border-bottom: 3px solid #a6e3a1;
  color: #6c7086;
  font-weight: 600;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.folder-index.dark-mode .folder-index__table tbody tr:hover {
  background: #313244;
}
.folder-index.dark-mode .folder-index__table tbody tr:nth-child(even) {
  background: #2e2e3e;
}
.folder-index.dark-mode .folder-index__table a {
  color: #a6e3a1;
  text-decoration: none;
}
.folder-index.dark-mode .folder-index__table a:hover {
  color: #94e2d5;
  text-decoration: underline;
}
.folder-index.dark-mode .folder-index__table td:last-child {
  color: #6c7086;
  font-size: 1.1rem;
}