:root {
  --accent: #1976d2;
  --accent-strong: #0f5ead;
  --ink: #1f2937;
  --muted: #64748b;
  --text-soft: #475569;
  --heading: #0f172a;
  --soft: #f8fafc;
  --panel: #ffffff;
  --panel-elevated: rgba(255, 255, 255, 0.96);
  --panel-elevated-hover: #ffffff;
  --sidebar-bg: rgba(248, 250, 252, 0.88);
  --floating-bg: rgba(255, 255, 255, 0.92);
  --toc-bg: rgba(255, 255, 255, 0.86);
  --avatar-bg: #ffffff;
  --avatar-border: rgba(255, 255, 255, 0.92);
  --code-text: #0f5ead;
  --code-bg: rgba(25, 118, 210, 0.08);
  --blockquote-text: #164e7a;
  --blockquote-bg: rgba(25, 118, 210, 0.06);
  --nav-hover-bg: rgba(25, 118, 210, 0.04);
  --nav-active-bg: rgba(25, 118, 210, 0.09);
  --nav-active-text: #0f5ead;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.16);
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.09);
  --image-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
  --overlay-bg: rgba(15, 23, 42, 0.42);
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --sans: "Plus Jakarta Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --accent: #7db7ff;
  --accent-strong: #b8d9ff;
  --ink: #e5edf8;
  --muted: #94a3b8;
  --text-soft: #b6c2d1;
  --heading: #f8fafc;
  --soft: #0f172a;
  --panel: #111c2d;
  --panel-elevated: rgba(17, 28, 45, 0.96);
  --panel-elevated-hover: #17243a;
  --sidebar-bg: rgba(15, 23, 42, 0.9);
  --floating-bg: rgba(17, 28, 45, 0.94);
  --toc-bg: rgba(17, 28, 45, 0.88);
  --avatar-bg: #18243a;
  --avatar-border: rgba(148, 163, 184, 0.32);
  --code-text: #9ccaff;
  --code-bg: rgba(125, 183, 255, 0.12);
  --blockquote-text: #c8e0ff;
  --blockquote-bg: rgba(125, 183, 255, 0.12);
  --nav-hover-bg: rgba(125, 183, 255, 0.1);
  --nav-active-bg: rgba(125, 183, 255, 0.16);
  --nav-active-text: #dbeafe;
  --line: rgba(226, 232, 240, 0.12);
  --line-strong: rgba(226, 232, 240, 0.2);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.34);
  --image-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  --overlay-bg: rgba(2, 6, 23, 0.68);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--soft);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body * {
  color: inherit;
}

* {
  letter-spacing: 0;
}

body,
.stream-container,
.side-container,
.extra-container,
.stream-container .post-list-container,
.stream-container .post-list-container .post-item-wrapper,
.single-column-drawer-container .drawer-content,
.single-column-nav-container .nav-background,
.theme-toggle,
.sidebar-collapse-toggle {
  transition: background-color 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, width 0.22s ease, padding 0.22s ease, opacity 0.18s ease, transform 0.18s ease;
}

a {
  color: var(--accent);
  text-underline-position: under;
}

a:hover {
  color: var(--accent-strong);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 800;
  transform: translateY(-140%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--soft);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;
  width: 0;
  height: 3px;
  background: var(--accent);
}

#backToTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--floating-bg);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#backToTop .material-icons,
#backToTop .pagination-action-icon {
  font-size: 20px;
  color: var(--accent);
}

.nav-menu-symbol,
.pagination-action-icon,
.meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  font-family: var(--sans);
  line-height: 1;
}

.nav-menu-symbol {
  font-size: 22px;
  font-weight: 700;
}

.pagination-action-icon {
  font-size: 24px;
}

.meta-icon {
  width: 1em;
  color: var(--muted);
  font-size: 0.92em;
  vertical-align: -0.05em;
}

.side-container {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
}

.sidebar-collapse-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--floating-bg);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  line-height: 1;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
  border-color: rgba(25, 118, 210, 0.32);
  color: var(--accent);
}

.sidebar-collapse-icon {
  color: currentColor;
  font-size: 22px;
}

@media screen and (min-width: 1021px) {
  html.sidebar-collapsed .side-container {
    width: 64px;
    padding: 16px 0;
    text-align: center;
  }

  html.sidebar-collapsed .stream-container {
    padding-left: 64px;
  }

  html.sidebar-collapsed .side-container .nav-head,
  html.sidebar-collapsed .side-container .theme-switcher,
  html.sidebar-collapsed .side-container .nav-link-list,
  html.sidebar-collapsed .side-container .nav-footer {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
  }

  html.sidebar-collapsed .side-container .sidebar-collapse-toggle {
    right: 12px;
  }
}

@media screen and (max-width: 1020px) {
  .sidebar-collapse-toggle {
    display: none;
  }
}

.side-container .nav-head,
.side-container .nav-link-list .nav-link-item,
.single-column-drawer-container .drawer-content .drawer-menu .drawer-menu-item {
  color: var(--ink) !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.side-container .nav-head .nav-title,
.single-column-header-title {
  color: var(--heading) !important;
  font-weight: 800;
}

.side-container .nav-head:hover,
.side-container .nav-link-list .nav-link-item:hover,
.single-column-drawer-container .drawer-content .drawer-menu .drawer-menu-item:hover {
  border-right-color: var(--accent) !important;
  background: var(--nav-hover-bg) !important;
  color: var(--nav-active-text) !important;
}

.side-container .nav-head.active,
.side-container .nav-link-list .nav-link-item.active,
.single-column-drawer-container .drawer-content .drawer-menu .drawer-menu-item.active {
  border-right-color: var(--accent) !important;
  background: var(--nav-active-bg) !important;
  color: var(--nav-active-text) !important;
}

.side-container .nav-head:hover *,
.side-container .nav-link-list .nav-link-item:hover *,
.single-column-drawer-container .drawer-content .drawer-menu .drawer-menu-item:hover *,
.side-container .nav-head.active *,
.side-container .nav-link-list .nav-link-item.active *,
.single-column-drawer-container .drawer-content .drawer-menu .drawer-menu-item.active * {
  color: inherit !important;
}

.site-avatar,
.mobile-site-avatar,
.drawer-avatar {
  display: block;
  object-fit: cover;
  border-radius: 50%;
  background: var(--avatar-bg);
  box-shadow: var(--shadow);
}

.site-avatar {
  width: 92px;
  height: 92px;
  margin: 0 0 18px auto;
  border: 3px solid var(--avatar-border);
}

.mobile-site-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  border: 3px solid var(--avatar-border);
}

.drawer-profile {
  padding: 0 30px 18px;
  text-align: center;
}

.drawer-avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border: 2px solid var(--avatar-border);
}

.drawer-title {
  color: var(--ink) !important;
  font-size: 15px;
  font-weight: 750;
}

.single-column-drawer-container .drawer-content {
  flex-direction: column;
  background: var(--panel);
}

.theme-switcher {
  display: flex;
  justify-content: flex-end;
  padding: 6px 28px 16px 20px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--floating-bg);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(25, 118, 210, 0.32);
  color: var(--accent);
}

.theme-toggle-icon {
  font-size: 20px;
  color: currentColor;
}

.single-column-header-container a,
.single-column-nav-container a {
  text-decoration: none !important;
}

.side-container .nav-head .nav-subtitle,
.single-column-header-subtitle {
  color: var(--muted) !important;
}

.side-container .nav-footer,
.side-container .nav-footer *,
#single-column-footer,
#single-column-footer * {
  color: var(--muted);
}

.extra-container {
  background: var(--soft);
  border-left: 1px solid var(--line);
}

.stream-container .post-list-container {
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stream-container .post-list-container-no-background {
  background: transparent;
  box-shadow: none;
  padding-top: 18px;
}

.stream-container .post-list-container .post-item-wrapper {
  margin: 0 16px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-elevated);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stream-container .post-list-container .post-item-wrapper:not(.post-item-wrapper-no-hover):hover {
  background: var(--panel-elevated-hover);
  border-color: rgba(25, 118, 210, 0.3);
  box-shadow: var(--shadow-hover);
}

.stream-container .post-list-container .post-item-wrapper .post-item {
  margin: 0;
  padding: 24px;
  gap: 20px;
}

.stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper .post-item-title {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 750;
}

.stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper .post-item-summary {
  color: var(--text-soft);
  line-height: 1.75;
}

.stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper .post-item-meta,
.stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper .post-item-meta * {
  color: var(--muted);
  font-size: 13px;
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(25, 118, 210, 0.1);
  color: var(--accent) !important;
  font-size: 12px !important;
}

.stream-container .post-list-container .post-item-wrapper .post-item .post-item-image-wrapper {
  flex: 0 0 auto;
  margin-left: 0;
}

.stream-container .post-list-container .post-item-wrapper .post-item .post-item-image-wrapper .post-item-image {
  width: 220px;
  height: 124px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.stream-container .post-list-container-shadow {
  border-radius: 0;
}

.stream-container .taxonomy-term-header {
  min-height: 0;
  padding-bottom: 0;
}

.stream-container .post .post-head-wrapper {
  min-height: 300px;
}

.stream-container .post .post-head-wrapper .post-title {
  font-weight: 780;
}

.stream-container .post .post-head-wrapper-text-only .post-title {
  color: var(--ink);
  font-weight: 780;
}

.stream-container .post .post-head-wrapper .post-title .post-subtitle,
.stream-container .post .post-head-wrapper-text-only .post-title .post-subtitle {
  width: auto;
  max-width: 720px;
  color: inherit;
  opacity: 0.78;
  line-height: 1.7 !important;
}

.stream-container .post .post-head-wrapper-text-only .post-title .post-subtitle {
  color: var(--muted);
}

.stream-container .post .post-head-wrapper-text-only .post-title .post-meta,
.stream-container .post .post-head-wrapper-text-only .post-title .post-meta *,
.stream-container .post .post-head-wrapper .post-title .post-meta,
.stream-container .post .post-head-wrapper .post-title .post-meta * {
  font-size: 13px;
}

.stream-container .post .post-body-wrapper .post-body {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.88;
}

.stream-container .post .post-body-wrapper .post-body p,
.stream-container .post .post-body-wrapper .post-body li,
.stream-container .post .post-body-wrapper .post-body td {
  color: var(--ink);
}

.stream-container .post .post-body-wrapper .post-body h1,
.stream-container .post .post-body-wrapper .post-body h2,
.stream-container .post .post-body-wrapper .post-body h3,
.stream-container .post .post-body-wrapper .post-body h4 {
  color: var(--heading);
  font-weight: 750;
  line-height: 1.35;
  margin-top: 1.8em;
}

.stream-container .post .post-body-wrapper .post-body h1 {
  font-size: 28px;
}

.stream-container .post .post-body-wrapper .post-body h2 {
  font-size: 24px;
}

.stream-container .post .post-body-wrapper .post-body h3 {
  font-size: 20px;
}

.stream-container .post .post-body-wrapper .post-body blockquote {
  border-left-color: var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--blockquote-bg);
}

.stream-container .post .post-body-wrapper .post-body blockquote,
.stream-container .post .post-body-wrapper .post-body blockquote * {
  color: var(--blockquote-text);
}

.stream-container .post .post-body-wrapper .post-body img {
  display: block;
  height: auto;
  margin: 16px auto;
  border-radius: 8px;
  box-shadow: var(--image-shadow);
  cursor: zoom-in;
}

code {
  font-family: var(--mono);
  color: var(--code-text);
  background: var(--code-bg);
}

pre,
figure.highlight {
  overflow-x: auto;
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: 8px;
  background: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

pre,
pre *,
figure.highlight,
figure.highlight * {
  color: #dbeafe;
  font-family: var(--mono) !important;
  font-size: 13px;
}

figure.highlight {
  margin: 18px 0;
}

figure.highlight table {
  width: 100%;
  margin: 0;
  table-layout: auto;
  border-collapse: collapse;
}

figure.highlight .gutter {
  width: 54px;
  padding: 12px 10px;
  background: rgba(15, 23, 42, 0.94);
  text-align: right;
  user-select: none;
}

figure.highlight .gutter span {
  color: rgba(219, 234, 254, 0.45);
}

figure.highlight .code {
  padding: 12px 14px;
}

figure.highlight pre {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.copy-code-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border: 1px solid rgba(219, 234, 254, 0.25);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-family: var(--mono);
  font-size: 11px;
}

.last-modified {
  color: var(--muted) !important;
  font-size: 14px;
}

.post-pagination {
  gap: 16px;
}

.post-pagination a {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-elevated);
  color: var(--muted);
}

.post-pagination a:hover {
  border-color: rgba(25, 118, 210, 0.32);
  color: var(--accent);
}

.toc {
  width: 260px;
  margin: 28px 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--toc-bg);
  box-shadow: var(--shadow-soft);
}

.toc-title {
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 750;
}

.toc-link {
  display: block;
  padding: 5px 0;
  color: var(--text-soft);
  line-height: 1.35;
  text-decoration: none;
}

.toc-level-3 {
  padding-left: 12px;
}

.toc-level-4 {
  padding-left: 24px;
}

.taxonomy-page,
.archive-page {
  padding: 36px;
}

.taxonomy-page h1,
.archive-page h1 {
  margin-top: 0;
  font-weight: 800;
  color: var(--ink);
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.taxonomy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-elevated);
  text-decoration: none;
}

.taxonomy-card span {
  color: var(--ink);
  font-weight: 650;
}

.taxonomy-card strong {
  color: var(--accent);
  font-family: var(--mono);
}

.archive-year {
  margin-top: 26px;
}

.archive-year h2 {
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 800;
}

.archive-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.archive-item time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.archive-item span {
  color: var(--ink);
  font-weight: 600;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.78);
}

.image-lightbox.is-visible {
  display: flex;
}

.image-lightbox__inner {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
}

.image-lightbox__img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 8px;
  background: var(--panel);
}

.image-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--floating-bg);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 24px;
  line-height: 1;
}

.lightbox-open {
  overflow: hidden;
}

.single-column-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: var(--overlay-bg);
}

@media screen and (max-width: 1020px) {
  .single-column-nav-container .navbar-brand {
    opacity: 1;
    color: var(--ink);
    font-weight: 750;
  }

  .single-column-nav-container .theme-toggle {
    padding: 0;
    margin-left: 8px;
  }

  .single-column-nav-container .nav-background {
    opacity: 0.94;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.08);
  }

  .single-column-header-container {
    padding: 72px 20px 42px;
  }

  .stream-container .post-list-container-no-background {
    padding: 0 12px;
  }

  .stream-container .post-list-container .post-item-wrapper {
    margin: 0 0 14px;
  }

  .stream-container .post-list-container .post-item-wrapper .post-item {
    padding: 0;
    gap: 0;
    border-radius: 8px;
  }

  .stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper {
    padding: 18px;
  }

  .stream-container .post-list-container .post-item-wrapper .post-item .post-item-info-wrapper .post-item-title {
    font-size: 20px;
  }

  .stream-container .post-list-container .post-item-wrapper .post-item .post-item-image-wrapper .post-item-image {
    width: 100%;
    height: 170px;
    border-radius: 8px 8px 0 0;
  }

  .stream-container .post .post-head-wrapper {
    min-height: 260px;
  }

  .taxonomy-page,
  .archive-page {
    padding: 24px 20px;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #backToTop {
    right: 16px;
    bottom: 76px;
  }
}
