/* ==========================================================================
   VAULTEX HEXO THEME — Entry Point
   Imports all partials in dependency order.
   ========================================================================== */
/* 0. Web fonts (Inter + Source Code Pro) */
@font-face {
  font-family: 'Inter';
  src: url("../fonts/inter-latin-wght-normal.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url("../fonts/inter-latin-wght-italic.woff2") format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Source Code Pro';
  src: url("../fonts/source-code-pro-latin-400-normal.woff2") format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Code Pro';
  src: url("../fonts/source-code-pro-latin-500-normal.woff2") format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Code Pro';
  src: url("../fonts/source-code-pro-latin-700-normal.woff2") format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* 1. Design tokens */
:root {
/* --- Background layers (deepest → elevated) --- */
  --bg-base: #0d0d0d;
  --bg-secondary: #202020; /* sidebar bg */
  --bg-secondary-alt: #333; /* top bar bg */
  --bg-primary: #1a1a1a; /* main workspace */
  --bg-primary-alt: #161616; /* slightly lighter panels */
  --bg-hover: rgba(255,255,255,0.055);
  --bg-active: rgba(255,255,255,0.09);
  --bg-selected: rgba(127,109,242,0.18);
  --bg-code: #181818;
  --bg-code-inline: rgba(127,109,242,0.12);
  --bg-tag: rgba(72,54,153,0.14);
  --bg-table-header: rgba(255,255,255,0.06);
  --bg-table-alt: rgba(255,255,255,0.02);
  --bg-callout-note: rgba(127,109,242,0.08);
  --bg-callout-tip: rgba(34,197,94,0.08);
  --bg-callout-warn: rgba(234,179,8,0.08);
  --bg-callout-danger: rgba(239,68,68,0.08);
/* --- Overlays --- */
  --bg-overlay: rgba(0,0,0,0.65); /* sidebar overlay */
  --bg-overlay-modal: rgba(0,0,0,0.55); /* modal/QS backdrop */
/* --- Modals & tooltips --- */
  --bg-modal: #262626; /* modal/dialog surface */
  --bg-tooltip: #000; /* tooltip background */
/* --- Accent tints --- */
  --bg-mark: rgba(127,109,242,0.3); /* <mark> highlight */
  --bg-internal-link: rgba(127,109,242,0.06); /* internal link bg */
  --bg-tag-hover: rgba(127,109,242,0.25); /* tag pill hover */
  --border-accent: rgba(127,109,242,0.22); /* accent-color border */
/* --- Search --- */
  --bg-search-highlight: rgba(255,185,0,0.32); /* search match highlight */
/* --- Text --- */
  --text-normal: #dcddde;
  --text-muted: #999;
  --text-faint: #666;
  --text-on-accent: #fff;
  --text-accent: #7f6df2;
  --text-accent-hover: #8875ff;
  --text-success: #4caf76;
  --text-warning: #e3a84a;
  --text-danger: #e06c75;
  --text-link: #7f8ef2;
/* --- Accent (Obsidian purple) --- */
  --accent-color: #7f6df2;
  --accent-hover: #8875ff;
  --accent-active: #6050d4;
  --accent-interactive: #483699;
  --accent-interactive-hover: #4d3ca6;
/* --- Borders & dividers --- */
  --border-color: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --divider: rgba(255,255,255,0.06);
  --tree-guide: rgba(255,255,255,0.1);
/* --- Interactive states --- */
  --interactive-normal: rgba(255,255,255,0.04);
  --interactive-hover: rgba(255,255,255,0.07);
  --interactive-active: rgba(255,255,255,0.12);
/* --- Typography --- */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Microsoft YaHei Light", sans-serif;
  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Microsoft YaHei Light", sans-serif;
  --font-mono: "Source Code Pro", monospace;
  --font-size-base: 16px;
  --font-size-sm: 13px;
  --font-size-xs: 12px;
  --font-size-code: 14px;
  --line-height-normal: 1.7;
  --line-height-tight: 1.4;
  --line-height-code: 1.6;
/* --- Spacing --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
/* --- Layout --- */
  --activity-bar-width: 40px;
  --sidebar-left-width: 260px;
  --sidebar-right-width: 300px;
  --tab-bar-height: 38px;
  --content-max-width: 720px;
/* --- Radius --- */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 100px;
/* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.45);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.6);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.04);
/* --- Transitions --- */
  --t-fast: 80ms ease;
  --t-normal: 150ms ease;
  --t-slow: 250ms ease;
}
/* 2. Base reset & scrollbars */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-ui);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-normal);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* app shell: scrolling happens inside panels */
  height: 100dvh;
}
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover {
  color: var(--text-accent-hover);
}
a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  cursor: pointer;
  font-family: inherit;
}
ul,
ol {
  list-style: none;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
/* 3. App shell layout */
html[data-vx-left="closed"] .sidebar-left {
  width: 0;
  min-width: 0;
  border-right-width: 0;
  overflow: hidden;
}
html[data-vx-left="closed"] .tab-bar-left-spacer {
  width: var(--activity-bar-width);
  min-width: var(--activity-bar-width);
  border-right-color: transparent;
}
html[data-vx-left="closed"] .activity-bar {
  background: var(--bg-primary);
}
html[data-vx-right="open"] .sidebar-right {
  width: var(--sidebar-right-width);
  min-width: var(--sidebar-right-width);
  border-left-width: 1px;
}
html[data-vx-right="open"] .tab-bar-right-spacer {
  width: var(--sidebar-right-width);
  min-width: var(--sidebar-right-width);
  padding: 0 var(--sp-1);
}
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: var(--bg-base);
  overflow: hidden;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--t-slow);
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}
.activity-bar {
  width: var(--activity-bar-width);
  min-width: var(--activity-bar-width);
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2) 0;
  flex-shrink: 0;
  z-index: 11;
}
.activity-bar.sidebar-collapsed {
  background: var(--bg-primary);
  transition: background 200ms ease;
}
.btn-icon {
  width: 30px;
  height: 27px;
}
.activity-btn {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: color var(--t-fast), background var(--t-fast);
}
.activity-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.sidebar-left {
  width: var(--sidebar-left-width);
  min-width: var(--sidebar-left-width);
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--t-slow), min-width var(--t-slow), transform var(--t-slow);
  flex-shrink: 0;
  z-index: 10;
}
.sidebar-left.collapsed {
  width: 0;
  min-width: 0;
  border-right-width: 0;
  overflow: hidden;
}
.sidebar-left-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  width: var(--sidebar-left-width);
}
.workspace-row {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--bg-primary);
  overflow: hidden;
}
.tab-bar {
  display: flex;
  align-items: center;
  height: var(--tab-bar-height);
  background: var(--bg-secondary-alt);
  flex-shrink: 0;
  padding: 0;
  gap: 0;
  overflow: visible;
  position: relative;
  z-index: 1;
}
.tab-bar-left-spacer {
  width: calc(var(--activity-bar-width) + var(--sidebar-left-width));
  min-width: calc(var(--activity-bar-width) + var(--sidebar-left-width));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-1);
  overflow: hidden;
  transition: width var(--t-slow), min-width var(--t-slow), border-color var(--t-slow);
}
.tab-bar-left-spacer.spacer-collapsed {
  width: var(--activity-bar-width);
  min-width: var(--activity-bar-width);
  border-right-color: transparent;
}
#toggle-left {
  margin-right: 10px;
  margin-left: 2px;
}
#toggle-right {
  margin-right: var(--sp-2);
  flex-shrink: 0;
}
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  padding: var(--sp-1);
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
#toggle-left .icon-sidebar-close,
#toggle-right .icon-sidebar-close {
  display: none;
}
#toggle-left.active .icon-sidebar-open,
#toggle-right.active .icon-sidebar-open {
  display: none;
}
#toggle-left.active .icon-sidebar-close,
#toggle-right.active .icon-sidebar-close {
  display: block;
}
.tab-strip {
  flex: 1;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
  padding: 0 var(--sp-4);
}
.tab {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-2);
  height: 35px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
  font-size: var(--font-size-sm);
  color: var(--text-normal);
  white-space: nowrap;
  overflow: hidden;
  max-width: 200px;
  min-width: 200px;
  position: relative;
  margin-bottom: -1px;
  z-index: 2;
}
.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 12px;
}
.tab-close {
  position: absolute;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.tab-close:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.tab-bar-right-spacer {
  width: var(--sidebar-right-width);
  min-width: var(--sidebar-right-width);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-1);
  overflow: hidden;
  transition: width var(--t-slow), min-width var(--t-slow);
}
.tab-bar-right-spacer.spacer-collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
}
.content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content-nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 32px;
  padding: 0 var(--sp-2);
  flex-shrink: 0;
}
.content-nav-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: var(--sp-2);
}
.tab-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.tab-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.tab-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}
.content-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 0 var(--sp-2);
}
.breadcrumb-item {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--t-fast);
}
a.breadcrumb-item:hover {
  color: var(--text-normal);
}
.breadcrumb-current {
  color: var(--text-normal);
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb-sep {
  font-size: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
  user-select: none;
}
.note-view {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--sp-10) var(--sp-8);
}
.note-article,
.post-list,
.archive-list,
.categories-grid,
.tags-page-cloud,
.note-header + .post-list,
.note-header + .archive-list,
.vault-footer-bar {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}
.note-header {
  max-width: var(--content-max-width);
  margin: 0 auto var(--sp-6);
}
.sidebar-right {
  width: var(--sidebar-right-width);
  min-width: var(--sidebar-right-width);
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width var(--t-slow), min-width var(--t-slow);
}
.sidebar-right.collapsed {
  width: 0;
  min-width: 0;
  border-left-width: 0;
  overflow: hidden;
}
.sidebar-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  margin: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar-view-btn:hover {
  background: var(--bg-hover);
}
.sidebar-view-btn.active {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.right-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.right-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.right-tab-btn.active {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.sidebar-tab-content,
.right-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sidebar-tab-hidden,
.right-tab-hidden {
  display: none !important;
}
/* 4. Sidebar navigation */
.vault {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-2);
  flex-shrink: 0;
  min-height: var(--tab-bar-height);
}
.vault-header {
  border-bottom: 1px solid var(--divider);
}
.vault-footer {
  border-top: 1px solid var(--divider);
}
.vault-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.vault-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast);
}
.vault-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.vault-switcher-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.vault-switcher {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  color: var(--text-normal);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-family: var(--font-ui);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  overflow: hidden;
  transition: background var(--t-fast);
}
.vault-switcher:hover {
  background: var(--bg-hover);
}
.vault-switcher-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}
.vault-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-dropdown {
  position: absolute;
  left: var(--sp-1);
  bottom: calc(100% + var(--sp-2));
  min-width: 150px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
}
.vault-header .vault-dropdown {
  bottom: auto;
  top: calc(100% + var(--sp-2));
}
.vault-dropdown[hidden] {
  display: none;
}
.vault-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 2px var(--sp-2);
  margin: 5px;
  font-size: var(--font-size-sm);
  color: var(--text-normal);
  text-decoration: none;
  cursor: default;
  white-space: nowrap;
}
.vault-dropdown-manage {
  cursor: pointer;
  color: var(--text-norma);
}
.vault-dropdown-manage:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
  border-radius: var(--radius-sm);
}
.vault-dropdown-manage[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.vault-dropdown-current {
  justify-content: space-between;
  padding-left: var(--sp-4);
}
.vault-dropdown-check {
  color: var(--text-normal);
  flex-shrink: 0;
}
.vault-dropdown-sep {
  height: 1px;
  background: var(--divider);
  margin: var(--sp-1) 0;
}
.explorer-section {
  flex-shrink: 0;
}
.explorer-section:last-child {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.explorer-section-header {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4) 0px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}
.explorer-section-header:hover {
  color: var(--text-muted);
}
.explorer-section-header .chevron {
  transition: transform var(--t-fast);
  flex-shrink: 0;
  color: var(--text-faint);
}
.explorer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-2);
  flex-shrink: 0;
}
.explorer-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--t-fast), background var(--t-fast);
}
.explorer-action-btn:hover {
  color: var(--text-normal);
  background: var(--bg-hover);
}
.explorer-action-btn .icon-expand-svg {
  display: none;
}
.explorer-action-btn.is-expanded .icon-collapse-svg {
  display: none;
}
.explorer-action-btn.is-expanded .icon-expand-svg {
  display: block;
}
.explorer-style-1 .explorer-actions {
  display: none;
}
.explorer-style-1 .explorer-section-header {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-1);
  cursor: default;
  pointer-events: none;
}
.explorer-style-1 .explorer-section-header .chevron {
  display: none;
}
.explorer-style-1 .nav-tree {
  padding-top: 0;
}
.explorer-style-1 .nav-item::after {
  display: none !important;
}
.explorer-style-1 .nav-item.active {
  color: var(--text-on-accent);
}
.explorer-style-1 .nav-item.active::before {
  background: var(--accent-interactive);
}
.explorer-style-1 .nav-item.active .nav-icon-svg {
  opacity: 1;
}
.explorer-style-1 .nav-tree .nav-item:not([data-depth]) {
  padding-left: var(--sp-4);
}
.explorer-style-1 .nav-item[data-depth="0"] {
  padding-left: 16px !important;
}
.explorer-style-1 .nav-item[data-depth="1"] {
  padding-left: 36px !important;
}
.explorer-style-1 .nav-item[data-depth="2"] {
  padding-left: 56px !important;
}
.explorer-style-1 .nav-item[data-depth="3"] {
  padding-left: 76px !important;
}
.explorer-style-1 .tree-toggle-btn {
  display: none;
}
.explorer-style-1 .nav-leaf-icon {
  margin-left: 0;
}
.explorer-section-header.collapsed .chevron {
  transform: rotate(-90deg);
}
.nav-tree {
  padding: var(--sp-1) 0 var(--sp-2);
}
.nav-tree.section-hidden {
  display: none;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  line-height: 1.4;
  min-height: 26px;
}
.nav-item:hover {
  background: transparent;
  color: var(--text-normal);
}
.nav-item.active {
  background: transparent;
  color: var(--text-normal);
}
.nav-item:hover::before,
.nav-item.active::before {
  content: '';
  position: absolute;
  inset: 1px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: -1;
}
.nav-item:hover::before {
  background: var(--bg-hover);
}
.nav-item.active::before {
  background: var(--bg-hover);
}
.nav-icon-svg {
  flex-shrink: 0;
  color: inherit;
  opacity: 0.7;
}
.nav-item.active .nav-icon-svg {
  opacity: 1;
}
.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.nav-item.active .folder-icon {
  opacity: 1;
}
html[data-vx-init] .tree-chevron,
html[data-vx-init] .explorer-section-header .chevron {
  transition: none !important;
}
.nav-tree-parent {
  user-select: none;
}
.tree-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  margin-right: -3px;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-tree-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.nav-tree-label:hover {
  color: inherit;
}
.tree-chevron {
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.nav-tree-parent[data-tree-open="false"] .tree-chevron {
  transform: rotate(-90deg);
}
.nav-leaf-icon {
  opacity: 0.75;
  margin-left: 20px;
}
.nav-tree-leaf:hover .nav-leaf-icon {
  opacity: 1;
}
.nav-tree-leaf.active .nav-leaf-icon {
  opacity: 1;
}
.nav-item[data-depth="0"]::after,
.nav-item[data-depth="1"]::after,
.nav-item[data-depth="2"]::after,
.nav-item[data-depth="3"]::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: var(--tree-guide);
}
.nav-item[data-depth="0"]::after {
  left: 23px;
}
.nav-item[data-depth="1"]::after {
  left: 39px;
  box-shadow: -16px 0 0 var(--tree-guide);
}
.nav-item[data-depth="2"]::after {
  left: 55px;
  box-shadow: -32px 0 0 var(--tree-guide), -16px 0 0 var(--tree-guide);
}
.nav-item[data-depth="3"]::after {
  left: 71px;
  box-shadow: -48px 0 0 var(--tree-guide), -32px 0 0 var(--tree-guide), -16px 0 0 var(--tree-guide);
}
.nav-tree .nav-item:not([data-depth]) {
  padding-left: 52px;
}
.nav-tree .nav-item:not([data-depth])::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40px;
  width: 1px;
  pointer-events: none;
  box-shadow: -16px 0 0 var(--tree-guide);
}
/* 5. Right panel: TOC, tags, related */
.sidebar-right-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: var(--sidebar-right-width);
  overflow: hidden;
}
.right-tab-actions {
  padding: var(--sp-2) var(--sp-3);
  flex-shrink: 0;
}
.toc-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-2) 0;
}
.toc-empty {
  display: block;
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--font-size-xs);
  color: var(--text-faint);
}
.toc-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--sp-4) 3px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  line-height: 1.5;
  position: relative;
  isolation: isolate;
}
.toc-item:hover {
  color: var(--text-normal);
}
.toc-item.active {
  color: var(--text-accent);
  border-left-color: var(--accent-color);
}
.toc-item:hover::before,
.toc-item.active::before {
  content: '';
  position: absolute;
  inset: 1px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: -1;
}
.toc-item:hover::before {
  background: var(--bg-hover);
}
.toc-item.active::before {
  background: var(--bg-selected);
}
.toc-item[data-level="1"] {
  padding-left: 12px;
  font-weight: 600;
}
.toc-item[data-level="2"] {
  padding-left: 24px;
}
.toc-item[data-level="3"] {
  padding-left: 36px;
  font-size: 12px;
}
.toc-item[data-level="4"] {
  padding-left: 48px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.toc-item[data-level="5"] {
  padding-left: 60px;
  font-size: 11px;
  color: var(--text-faint);
}
.toc-item[data-level="6"] {
  padding-left: 72px;
  font-size: 11px;
  color: var(--text-faint);
}
.toc-item[data-level="2"]::after,
.toc-item[data-level="3"]::after,
.toc-item[data-level="4"]::after,
.toc-item[data-level="5"]::after,
.toc-item[data-level="6"]::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  pointer-events: none;
  background: var(--tree-guide);
}
.toc-item[data-level="2"]::after {
  left: 19px;
}
.toc-item[data-level="3"]::after {
  left: 31px;
  box-shadow: -12px 0 0 var(--tree-guide);
}
.toc-item[data-level="4"]::after {
  left: 43px;
  box-shadow: -12px 0 0 var(--tree-guide), -24px 0 0 var(--tree-guide);
}
.toc-item[data-level="5"]::after {
  left: 55px;
  box-shadow: -12px 0 0 var(--tree-guide), -24px 0 0 var(--tree-guide), -36px 0 0 var(--tree-guide);
}
.toc-item[data-level="6"]::after {
  left: 68px;
  box-shadow: -12px 0 0 var(--tree-guide), -24px 0 0 var(--tree-guide), -36px 0 0 var(--tree-guide), -48px 0 0 var(--tree-guide);
}
.toc-nav .tree-chevron {
  color: var(--text-faint);
}
.toc-parent[data-toc-open="false"] .tree-chevron {
  transform: rotate(-90deg);
}
.toc-chevron-spacer {
  display: inline-block;
  width: 15px;
  flex-shrink: 0;
}
.toc-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.right-related {
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
  padding-bottom: var(--sp-2);
}
.right-related-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.related-list {
  padding: 0 var(--sp-1);
}
.related-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast), color var(--t-fast);
  line-height: 1.4;
}
.related-item:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.related-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.6;
}
#tags-sort-dropdown {
  left: -65px;
}
.tags-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-1) 0;
}
.tags-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 3px var(--sp-4);
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  transition: color var(--t-fast), background var(--t-fast);
  position: relative;
  isolation: isolate;
}
.tags-list-item:hover {
  color: var(--text-normal);
}
.tags-list-item:hover::before {
  content: '';
  position: absolute;
  inset: 1px 8px;
  border-radius: 4px;
  background: var(--bg-hover);
  pointer-events: none;
  z-index: -1;
}
.tags-list-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tags-list-count {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.markdown-body h1.toc-heading-flash,
.markdown-body h2.toc-heading-flash,
.markdown-body h3.toc-heading-flash,
.markdown-body h4.toc-heading-flash,
.markdown-body h5.toc-heading-flash,
.markdown-body h6.toc-heading-flash {
  animation: toc-heading-flash 1.5s ease-out forwards;
}
@-moz-keyframes toc-heading-flash {
  0% {
    background: var(--bg-search-highlight);
    box-shadow: 0 0 0 4px var(--bg-search-highlight);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 4px transparent;
  }
}
@-webkit-keyframes toc-heading-flash {
  0% {
    background: var(--bg-search-highlight);
    box-shadow: 0 0 0 4px var(--bg-search-highlight);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 4px transparent;
  }
}
@-o-keyframes toc-heading-flash {
  0% {
    background: var(--bg-search-highlight);
    box-shadow: 0 0 0 4px var(--bg-search-highlight);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 4px transparent;
  }
}
@keyframes toc-heading-flash {
  0% {
    background: var(--bg-search-highlight);
    box-shadow: 0 0 0 4px var(--bg-search-highlight);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 4px transparent;
  }
}
/* 6. Shared UI components: tag pills, pagination, callouts */
.dropdown-wrap {
  position: relative;
}
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 185px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: var(--sp-1) 0;
}
.dropdown-right {
  left: auto;
  right: 0;
}
.dropdown[hidden] {
  display: none;
}
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--font-size-sm);
  font-family: var(--font-ui);
  color: var(--text-muted);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.dropdown-check {
  visibility: hidden;
  flex-shrink: 0;
}
.dropdown-item.active .dropdown-check {
  visibility: visible;
}
.dropdown-sep {
  height: 1px;
  background: var(--divider);
  margin: var(--sp-1) 0;
}
.vault-tooltip {
  position: fixed;
  z-index: 10000;
  background: var(--bg-tooltip);
  color: var(--text-normal);
  font-size: var(--font-size-xs);
  font-family: var(--font-ui);
  font-weight: 500;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-fast);
  transform: translateX(-50%);
}
.vault-tooltip.is-visible {
  opacity: 1;
}
.vault-tooltip::before {
  content: '';
  position: absolute;
  border: 5px solid transparent;
}
.vault-tooltip[data-dir="bottom"]::before {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--bg-tooltip);
}
.vault-tooltip[data-dir="right"]::before {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--bg-tooltip);
}
.vault-tooltip[data-dir="left"]::before {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--bg-tooltip);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  background: var(--bg-tag);
  color: var(--text-accent);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.tag-pill:hover {
  background: var(--bg-tag-hover);
  color: var(--text-accent-hover);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--divider);
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
}
.pagination-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-primary-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pagination-btn:hover:not(.disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-normal);
}
.pagination-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  text-decoration: none;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.pagination-page:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.pagination-page.active {
  background: var(--accent-color);
  color: var(--text-on-accent);
  font-weight: 600;
}
.pagination-ellipsis {
  color: var(--text-faint);
  width: 24px;
  text-align: center;
}
.callout {
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-color);
  background: var(--bg-callout-note);
  padding: var(--sp-4) var(--sp-5);
  margin: 1.2em 0;
}
.callout-title {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text-accent);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout-tip {
  border-left-color: var(--text-success);
  background: var(--bg-callout-tip);
}
.callout-tip .callout-title {
  color: var(--text-success);
}
.callout-warning {
  border-left-color: var(--text-warning);
  background: var(--bg-callout-warn);
}
.callout-warning .callout-title {
  color: var(--text-warning);
}
.callout-danger {
  border-left-color: var(--text-danger);
  background: var(--bg-callout-danger);
}
.callout-danger .callout-title {
  color: var(--text-danger);
}
.callout-info {
  border-left-color: var(--text-link);
  background: rgba(127,142,242,0.08);
}
.callout-info .callout-title {
  color: var(--text-link);
}
/* 7. Post list, archive, categories, tags pages */
.note-title.page-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-normal);
  margin-bottom: var(--sp-3);
}
.page-title-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg-active);
  border-radius: var(--radius-pill);
  padding: 2px var(--sp-3);
}
.note-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.posts-grid .post-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  max-width: 1280px;
}
.post-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary-alt);
  transition: border-color var(--t-normal), background var(--t-normal), box-shadow var(--t-normal);
}
.post-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.post-item-inner {
  padding: var(--sp-5) var(--sp-6);
}
.post-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--font-size-xs);
  color: var(--text-faint);
  margin-bottom: var(--sp-2);
}
.post-date {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
}
.post-category-sep {
  color: var(--border-strong);
}
.post-category {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  text-decoration: none;
  transition: color var(--t-fast);
}
.post-category:hover {
  color: var(--text-accent);
}
.post-reading-time {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
}
.post-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin-bottom: var(--sp-2);
}
.post-item-title a {
  color: var(--text-normal);
  text-decoration: none;
  transition: color var(--t-fast);
}
.post-item-title a:hover {
  color: var(--text-accent-hover);
}
.post-item-excerpt,
.post-item-excerpt p {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.post-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: nowrap;
}
.post-item-tags {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
  flex-shrink: 1;
  gap: var(--sp-1);
}
.tag-extra {
  flex-shrink: 0;
  color: var(--text-faint);
  border-color: transparent;
}
.read-more-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.read-more-link:hover {
  color: var(--text-accent);
}
.archive-list {
  margin-top: var(--sp-4);
}
.archive-year-group {
  margin-bottom: var(--sp-6);
}
.archive-year {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--divider);
}
.archive-year-count {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg-secondary-alt);
  border-radius: var(--radius-pill);
  padding: 1px var(--sp-2);
}
.archive-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
  font-size: var(--font-size-sm);
}
.archive-item:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.archive-item-date {
  font-size: var(--font-size-xs);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.archive-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  flex: 1;
}
.archive-item:hover .archive-item-title {
  color: var(--text-accent-hover);
}
.archive-item-cats {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.archive-cat-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-secondary-alt);
  border-radius: var(--radius-pill);
  padding: 0 var(--sp-2);
  white-space: nowrap;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.category-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-primary-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--t-normal), background var(--t-normal), transform var(--t-normal);
}
.category-card:hover {
  border-color: var(--accent-color);
  background: var(--bg-selected);
  transform: translateY(-1px);
}
.category-card-deep {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}
.category-card-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  width: 100%;
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--divider);
}
.breadcrumb-part {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.category-card-breadcrumb .breadcrumb-sep {
  opacity: 0.5;
}
.category-card:hover .breadcrumb-part,
.category-card:hover .breadcrumb-sep {
  color: var(--text-muted);
  opacity: 1;
}
.category-card-body {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
}
.category-card-icon {
  color: var(--accent-color);
  flex-shrink: 0;
}
.category-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.category-card-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-normal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-card-count {
  font-size: var(--font-size-xs);
  color: var(--text-faint);
}
.tags-page-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: baseline;
  margin-top: var(--sp-6);
  line-height: 2;
}
.tag-pill-weighted {
  transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.tag-pill-weighted:hover {
  opacity: 1 !important;
}
.tag-count {
  font-size: 0.7em;
  color: var(--text-faint);
  margin-left: 3px;
  vertical-align: super;
}
.vault-footer-bar {
  margin-top: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.vault-footer-sep {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.vault-footer-sep-line {
  flex: 1;
  height: 1px;
  background: var(--divider);
}
.vault-footer-sep-icon {
  color: var(--text-faint);
  flex-shrink: 0;
}
.vault-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-1);
}
.vault-footer-count {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--font-size-xs);
  color: var(--text-faint);
}
.vault-footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px var(--sp-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: color var(--t-normal), background var(--t-normal), border-color var(--t-normal), box-shadow var(--t-normal);
}
.vault-footer-link:hover {
  color: var(--text-accent);
  background: var(--bg-selected);
  border-color: var(--accent-interactive);
}
.post-item--has-thumb {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.post-item-thumb {
  display: block;
  flex: 0 0 140px;
  width: 140px;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}
.post-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform var(--t-normal);
}
.post-item--has-thumb:hover .post-item-thumb img {
  transform: scale(1.03);
}
.post-item--has-thumb .post-item-inner {
  flex: 1;
  min-width: 0;
}
.post-item--has-thumb-right {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.post-item--has-thumb-right .post-item-thumb {
  display: block;
  flex: 0 0 140px;
  width: 140px;
  overflow: hidden;
  border-left: 1px solid var(--border-color);
  order: 2;
}
.post-item--has-thumb-right .post-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform var(--t-normal);
}
.post-item--has-thumb-right:hover .post-item-thumb img {
  transform: scale(1.03);
}
.post-item--has-thumb-right .post-item-inner {
  flex: 1;
  min-width: 0;
  order: 1;
}
.post-item--has-thumb-inline .post-item-inner {
  display: block;
  overflow: hidden;
}
.post-item--has-thumb-inline .post-item-thumb {
  float: left;
  width: 110px;
  margin-right: var(--sp-4);
  margin-bottom: var(--sp-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.post-item--has-thumb-inline .post-item-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform var(--t-normal);
}
.post-item--has-thumb-inline:hover .post-item-thumb img {
  transform: scale(1.03);
}
.post-item--has-thumb-inline .post-item-footer {
  clear: left;
}
/* 8. Single post / page reading view */
.note-article {
  padding-bottom: var(--sp-12);
}
.note-header {
  margin-bottom: var(--sp-6);
}
.note-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-normal);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.01em;
}
.note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--font-size-sm);
  color: var(--text-faint);
  margin-bottom: var(--sp-3);
}
.note-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.note-meta-updated {
  font-style: italic;
}
.note-category {
  color: var(--text-muted);
  text-decoration: none;
}
.note-category:hover {
  color: var(--text-accent);
}
.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
.note-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--sp-6) 0;
}
.post-nav {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--divider);
}
.post-nav-item {
  flex: 1;
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--t-normal), background var(--t-normal);
}
.post-nav-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.post-nav-next {
  text-align: right;
}
.post-nav-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  color: var(--text-faint);
  font-weight: 500;
}
.post-nav-next .post-nav-label {
  justify-content: flex-end;
}
.post-nav-title {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}
.post-hero {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: var(--sp-6);
}
.post-hero-img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  object-position: center;
}
/* 9. Markdown body: headings, text, links, lists, blockquotes, tables, images */
.markdown-body {
  color: var(--text-normal);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-base);
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--text-normal);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  scroll-margin-top: 20px;
}
.markdown-body h1 {
  font-size: 1.75rem;
}
.markdown-body h2 {
  font-size: 1.4rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--divider);
}
.markdown-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
}
.markdown-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
}
.markdown-body h5 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.markdown-body h6 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-faint);
}
.markdown-body h1 a,
.markdown-body h2 a,
.markdown-body h3 a,
.markdown-body h4 a,
.markdown-body h5 a,
.markdown-body h6 a {
  color: inherit;
}
.markdown-body p {
  margin-bottom: 1em;
}
.markdown-body strong {
  font-weight: 700;
  color: var(--text-normal);
}
.markdown-body em {
  font-style: italic;
}
.markdown-body del {
  text-decoration: line-through;
  color: var(--text-muted);
}
.markdown-body mark {
  background: var(--bg-mark);
  color: var(--text-normal);
  border-radius: 2px;
  padding: 0 2px;
}
.markdown-body a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-color: rgba(127,142,242,0.35);
  text-underline-offset: 2px;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.markdown-body a:hover {
  color: var(--text-accent-hover);
  text-decoration-color: var(--text-accent-hover);
}
.markdown-body a[target="_blank"]::after {
  content: '↗';
  font-size: 0.7em;
  margin-left: 2px;
  vertical-align: super;
  opacity: 0.6;
}
.markdown-body a.internal-link {
  color: var(--text-accent);
  text-decoration-color: rgba(127,109,242,0.4);
  background: var(--bg-internal-link);
  border-radius: 3px;
  padding: 0 2px;
}
.markdown-body a.internal-link:hover {
  background: var(--bg-tag);
}
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--sp-8) 0;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin-bottom: 1em;
  list-style: revert;
}
.markdown-body li {
  margin-bottom: 0.25em;
}
.markdown-body li > ul,
.markdown-body li > ol {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}
.markdown-body ul {
  list-style-type: disc;
}
.markdown-body ul ul {
  list-style-type: circle;
}
.markdown-body ul ul ul {
  list-style-type: square;
}
.markdown-body input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--text-faint);
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  cursor: default;
  flex-shrink: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.markdown-body input[type="checkbox"]:checked {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.markdown-body input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: 1.5px solid var(--text-on-accent);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.markdown-body li.task-list-item {
  list-style: none;
  margin-left: -1.6em;
  padding-left: 1.6em;
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.markdown-body blockquote {
  margin: 1.2em 0;
  padding: 0.6em var(--sp-5);
  border-left: 3px solid var(--accent-color);
  background: rgba(127,109,242,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.markdown-body blockquote p {
  margin-bottom: 0;
}
.markdown-body blockquote > :last-child {
  margin-bottom: 0;
}
.markdown-body blockquote.callout-note {
  border-left-color: var(--accent-color);
  background: var(--bg-callout-note);
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: var(--font-size-sm);
  overflow-x: auto;
  display: block;
}
.markdown-body thead th {
  background: var(--bg-table-header);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-color);
  text-align: left;
}
.markdown-body tbody td {
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-color);
  color: var(--text-normal);
  vertical-align: top;
}
.markdown-body tbody tr:nth-child(even) {
  background: var(--bg-table-alt);
}
.markdown-body img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 1em auto;
}
.markdown-body figure {
  margin: 1.5em 0;
}
.markdown-body figcaption {
  font-size: var(--font-size-xs);
  color: var(--text-faint);
  margin-top: var(--sp-2);
  font-style: italic;
}
/* 10. Code blocks & syntax highlighting */
code {
  font-family: var(--font-mono);
  color: var(--text-accent);
  padding: 0;
}
pre {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 15px;
  padding-bottom: 0;
  line-height: 22px;
  border-radius: 4px;
  border: 1px dotted var(--border-strong);
  overflow-x: auto;
}
pre code {
  border: none;
  display: block;
  padding: 0;
}
.highlight {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 1.2em 0;
  overflow: hidden;
}
.highlight table {
  border: none;
  margin: 0;
  width: 100%;
}
.highlight table td {
  border: none;
  padding: 0;
}
.highlight .gutter {
  background: var(--bg-table-alt);
  border-right: 1px solid var(--divider);
  user-select: none;
  min-width: 40px;
}
.highlight .gutter pre {
  background: none;
  border: none;
  border-radius: 0;
  padding: var(--sp-4) var(--sp-3);
  font-size: var(--font-size-code);
  color: var(--text-faint);
  text-align: right;
  line-height: var(--line-height-code);
  margin: 0;
}
.highlight .code pre {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: var(--font-size-code);
  line-height: var(--line-height-code);
  margin: 0;
  overflow-x: auto;
}
.highlight .code pre code {
  display: block;
  min-width: 100%;
  padding: var(--sp-4) var(--sp-5);
  box-sizing: border-box;
}
.highlight .caption,
.highlight figcaption {
  padding: var(--sp-2) var(--sp-4);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--divider);
  font-size: var(--font-size-xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
}
/* 11. Search page */
.sidebar-search-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 12px 10px 10px 12px;
  flex-shrink: 0;
}
.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.search-icon-svg {
  color: var(--text-muted);
  flex-shrink: 0;
}
#search-input,
#tags-filter-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--text-normal);
  font-size: 13px;
  font-family: var(--font-ui);
  padding: 0;
}
#search-input::placeholder,
#tags-filter-input::placeholder {
  color: var(--text-faint);
}
#search-input::-webkit-search-cancel-button {
  display: none;
}
.search-btn-aa {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: var(--text-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 1px 3px;
  line-height: 1.4;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.search-btn-aa:hover {
  color: var(--text-normal);
  background-color: var(--bg-hover);
}
.search-btn-aa.active {
  color: var(--accent-color);
}
.search-btn-aa.active:hover {
  background: var(--bg-selected);
}
.search-btn-clear,
.search-btn-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--t-fast), background var(--t-fast);
}
.search-btn-filter {
  width: 28px;
  height: 25px;
}
.search-btn-clear[hidden] {
  display: none !important;
}
.search-btn-filter.active {
  color: var(--accent-color);
  background: var(--bg-selected);
}
.search-btn-clear:hover,
.search-btn-filter:not(.active):hover {
  color: var(--text-normal);
  background-color: var(--bg-hover);
}
.search-filter-panel {
  padding: var(--sp-1) var(--sp-3) var(--sp-2);
  flex-shrink: 0;
}
.search-filter-panel[hidden] {
  display: none;
}
.search-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 5px var(--sp-1);
  cursor: pointer;
  user-select: none;
}
.search-filter-label {
  font-size: var(--font-size-sm);
  color: var(--text-normal);
}
.toggle-wrap {
  position: relative;
  flex-shrink: 0;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  display: block;
  width: 34px;
  height: 19px;
  background: var(--interactive-active);
  border-radius: var(--radius-pill);
  position: relative;
  transition: background var(--t-fast);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform var(--t-fast), background var(--t-fast);
}
.toggle-input:checked ~ .toggle-track {
  background: var(--accent-color);
}
.toggle-input:checked ~ .toggle-track::after {
  transform: translateX(15px);
  background: var(--text-on-accent);
}
.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-1) 10px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  min-height: 27px;
  gap: 6px;
}
.search-toolbar[hidden] {
  display: none;
}
.search-count-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  margin: 0px 10px 10px;
  gap: 5px;
  line-height: 1;
}
.search-count-label:empty {
  display: none;
}
.search-sort-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin: 0 5px 10px;
  white-space: nowrap;
  transition: color var(--t-fast);
}
.search-sort-btn:hover {
  color: var(--text-normal);
}
.search-sort-btn span {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-search-results {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.sidebar-search-results:has(#search-no-results[hidden]) #search-results {
  padding-top: var(--sp-3);
}
.file-group-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background var(--t-fast);
}
.file-group-header:hover::before {
  content: '';
  position: absolute;
  inset: 1px var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  pointer-events: none;
  z-index: 0;
}
.file-group-header:hover {
  background: none;
}
.file-group-header > * {
  position: relative;
  z-index: 1;
}
.file-group-chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--t-fast);
}
.file-group[data-open="false"] .file-group-chevron {
  transform: rotate(-90deg);
}
.file-group-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-normal);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-group-name:hover {
  color: var(--text-normal);
}
.file-group-count {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
  min-width: 12px;
  text-align: right;
  padding-right: var(--sp-2);
}
.file-group[data-open="false"] .file-group-body {
  display: none;
}
.file-group-body {
  margin: 0 8px 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.match-card + .match-card {
  border-top: 1px solid var(--divider);
}
.match-card-link {
  display: block;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  text-decoration: none;
  word-break: break-word;
  transition: background var(--t-fast), color var(--t-fast);
}
.match-card-link:hover {
  background: var(--accent-interactive-hover);
  color: var(--text-normal);
}
em.search-highlight,
mark.search-highlight {
  background: var(--bg-search-highlight);
  color: var(--text-normal);
  font-style: normal;
  border-radius: 2px;
  padding: 0 1px;
}
#search-no-results {
  padding: var(--sp-1) var(--sp-6);
  color: var(--text-faint);
  font-size: var(--font-size-sm);
}
.search-scroll-highlight {
  animation: search-scroll-highlight 2.5s ease forwards;
  border-radius: var(--radius-sm);
}
@-moz-keyframes search-scroll-highlight {
  0%, 60% {
    background: var(--bg-search-highlight);
  }
  100% {
    background: transparent;
  }
}
@-webkit-keyframes search-scroll-highlight {
  0%, 60% {
    background: var(--bg-search-highlight);
  }
  100% {
    background: transparent;
  }
}
@-o-keyframes search-scroll-highlight {
  0%, 60% {
    background: var(--bg-search-highlight);
  }
  100% {
    background: transparent;
  }
}
@keyframes search-scroll-highlight {
  0%, 60% {
    background: var(--bg-search-highlight);
  }
  100% {
    background: transparent;
  }
}
/* 12. Responsive breakpoints, focus/a11y, reduced-motion */
@media (max-width: 1100px) {
  :root {
    --sidebar-right-width: 220px;
  }
}
@media (max-width: 900px) {
  .sidebar-right {
    position: fixed;
    right: 0;
    top: var(--tab-bar-height);
    bottom: 0;
    z-index: 100;
    width: var(--sidebar-right-width) !important;
    min-width: var(--sidebar-right-width) !important;
    box-shadow: var(--shadow-lg);
    transform: translateX(110%);
    visibility: hidden;
    transition: transform 250ms ease, visibility 0s ease 250ms;
  }
  .sidebar-right.mobile-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 250ms ease, visibility 0s ease 0s;
  }
}
@media (max-width: 768px) {
  body {
    overflow: auto;
  }
  .app-container {
    height: auto;
    min-height: 100dvh;
  }
  .sidebar-left {
    position: fixed;
    left: 0;
    top: var(--tab-bar-height);
    bottom: 0;
    height: auto; /* let top+bottom define height, not desktop's height:100% */
    z-index: 100;
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
    transition: transform var(--t-slow);
  }
  .sidebar-left.collapsed {
    width: var(--sidebar-left-width);
    min-width: var(--sidebar-left-width);
    transform: translateX(-100%);
    border-right-width: 1px;
    overflow: hidden;
  }
  .workspace-row {
    height: auto;
    min-height: calc(100dvh - var(--tab-bar-height));
    flex-direction: column;
    overflow: visible;
  }
  .note-view {
    overflow-y: visible;
    padding: var(--sp-6) var(--sp-4);
  }
  .note-title {
    font-size: 1.5rem;
  }
  .note-title.page-title {
    font-size: 1.3rem;
  }
  .posts-grid .post-list {
    grid-template-columns: 1fr;
  }
  .post-item-inner {
    padding: var(--sp-4);
  }
  .archive-item {
    grid-template-columns: 70px 1fr;
  }
  .archive-item-cats {
    display: none;
  }
  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tab-bar-left-spacer {
    width: var(--activity-bar-width);
    min-width: var(--activity-bar-width);
    border-right-color: transparent;
  }
  .tab {
    max-width: 180px;
  }
  .pagination {
    gap: var(--sp-1);
  }
  .pagination-btn {
    padding: var(--sp-2);
    font-size: var(--font-size-xs);
  }
  .post-item--has-thumb,
  .post-item--has-thumb-right {
    flex-direction: column;
  }
  .post-item--has-thumb-right .post-item-thumb {
    order: 0;
  }
  .post-item--has-thumb-right .post-item-inner {
    order: 1;
  }
  .post-item-thumb {
    flex: none;
    width: 100%;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
  }
  .post-item-thumb img {
    height: auto;
    aspect-ratio: 4/3;
  }
  .post-item--has-thumb-inline .post-item-thumb {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
  }
  .post-item--has-thumb-inline .post-item-footer {
    clear: none;
  }
}
@media (max-width: 480px) {
  .note-view {
    padding: var(--sp-5) var(--sp-3);
  }
  .categories-grid {
    grid-template-columns: 1fr;
  }
  .tab {
    max-width: 140px;
    font-size: var(--font-size-xs);
  }
  .markdown-body pre {
    font-size: 13px;
  }
  .highlight .code pre,
  .highlight .gutter pre {
    font-size: 13px;
  }
}
:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
/* 13. Print styles */
@media print {
  .sidebar-left,
  .sidebar-right,
  .tab-bar,
  .post-nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    overflow: auto;
  }
  .note-view {
    overflow: visible;
    padding: 0;
  }
  .markdown-body a {
    color: inherit;
  }
  .markdown-body a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    color: #666;
  }
}
/* 14. Help modal */
.hm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hm-backdrop[hidden] {
  display: none;
}
.hm-window {
  position: relative;
  width: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
}
.hm-chrome {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  z-index: 1;
}
.hm-chrome-btn {
  width: 24px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.hm-chrome-btn:hover {
  background: var(--bg-hover);
  color: var(--text-normal);
}
.hm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 28px 30px;
}
.hm-gem {
  display: block;
}
.hm-title {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-normal);
  letter-spacing: 0.01em;
}
.hm-version {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.hm-panel {
  margin: 0 55px 55px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.hm-row-sep {
  height: 1px;
  background: var(--divider);
  margin: 0 16px;
}
.hm-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
}
.hm-row-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.hm-row-body {
  flex: 1;
  min-width: 0;
}
.hm-row-title {
  font-size: 14px;
  color: var(--text-normal);
  margin-bottom: 4px;
}
.hm-row-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hm-row-desc strong {
  color: var(--text-normal);
  font-weight: 600;
}
.hm-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 5px;
  border: none;
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.hm-btn-accent {
  background: var(--accent-color);
  color: var(--text-on-accent);
}
.hm-btn-accent:hover {
  background: var(--accent-hover);
  color: var(--text-on-accent);
}
.hm-btn-gray {
  background: var(--bg-secondary-alt);
  color: var(--text-normal);
}
.hm-btn-gray:hover {
  background: #4a4a4a;
  border-color: #5a5a5a;
  color: var(--text-normal);
}
/* 15. Quick switcher */
.qs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-overlay-modal);
  align-items: flex-start;
  justify-content: center;
  padding-top: 4vh;
}
.qs-backdrop.qs-open {
  display: flex;
}
.qs-modal {
  width: 100%;
  max-width: 760px;
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.qs-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--divider);
}
.qs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-normal);
  font-size: 15px;
  font-family: var(--font-ui);
  padding: 12px 44px 12px 16px;
  caret-color: var(--accent-color);
}
.qs-input::placeholder {
  color: var(--text-faint);
}
.qs-clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast);
}
.qs-clear-btn:hover {
  color: var(--text-normal);
}
.qs-results {
  list-style: none;
  margin: 0;
  padding: var(--sp-4) 0;
}
.qs-results:empty {
  display: none;
}
.qs-item {
  padding: 6px 16px;
  margin: 0px 12px;
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text-normal);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--t-fast);
  border-radius: var(--radius-sm);
}
.qs-item.qs-selected,
.qs-item:hover {
  background: var(--interactive-hover);
}
.qs-item strong {
  font-weight: 700;
  color: var(--text-normal);
}
.qs-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: 6px 16px;
  border-top: 1px solid var(--divider);
  flex-wrap: wrap;
}
.qs-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.qs-hint kbd {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
}
.qs-hint kbd span {
  font-size: 18px;
  font-weight: 100;
  line-height: 1;
  padding-left: 2px;
  position: relative;
  top: -2px;
}
/* 16. Syntax highlight theme */
.hljs,
.highlight {
  color: #e0e2e4;
  background: #282b2e;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-selector-id {
  color: #93c763;
}
.hljs-number {
  color: #ffcd22;
}
.hljs-attribute {
  color: #668bb0;
}
.hljs-regexp,
.hljs-link {
  color: #d39745;
}
.hljs-meta {
  color: #557182;
}
.hljs-tag,
.hljs-name,
.hljs-bullet,
.hljs-subst,
.hljs-emphasis,
.hljs-type,
.hljs-built_in,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
  color: #8cbbad;
}
.hljs-string,
.hljs-symbol {
  color: #ec7600;
}
.hljs-comment,
.hljs-quote,
.hljs-deletion {
  color: #818e96;
}
.hljs-selector-class {
  color: #a082bd;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-name,
.hljs-strong {
  font-weight: bold;
}
.hljs-code,
.hljs-title.class_,
.hljs-class .hljs-title,
.hljs-section {
  color: #fff;
}
