/* ============================================================
   pilog — pixel / minimal theme
   Palette borrowed from the Chrome offline dino screen:
   #f7f7f7 paper · #3c4043 ink · #5f6368 text · #9aa0a6 mute
   #dadce0 hairline · #f1f3f4 panel · #1a73e8 accent
   ============================================================ */

:root {
  --paper: #f7f7f7;
  --panel: #f1f3f4;
  --hairline: #dadce0;
  --ink: #3c4043;
  --text: #5f6368;
  --mute: #9aa0a6;
  --shadow: #e8eaed;
  --accent: #1a73e8;
  --highlight: #fbbc04;
  --font-sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas,
    "Courier New", monospace;
  --border: 2px solid var(--ink);
  --shadow-px: 5px 5px 0 0 var(--shadow);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: var(--border);
  background: var(--paper);
}

.header-banner {
  height: 150px;
  background-size: cover;
  background-position: center top;
  background-color: var(--panel);
  border-bottom: var(--border);
  image-rendering: auto;
}

.header-banner.is-default {
  height: 120px;
  background-size: auto 100%;
  background-repeat: repeat-x;
  background-position: left top;
  image-rendering: pixelated;
}

/* ---------- side decorations ---------- */

.deco {
  position: fixed;
  bottom: 28px;
  width: 120px;
  height: 240px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom center;
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
  image-rendering: pixelated;
}

.deco-left {
  left: max(14px, calc(50% - 720px));
  background-image: url("../img/deco-left.svg");
}

.deco-right {
  right: max(14px, calc(50% - 720px));
  background-image: url("../img/deco-right.svg");
}

@media (max-width: 1360px) {
  .deco {
    display: none;
  }
}

.header-row {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  image-rendering: pixelated;
  width: 28px;
  height: 30px;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.view-switch {
  display: flex;
  margin-left: auto;
}

.view-tab {
  appearance: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 7px 16px;
  border: var(--border);
  border-right-width: 1px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  transition: background 90ms linear, color 90ms linear;
}

.view-tab:first-child {
  border-right-width: 1px;
}

.view-tab:last-child {
  border-right-width: 2px;
}

.view-tab + .view-tab {
  margin-left: -2px;
}

.view-tab:hover {
  background: var(--panel);
}

.view-tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- search ---------- */

.search-wrap {
  position: relative;
  margin-left: 4px;
}

#search-input {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 6px 10px;
  width: 240px;
  outline: none;
}

#search-input::placeholder {
  color: var(--mute);
}

#search-input:focus {
  background: #fff;
  box-shadow: 3px 3px 0 0 var(--shadow);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  z-index: 90;
  max-height: 420px;
  overflow-y: auto;
}

.search-item {
  display: block;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}

.search-item:hover,
.search-item.is-active {
  background: var(--panel);
  text-decoration: none;
}

.search-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
}

.search-snip {
  display: block;
  font-size: 12px;
  color: var(--text);
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--mute);
}

.search-tag {
  cursor: pointer;
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
}

.search-tag:hover {
  background: var(--accent);
  color: var(--paper);
}

.search-item mark {
  background: var(--highlight);
  color: var(--ink);
  padding: 0 2px;
}

.search-empty {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  text-align: center;
}

.search-empty-img {
  display: block;
  width: 48px;
  margin: 8px auto 2px;
  image-rendering: pixelated;
}

.socials {
  display: flex;
  gap: 4px;
  align-items: center;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  color: var(--text);
}

.social-icon:hover {
  color: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
  background: var(--panel);
}

/* ---------- nav (from nav.md) ---------- */

.site-nav {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--panel);
}

.site-nav > div,
.site-nav > p,
.site-nav h1,
.site-nav h2,
.site-nav h3,
.site-nav h4,
.site-nav h5,
.site-nav h6 {
  display: none;
}

.site-nav ul {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
  list-style: none;
  display: flex;
  gap: 0;
  position: relative;
}

.site-nav > ul > li {
  position: relative;
}

.site-nav li a {
  display: inline-block;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

.site-nav li a:hover {
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.site-nav li + li a::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--mute);
}

.site-nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 150px;
  padding: 4px;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  z-index: 30;
}

.site-nav li:hover > ul {
  display: block;
}

.site-nav li ul li {
  display: block;
}

.site-nav li ul li a {
  display: block;
  padding: 6px 10px;
}

/* ---------- main ---------- */

.site-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 22px 80px;
  min-height: 64vh;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pane-title {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  display: inline-block;
}

/* ---------- filter bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 18px;
  position: relative;
}

.filter-selected {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
}

.filter-more {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: none;
  border: 1px dashed var(--accent);
  padding: 2px 8px;
  cursor: pointer;
}

.filter-more-panel {
  position: absolute;
  top: 100%;
  left: 0;
  width: 340px;
  max-width: 100%;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}

.filter-more-panel[hidden] {
  display: none;
}

.filter-hint {
  position: absolute;
  z-index: 70;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--paper);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 4px 10px;
  opacity: 0;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.filter-hint.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.filter-more-panel input {
  font-family: var(--font-mono);
  font-size: 12px;
  border: 2px solid var(--hairline);
  padding: 5px 8px;
  background: var(--paper);
  color: var(--ink);
}

.filter-more-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 2px 4px 2px 8px;
}

.sel-chip.sel-folder {
  background: var(--accent);
  border-color: var(--accent);
}

.sel-chip .sel-x {
  appearance: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
}

.sel-chip .sel-x:hover {
  color: var(--paper);
  opacity: 0.7;
}

.tag-chip.is-selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.folder-part {
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--mute);
  padding: 0 4px;
  cursor: pointer;
}

.folder-part:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.folder-part.is-selected {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

.folder-sep {
  color: var(--hairline);
}

/* ---------- tag filter ---------- */

.tag-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip,
.tag-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--text);
  padding: 2px 8px;
  cursor: pointer;
}

.filter-chip:hover,
.tag-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.tag-chip {
  appearance: none;
  display: inline-block;
  margin: 0 4px 4px 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  color: var(--text);
  padding: 2px 8px;
}

.tag-chip:hover {
  text-decoration: none;
}

/* ---------- cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  transition: transform 90ms linear, box-shadow 90ms linear;
}

.card::before,
.card::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  line-height: 1;
  z-index: 2;
}

.card::before {
  top: -9px;
  left: 8px;
}

.card::after {
  bottom: -9px;
  right: 8px;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 0 var(--shadow);
}

.card.is-highlight {
  border-color: var(--highlight);
  outline: 3px solid var(--highlight);
  outline-offset: -3px;
}

.card.is-cover {
  overflow: hidden;
}

.card.is-cover .card-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--panel);
}

.card.is-cover .card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(247, 247, 247, 0.6);
}

.card.is-cover .card-link {
  position: relative;
  z-index: 1;
}

.card.is-cover .card-body {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-link {
  display: flex;
  min-height: 190px;
  color: inherit;
}

.card-link:hover {
  text-decoration: none;
}

.card-body {
  flex: 1 1 auto;
  padding: 18px 18px 14px;
  min-width: 0;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.card-folder {
  color: var(--mute);
  border: 1px solid var(--hairline);
  padding: 0 5px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 6px;
  letter-spacing: 0.08em;
}

.card-title {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card-preview {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-preview p {
  margin: 0 0 6px;
}

.card-preview a,
.card-preview button {
  pointer-events: none;
}

.card-tags {
  margin-top: auto;
}

.card-thumb {
  flex: 0 0 132px;
  border-left: var(--border);
  background: var(--panel);
  min-height: 100%;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.empty-cards {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--mute);
  border: 1px dashed var(--hairline);
}

/* ---------- pager ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
}

.pager[hidden] {
  display: none;
}

.pager-info {
  font-size: 12px;
  color: var(--mute);
}

.pager-pages {
  display: flex;
  gap: 6px;
}

.pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.pager-page:hover {
  background: var(--panel);
  text-decoration: none;
}

.pager-page.is-current {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- tree view ---------- */

.tree-toolbar {
  display: flex;
  gap: 8px;
}

.pixel-btn {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  padding: 5px 12px;
  cursor: pointer;
  box-shadow: 3px 3px 0 0 var(--shadow);
}

.pixel-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--shadow);
}

.pixel-btn.is-on {
  background: var(--ink);
  color: var(--paper);
}

.pixel-btn.is-on:hover {
  background: var(--paper);
  color: var(--ink);
}

.tree-wrap {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  padding: 14px 18px;
  overflow-x: auto;
}

.tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 16.5px;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 24px;
  border-left: 1px solid var(--hairline);
  margin-left: 11px;
}

.tree .tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  color: var(--ink);
  white-space: nowrap;
  border: 1px solid transparent;
}

.tree a.tree-row:hover {
  background: var(--panel);
  border-color: var(--hairline);
  text-decoration: none;
}

.tree-file.is-highlight > .tree-row {
  outline: 3px solid var(--highlight);
  outline-offset: -3px;
  background: #fffbe8;
}

.tree-row.tree-flash {
  animation: tree-flash 1.6s ease;
}

@keyframes tree-flash {
  0%,
  100% {
    background: transparent;
    transform: scale(1);
  }
  25%,
  70% {
    background: #e8f0fe;
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.28);
  }
}

.tree-folder > .tree-row {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
}

.tree-folder > .tree-row:hover {
  background: var(--panel);
}

.tree-toggle {
  display: inline-block;
  width: 18px;
  font-size: 10px;
  color: var(--text);
}

.tree-toggle-empty {
  width: 18px;
}

.tree-icon {
  width: 20px;
  text-align: center;
  color: var(--text);
}

.tree-icon-img {
  width: 18px;
  height: 14px;
  image-rendering: pixelated;
  flex: none;
}

.tree-icon-file {
  height: 16px;
}

.tree-icon-folder {
  color: var(--mute);
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 660px;
}

.tree-date {
  margin-left: auto;
  padding-left: 18px;
  font-size: 13px;
  color: var(--mute);
}

.tree-folder:not(.is-open) > .tree-children {
  display: none;
}

.tree-folder:not(.is-open) > .tree-row .tree-toggle {
  transform: rotate(-90deg);
}

/* ---------- graph view ---------- */

.graph-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.graph-stats {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.graph-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  display: inline-block;
  width: 26px;
  border-top-width: 2px;
  border-top-style: solid;
}

.legend-hierarchy {
  border-top-color: var(--mute);
}

.legend-ref {
  border-top-color: var(--accent);
  border-top-style: dashed;
}

.legend-node {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
}

.legend-dir {
  background: var(--panel);
  border-color: var(--text);
}

.legend-highlight {
  background: #fff8e1;
  border-color: var(--highlight);
}

.graph-wrap {
  position: relative;
  height: 760px;
  background-color: var(--paper);
  background-image: radial-gradient(var(--hairline) 1.2px, transparent 1.2px);
  background-size: 14px 14px;
  border: var(--border);
  box-shadow: var(--shadow-px);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.graph-wrap:active {
  cursor: grabbing;
}

#graph-svg {
  width: 100%;
  height: 100%;
  display: block;
  shape-rendering: crispEdges;
}

.graph-node {
  cursor: pointer;
}

.graph-node rect {
  stroke-width: 2px;
  shape-rendering: crispEdges;
}

.graph-node text {
  font-family: var(--font-mono);
  font-size: 18px;
  fill: var(--ink);
  pointer-events: none;
}

.graph-link {
  stroke-width: 2px;
  stroke: var(--mute);
  shape-rendering: crispEdges;
}

.graph-link.ref {
  stroke: var(--accent);
  stroke-dasharray: 7 5;
  animation: dash-march 1.2s linear infinite;
}

.graph-env {
  fill: none;
  stroke: var(--mute);
  stroke-width: 2;
  stroke-dasharray: 3 7;
  opacity: 0.4;
  shape-rendering: crispEdges;
  pointer-events: none;
}

.graph-snake rect {
  shape-rendering: crispEdges;
}

.graph-flash {
  fill: rgba(26, 115, 232, 0.12);
  stroke: rgba(26, 115, 232, 0.5);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  shape-rendering: crispEdges;
  pointer-events: none;
  animation: graph-flash 1.8s ease-out forwards, dash-march 1.1s linear infinite;
}

@keyframes graph-flash {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}

@keyframes dash-march {
  to {
    stroke-dashoffset: -24;
  }
}

.graph-tip {
  position: absolute;
  z-index: 10;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  pointer-events: none;
  max-width: 280px;
}

.graph-tip b {
  display: block;
  margin-bottom: 2px;
}

.graph-tip span {
  color: var(--text);
}

.graph-hint {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mute);
  background: rgba(247, 247, 247, 0.85);
  padding: 2px 8px;
  border: 1px solid var(--hairline);
}

/* ---------- post page ---------- */

.post {
  max-width: 820px;
  margin: 0 auto;
}

.back-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

.post-title {
  font-size: 32px;
  line-height: 1.3;
  margin: 14px 0 10px;
  letter-spacing: 0.01em;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px;
}

.post-folder {
  margin-left: auto;
}

/* full-width feature/cover banner at the top of a post (调浅 = lightened) */
.post-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  background-color: var(--panel);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  margin: 0 0 26px;
  overflow: hidden;
}

.post-hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.comments-title {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  margin: 40px 0 16px;
  padding-top: 18px;
  border-top: var(--border);
}

/* ---------- markdown body ---------- */

.markdown-body {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.8;
  overflow-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.35;
  margin: 2em 0 0.7em;
  letter-spacing: 0.02em;
}

.markdown-body h1 {
  font-size: 28px;
  padding-bottom: 8px;
  border-bottom: 4px double var(--hairline);
}

.markdown-body h2 {
  font-size: 22px;
  border-left: 6px solid var(--ink);
  padding-left: 12px;
}

.markdown-body h3 {
  font-size: 17px;
}

.markdown-body h3::before {
  content: "## ";
  color: var(--mute);
}

.markdown-body h4 {
  font-size: 15px;
  color: var(--text);
}

.markdown-body p {
  margin: 0 0 1.1em;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin: 0 0 1.1em;
}

.markdown-body li {
  margin-bottom: 0.25em;
}

.markdown-body li::marker {
  font-family: var(--font-mono);
  color: var(--mute);
}

.markdown-body li.task-list-item {
  list-style: none;
  margin-left: -1.4em;
}

.markdown-body li.task-list-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
}

.markdown-body blockquote {
  margin: 0 0 1.1em;
  padding: 10px 16px;
  background: var(--panel);
  border-left: 5px solid var(--ink);
  color: var(--text);
}

.markdown-body blockquote p {
  margin: 0;
}

.markdown-body hr {
  border: none;
  border-top: 4px double var(--hairline);
  margin: 2em 0;
}

.markdown-body img {
  border: var(--border);
  background: var(--panel);
  display: block;
  margin: 1.2em auto;
}

.markdown-body img.pixelated,
.markdown-body img[style*="pixel"] {
  image-rendering: pixelated;
}

.markdown-body table {
  border-collapse: collapse;
  margin: 0 0 1.2em;
  width: 100%;
  font-size: 14.5px;
}

.markdown-body th,
.markdown-body td {
  border: 2px solid var(--ink);
  padding: 7px 12px;
  text-align: left;
}

.markdown-body th {
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.markdown-body tr:nth-child(even) td {
  background: #fbfbfb;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 1px 6px;
}

.markdown-body pre {
  background: var(--panel);
  border: var(--border);
  box-shadow: 4px 4px 0 0 var(--shadow);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1.2em;
  line-height: 1.55;
}

.markdown-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.markdown-body .footnote {
  font-size: 13px;
  color: var(--text);
}

.markdown-body .footnote-ref {
  font-family: var(--font-mono);
  font-size: 12px;
}

.markdown-body a {
  box-shadow: inset 0 -2px 0 var(--hairline);
}

.markdown-body a:hover {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Pygments token palette (minimal, matches the theme) */
.highlight .k, .highlight .kd, .highlight .kr, .highlight .kn,
.highlight .kt, .highlight .kp, .highlight .nc, .highlight .nt {
  color: var(--accent);
  font-weight: 700;
}
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb,
.highlight .sc, .highlight .sd, .highlight .se, .highlight .sh,
.highlight .si, .highlight .sx, .highlight .sr, .highlight .ss,
.highlight .dl {
  color: #188038;
}
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
.highlight .cp, .highlight .ch, .highlight .gd {
  color: var(--mute);
  font-style: italic;
}
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh,
.highlight .mn, .highlight .mo {
  color: #c5221f;
}
.highlight .nf, .highlight .fm, .highlight .nb, .highlight .bp {
  color: #b06000;
}
.highlight .o, .highlight .p, .highlight .ow, .highlight .ge {
  color: var(--text);
}
.highlight .na, .highlight .nv, .highlight .vc, .highlight .vg,
.highlight .vi, .highlight .nn {
  color: #5f6368;
}
.highlight .gh, .highlight .gu {
  font-weight: 700;
}
.highlight .gr, .highlight .gi {
  color: #c5221f;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: var(--border);
  background: var(--paper);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mute);
}

.footer-inner a {
  color: var(--text);
}

.footer-sep {
  color: var(--hairline);
}

/* ---------- dino widget ---------- */

.dino-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.dino-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  color: var(--ink);
  border: var(--border);
  padding: 6px 10px 6px 7px;
  cursor: pointer;
  box-shadow: var(--shadow-px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dino-toggle img {
  image-rendering: pixelated;
  width: 24px;
  height: 26px;
}

.dino-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}

.dino-toggle.is-open {
  background: var(--ink);
  color: var(--paper);
}

.dino-panel {
  width: min(618px, calc(100vw - 36px));
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-px);
}

.dino-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.dino-hint {
  font-size: 10px;
  color: var(--mute);
  margin-left: auto;
}

.dino-close {
  appearance: none;
  background: none;
  border: 1px solid var(--paper);
  color: var(--paper);
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.dino-close:hover {
  background: var(--paper);
  color: var(--ink);
}

.dino-frame {
  display: block;
  width: 100%;
  height: 240px;
  border: none;
  background: var(--paper);
}

/* ---------- 404 ---------- */

.notfound {
  text-align: center;
  padding: 60px 0;
}

.notfound-img {
  width: 64px;
  margin-bottom: 12px;
  image-rendering: pixelated;
}

.notfound-art {
  font-family: var(--font-mono);
  font-size: 88px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--paper);
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 6px 6px 0 var(--shadow);
}

.notfound-text {
  font-family: var(--font-mono);
  color: var(--text);
  margin: 18px 0 26px;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .header-row {
    gap: 10px;
  }

  .view-switch {
    margin-left: 0;
    order: 3;
    width: 100%;
  }

  .view-tab {
    flex: 1;
  }

  .search-wrap {
    order: 4;
    width: 100%;
  }

  #search-input {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .graph-wrap {
    height: 600px;
  }

  .brand-sub {
    display: none;
  }
}

@media (max-width: 520px) {
  .card-link {
    flex-direction: column;
  }

  .card-thumb {
    border-left: none;
    border-top: var(--border);
  }

  .card-thumb img {
    min-height: 0;
    max-height: 180px;
  }

  .post-title {
    font-size: 24px;
  }

  .tree-date {
    display: none;
  }

  .dino-panel {
    width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
