:root {
  --color-bg: #fff;
  --color-text: #1a1a1a;
  --color-line: #d0d0d0;
  --color-hover-bg: #f0f0f0;
  --color-hover-text: #1a1a1a;
  --color-active-bg: #e0e0e0;
  --color-active-text: #000;
  --color-bar-bg: #1a1a1a;
  --color-bar-text: #fff;
  --color-code-bg: #e8e8e8;
  --color-code-text: #1a1a1a;
  --color-shelf-posts-bg: #fafafa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #e0e0e0;
    --color-line: #2a2a2a;
    --color-hover-bg: #2a2a2a;
    --color-hover-text: #e0e0e0;
    --color-active-bg: #3a3a3a;
    --color-active-text: #fff;
    --color-bar-bg: #000;
    --color-bar-text: #e0e0e0;
    --color-code-bg: #0a0a0a;
    --color-code-text: #e0e0e0;
    --color-shelf-posts-bg: #222;
  }
}
html.theme-light {
  --color-bg: #fff;
  --color-text: #1a1a1a;
  --color-line: #d0d0d0;
  --color-hover-bg: #f0f0f0;
  --color-hover-text: #1a1a1a;
  --color-active-bg: #e0e0e0;
  --color-active-text: #000;
  --color-bar-bg: #1a1a1a;
  --color-bar-text: #fff;
  --color-code-bg: #e8e8e8;
  --color-code-text: #1a1a1a;
  --color-shelf-posts-bg: #fafafa;
}
html.theme-dark {
  --color-bg: #1a1a1a;
  --color-text: #e0e0e0;
  --color-line: #2a2a2a;
  --color-hover-bg: #2a2a2a;
  --color-hover-text: #e0e0e0;
  --color-active-bg: #3a3a3a;
  --color-active-text: #fff;
  --color-bar-bg: #000;
  --color-bar-text: #e0e0e0;
  --color-code-bg: #0a0a0a;
  --color-code-text: #e0e0e0;
  --color-shelf-posts-bg: #222;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  overscroll-behavior: none;
}
body {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a {
  color: var(--color-text);
  text-decoration: underline;
  transition: background-color 0.12s ease, color 0.12s ease;
}
a:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.topbar {
  height: 56px;
  background: var(--color-bar-bg);
  color: var(--color-bar-text);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: var(--color-bar-text);
  text-decoration: none;
}
.brand-title:hover,
.brand-title:focus {
  background: transparent;
  color: var(--color-bar-text);
  text-decoration: underline;
}
.brand-title:focus-visible {
  outline: none;
  text-decoration: underline;
}
.brand-sub {
  font-size: 12px;
  opacity: 0.7;
}
.topnav {
  display: flex;
  gap: 16px;
}
.nav-item {
  color: var(--color-bar-text);
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-item:hover,
.nav-item:focus {
  background: var(--color-bar-text);
  color: var(--color-bar-bg);
}
.nav-item:focus-visible {
  outline: none;
}
.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--color-bar-text);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover,
.theme-toggle:focus {
  background: transparent;
  color: var(--color-bar-text);
}
.theme-toggle:focus-visible {
  outline: none;
}
.theme-stack {
  position: relative;
  width: 28px;
  height: 22px;
  display: inline-block;
}
.theme-char {
  position: absolute;
  top: 50%;
  font-weight: bold;
  transition: font-size 0.12s ease, opacity 0.12s ease;
}
.theme-char[data-char="深"] {
  right: 0;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.35;
}
.theme-char[data-char="浅"] {
  left: 0;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 1;
}
html.theme-light .theme-char[data-char="深"] {
  right: 0;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.35;
}
html.theme-light .theme-char[data-char="浅"] {
  left: 0;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 1;
}
html.theme-dark .theme-char[data-char="深"] {
  left: 0;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 1;
}
html.theme-dark .theme-char[data-char="浅"] {
  right: 0;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.35;
}
@media (prefers-color-scheme: dark) {
  :root .theme-char[data-char="深"] {
    left: 0;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 1;
  }
  :root .theme-char[data-char="浅"] {
    right: 0;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.35;
  }
}
.main-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 56px);
}
.shelf {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--color-line);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.shelf-head {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: var(--color-text);
  padding: 20px 20px 16px 24px;
  border-bottom: 1px solid var(--color-line);
  position: relative;
}
.shelf-head::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 22px;
  bottom: 18px;
  width: 3px;
  background: var(--color-text);
}
.shelf-list {
  list-style: none;
}
.shelf-item {
  border-bottom: 1px solid var(--color-line);
}
.shelf-cat {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 14px 20px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.shelf-cat:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.shelf-cat.active {
  background: var(--color-active-bg);
  color: var(--color-active-text);
}
.cat-name {
  flex: 1;
}
.cat-count {
  font-size: 11px;
  font-weight: normal;
  opacity: 0.5;
  margin-left: 8px;
}
.shelf-posts {
  list-style: none;
  display: none;
  background: var(--color-shelf-posts-bg);
  border-top: 1px solid var(--color-line);
}
.shelf-item .shelf-posts.open {
  display: block;
}
.shelf-posts li {
  border-bottom: 1px solid var(--color-line);
}
.shelf-posts li:last-child {
  border-bottom: none;
}
.post-link {
  display: block;
  padding: 10px 20px 10px 32px;
  font-size: 12px;
  text-decoration: none;
  color: var(--color-text);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.post-link:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.post-link.current {
  background: var(--color-active-bg);
  color: var(--color-active-text);
  font-weight: bold;
}
.shelf-empty {
  padding: 20px;
  font-size: 12px;
  opacity: 0.5;
}
.content {
  flex: 1;
  padding: 40px 48px;
  min-width: 0;
}
.post-list {
  max-width: 720px;
}
.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-line);
}
.post-item:first-child {
  padding-top: 0;
}
.item-date {
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-bottom: 6px;
}
.item-title {
  font-size: 18px;
  font-weight: bold;
}
.item-title a {
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.item-title a:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.item-excerpt {
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.8;
}
.post {
  max-width: 720px;
}
.post-header {
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.post-title {
  font-size: 24px;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 12px;
}
.post-title a {
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.post-title a:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.post-meta {
  font-size: 12px;
  opacity: 0.7;
}
.meta-sep {
  margin: 0 8px;
}
.post-categories a,
.post-tags a {
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.post-categories a:hover,
.post-tags a:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.post-body {
  font-size: 14px;
  line-height: 1.7;
}
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  font-weight: bold;
  margin: 1.4em 0 0.6em;
  line-height: 1.3;
}
.post-body h1 {
  font-size: 20px;
  border-bottom: 2px solid var(--color-line);
  padding-bottom: 4px;
}
.post-body h2 {
  font-size: 17px;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 4px;
}
.post-body h3 {
  font-size: 15px;
}
.post-body p {
  margin: 0.8em 0;
}
.post-body ul,
.post-body ol {
  margin: 0.8em 0;
  padding-left: 1.4em;
}
.post-body li {
  margin: 0.3em 0;
}
.post-body blockquote {
  border-left: 3px solid var(--color-line);
  padding: 4px 12px;
  margin: 1em 0;
}
.post-body blockquote > p {
  margin: 0.4em 0;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: var(--color-active-bg);
  color: var(--color-active-text);
  padding: 1px 5px;
  font-size: 0.92em;
}
.post-body pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 1em 0;
  font-size: 13px;
  line-height: 1.5;
}
.post-body pre:focus {
  outline: none;
  background: var(--color-code-bg);
  color: var(--color-code-text);
}
.post-body pre:focus-visible {
  outline: none;
}
.post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.post-body figure.highlight {
  background: var(--color-code-bg);
  margin: 1em 0;
  overflow-x: auto;
}
.post-body figure.highlight:focus {
  outline: none;
  background: var(--color-code-bg);
}
.post-body figure.highlight:focus-visible {
  outline: none;
}
.post-body figure.highlight pre {
  background: transparent;
  margin: 0;
  padding: 0;
}
.post-body figure.highlight .gutter {
  display: none;
}
.post-body figure.highlight .code pre {
  padding: 14px 16px;
}
.post-body .hljs {
  background: var(--color-code-bg) !important;
}
.post-body table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
}
.post-body th,
.post-body td {
  border: 1px solid var(--color-line);
  padding: 6px 10px;
  text-align: left;
}
.post-body th {
  background: var(--color-active-bg);
  color: var(--color-active-text);
  font-weight: bold;
}
.post-body tr:hover td {
  background: var(--color-hover-bg);
}
.post-body figure.highlight td {
  border: none;
  padding: 0;
}
.post-body figure.highlight tr:hover td {
  background: transparent;
}
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--color-line);
}
.post-body a {
  text-decoration: underline;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.post-body a:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
  max-width: 720px;
}
.post-nav-cell {
  flex: 1;
}
.post-nav-cell.right {
  text-align: right;
}
.nav-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.6;
  margin-bottom: 4px;
}
.nav-link {
  font-size: 13px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-link:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
  max-width: 720px;
}
.pager-cell {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  font-weight: bold;
}
.pager-cell[aria-disabled="true"] {
  opacity: 0.3;
  pointer-events: none;
}
.archive {
  max-width: 720px;
}
.archive-title {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-line);
  margin-bottom: 20px;
}
.archive-year {
  font-size: 14px;
  font-weight: bold;
  margin: 20px 0 8px;
  padding: 4px 8px;
  background: var(--color-bar-bg);
  color: var(--color-bar-text);
  display: inline-block;
}
.archive-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-line);
}
.archive-date {
  font-size: 11px;
  opacity: 0.6;
  flex-shrink: 0;
  width: 60px;
}
.archive-link {
  font-size: 13px;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.archive-link:hover {
  background: var(--color-hover-bg);
  color: var(--color-hover-text);
}
.site-footer {
  border-top: 1px solid var(--color-line);
  padding: 16px 24px;
  font-size: 11px;
}
.footer-inner {
  display: flex;
  gap: 8px;
  align-items: center;
}
.footer-sep {
  opacity: 0.4;
}
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
    gap: 12px;
  }
  .topnav {
    gap: 10px;
  }
  .nav-item {
    padding: 4px 6px;
  }
  .main-layout {
    flex-direction: column;
  }
  .shelf {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-line);
  }
  .content {
    padding: 24px 16px;
  }
}
