pre.highlight {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.45;
}
pre.highlight code {
  background: none;
  border: none;
  padding: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.hl-keyword {
  color: #d73a49;
}

.hl-string {
  color: #032f62;
}

.hl-string-special {
  color: #032f62;
  font-style: italic;
}

.hl-comment {
  color: #6a737d;
  font-style: italic;
}

.hl-function {
  color: #6f42c1;
}

.hl-function-builtin {
  color: #6f42c1;
}

.hl-function-macro {
  color: #6f42c1;
  font-weight: 600;
}

.hl-type {
  color: #005cc5;
}

.hl-type-builtin {
  color: #005cc5;
}

.hl-constant {
  color: #005cc5;
}

.hl-constant-builtin {
  color: #005cc5;
}

.hl-number {
  color: #005cc5;
}

.hl-constructor {
  color: #e36209;
}

.hl-variable {
  color: #24292e;
}

.hl-variable-builtin {
  color: #e36209;
}

.hl-variable-parameter {
  color: #e36209;
}

.hl-property {
  color: #005cc5;
}

.hl-label {
  color: #e36209;
}

.hl-attribute {
  color: #6a737d;
}

.hl-operator {
  color: #d73a49;
}

.hl-punctuation {
  color: #24292e;
}

.hl-punctuation-bracket {
  color: #24292e;
}

.hl-punctuation-delimiter {
  color: #24292e;
}

.hl-tag {
  color: #22863a;
}

pre:not(.highlight) {
  background-color: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
}
pre:not(.highlight) code {
  background: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875rem;
}

[data-theme=dark] pre.highlight {
  background-color: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.45;
}
[data-theme=dark] pre.highlight code {
  background: none;
  border: none;
  padding: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
[data-theme=dark] .hl-keyword {
  color: #cba6f7;
}
[data-theme=dark] .hl-string {
  color: #a6e3a1;
}
[data-theme=dark] .hl-string-special {
  color: #a6e3a1;
  font-style: italic;
}
[data-theme=dark] .hl-comment {
  color: #6c7086;
  font-style: italic;
}
[data-theme=dark] .hl-function {
  color: #89b4fa;
}
[data-theme=dark] .hl-function-builtin {
  color: #89b4fa;
}
[data-theme=dark] .hl-function-macro {
  color: #89b4fa;
  font-weight: 600;
}
[data-theme=dark] .hl-type {
  color: #f9e2af;
}
[data-theme=dark] .hl-type-builtin {
  color: #f9e2af;
}
[data-theme=dark] .hl-constant {
  color: #fab387;
}
[data-theme=dark] .hl-constant-builtin {
  color: #fab387;
}
[data-theme=dark] .hl-number {
  color: #fab387;
}
[data-theme=dark] .hl-constructor {
  color: #f38ba8;
}
[data-theme=dark] .hl-variable {
  color: #cdd6f4;
}
[data-theme=dark] .hl-variable-builtin {
  color: #f38ba8;
}
[data-theme=dark] .hl-variable-parameter {
  color: #eba0ac;
}
[data-theme=dark] .hl-property {
  color: #89dceb;
}
[data-theme=dark] .hl-label {
  color: #f38ba8;
}
[data-theme=dark] .hl-attribute {
  color: #6c7086;
}
[data-theme=dark] .hl-operator {
  color: #89dceb;
}
[data-theme=dark] .hl-punctuation {
  color: #9399b2;
}
[data-theme=dark] .hl-punctuation-bracket {
  color: #9399b2;
}
[data-theme=dark] .hl-punctuation-delimiter {
  color: #9399b2;
}
[data-theme=dark] .hl-tag {
  color: #a6e3a1;
}
[data-theme=dark] pre:not(.highlight) {
  background-color: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
}
[data-theme=dark] pre:not(.highlight) code {
  background: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875rem;
}

:root,
[data-theme=light] {
  --color-text: #333;
  --color-text-light: #666;
  --color-text-lighter: #999;
  --color-link: #2a7ae2;
  --color-link-hover: #1a5fb4;
  --color-bg: #fff;
  --color-bg-soft: #fafafa;
  --color-border: #e2e2e2;
  --color-border-light: #f0f0f0;
  --color-accent: #2a7ae2;
  --color-accent-subtle: #eef4fc;
  --font-body: "Georgia", "Times New Roman", serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 720px;
}

[data-theme=dark] {
  --color-text: #d4d4d4;
  --color-text-light: #a0a0a0;
  --color-text-lighter: #777;
  --color-link: #6ba3f7;
  --color-link-hover: #8dbaFF;
  --color-bg: #1a1a1a;
  --color-bg-soft: #242424;
  --color-border: #3a3a3a;
  --color-border-light: #2e2e2e;
  --color-accent: #6ba3f7;
  --color-accent-subtle: #1e2a3a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.theme-toggle {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  color: var(--color-text-light);
  transition: border-color 0.2s, color 0.2s;
  margin-top: 0.2rem;
}
.theme-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

header h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
header h1 a {
  color: var(--color-text);
}
header h1 a:hover {
  text-decoration: none;
  color: var(--color-link);
}

header h2 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-top: 0.35rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.page-list {
  list-style: none;
  padding: 0;
}
.page-list li {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-light);
}
.page-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.page-list li a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.page-list li a:hover {
  text-decoration: none;
}
.page-list li a:hover h3 {
  color: var(--color-link);
}
.page-list li h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  transition: color 0.15s ease;
}
.page-list li .meta {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-text-lighter);
  margin-bottom: 0.5rem;
}
.page-list li .summary {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.55;
}

article h1, article h2, article h3, article h4, article h5, article h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--color-text);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}
article h1:first-child, article h2:first-child, article h3:first-child, article h4:first-child, article h5:first-child, article h6:first-child {
  margin-top: 0;
}
article h1 {
  font-size: 1.75rem;
  font-weight: 700;
}
article h2 {
  font-size: 1.45rem;
  font-weight: 700;
}
article h3 {
  font-size: 1.2rem;
  font-weight: 600;
}
article h4 {
  font-size: 1.05rem;
  font-weight: 600;
}
article p {
  margin-bottom: 1.2em;
}
article ul, article ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}
article li {
  margin-bottom: 0.4em;
}
article blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  color: var(--color-text-light);
  background: var(--color-accent-subtle);
  border-radius: 0 4px 4px 0;
}
article blockquote p:last-child {
  margin-bottom: 0;
}
article img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}
article hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}
article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2em;
}
article table th, article table td {
  border: 1px solid var(--color-border);
  padding: 0.5em 0.75em;
  text-align: left;
}
article table th {
  background: var(--color-bg-soft);
  font-family: var(--font-heading);
  font-weight: 600;
}
article code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-soft);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
article .back-link {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--color-link);
}
article .back-link:hover {
  color: var(--color-link-hover);
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--color-border-light);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-text-lighter);
}
footer p {
  margin-bottom: 0.3rem;
}
footer p:last-child {
  margin-bottom: 0;
}
footer a {
  color: var(--color-text-light);
}
footer a:hover {
  color: var(--color-link);
}

.error-page {
  text-align: center;
  padding: 4rem 0;
}
.error-page h1 {
  font-family: var(--font-heading);
  font-size: 5rem;
  margin: 0;
  color: var(--color-border);
}
.error-page h2 {
  font-family: var(--font-heading);
  margin: 0 0 1rem;
}
.error-page a {
  color: var(--color-link);
}
