/* Astro-Paper Pixel-Perfect Design System */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-600.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-700.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-mono-600-italic.woff2') format('woff2');
}

:root {
  --color-bg: #fdfdfd;
  --color-text: #282728;
  --color-accent: #006cac;
  --color-accent-hover: #005587;
  --color-muted: #737373;
  --color-border: #ece9e9;
  --color-border-dashed: #b5b5b5;
  --color-code-bg: #f4f4f5;
  --color-code-text: #18181b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", monospace;
  --max-width: 780px;
}

[data-theme="dark"] {
  --color-bg: #212737;
  --color-text: #eaedf3;
  --color-accent: #ff6b01;
  --color-accent-hover: #ff8833;
  --color-muted: #94a3b8;
  --color-border: #2e384d;
  --color-border-dashed: #4b5563;
  --color-code-bg: #1c212f;
  --color-code-text: #e2e8f0;
}

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

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
header.site-header {
  padding: 2rem 0 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.25rem;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.logo-link:hover {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-mono);
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--color-accent);
}

/* Astro-Paper Signature: Wavy underline for active item */
.nav-link.active {
  color: var(--color-text);
  text-decoration: underline wavy var(--color-accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

/* Header Icon Actions - STRICTLY OUTLINE/STROKE ONLY */
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.icon-action-btn:hover {
  color: var(--color-accent);
}

.icon-action-btn.active svg {
  color: var(--color-accent);
}

/* Fix: Line icons must NOT be filled */
.icon-action-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Breadcrumbs (Astro-Paper style) */
.breadcrumb-nav {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb-nav a {
  color: var(--color-muted);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  color: var(--color-accent);
}

.breadcrumb-sep {
  margin: 0 0.35rem;
  opacity: 0.7;
}

/* Page Titles */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-style: italic;
  color: var(--color-text);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Hero Section */
.hero-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
}

.rss-icon-link {
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.rss-icon-link svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.hero-bio-text {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.hero-bio-text a {
  color: var(--color-text);
  text-decoration: underline dashed var(--color-text);
  text-underline-offset: 4px;
}

.hero-bio-text a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* Social links row */
.social-links-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.social-icon-btn {
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.social-icon-btn:hover {
  color: var(--color-accent);
  transform: translateY(-1px);
}

.social-icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* Hero & Home Sections (Astro-Paper Style) */
.hero-section {
  padding-top: 0.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.home-section {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: 0;
}

.home-section.has-border-bottom {
  border-bottom: 1px solid var(--color-border);
}

.home-section .section-headline {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.home-section .post-list {
  margin-bottom: 1rem;
}

/* Section Headline */
.section-headline {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* Post Cards */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-title-link {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
  text-decoration-color: var(--color-border-dashed);
  transition: all 0.15s ease;
  line-height: 1.4;
}

.post-title-link:hover {
  text-decoration-style: solid;
  text-decoration-color: var(--color-accent);
  color: var(--color-accent-hover);
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
}

.post-meta-row svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  opacity: 0.85;
}

.post-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* Tags Page: Pure text with dashed underline */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
}

.tag-badge {
  font-size: 1.15rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--color-text);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.tag-badge:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
  text-decoration-style: solid;
}

/* Archives Timeline */
.timeline-year-group {
  margin-bottom: 2.5rem;
}

.timeline-year-title {
  font-size: 1.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 1.25rem;
}

.timeline-month-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 640px) {
  .timeline-month-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.timeline-month-title {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-text);
}

.timeline-posts-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Post Details Page (Astro-Paper Faithful Design) */
.go-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  color: var(--color-text);
  opacity: 0.75;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.go-back-btn:hover {
  opacity: 1;
  color: var(--color-accent);
}

.go-back-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 0.15s ease;
}

.go-back-btn:hover svg {
  transform: translateX(-3px);
}

.post-detail-header {
  margin-bottom: 2.25rem;
}

.post-detail-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.post-meta-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--color-muted);
  opacity: 0.85;
}

.post-meta-details svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  margin-right: 0.15rem;
}

.post-meta-sep {
  opacity: 0.6;
}

/* Tags Container at post cards and post header */
.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin: 0.2rem 0 0.35rem 0;
}

.post-card-tags .post-tag-item {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* Tags Container & Back to Top Row at post bottom */
.post-tags-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 3rem 0 1.5rem 0;
}

.post-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.post-tag-item {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--color-text);
  text-decoration: underline dashed var(--color-text);
  text-underline-offset: 4px;
  opacity: 0.8;
  transition: opacity 0.15s ease, color 0.15s ease, text-decoration-color 0.15s ease;
}

.post-tag-item:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
  opacity: 1;
}

.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--color-text);
  opacity: 0.8;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  margin-left: auto;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.back-to-top-btn:hover {
  color: var(--color-accent);
  opacity: 1;
}

.back-to-top-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform 0.15s ease;
}

.back-to-top-btn:hover svg {
  transform: translateY(-2px);
}

/* Adjacent Post Navigation (Astro-Paper Style) */
.adjacent-post-nav {
  margin: 1.75rem 0 2rem 0;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .adjacent-post-nav {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.adjacent-post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-text);
  transition: opacity 0.15s ease;
}

.adjacent-post-card:hover {
  opacity: 0.8;
}

.adjacent-post-card.prev {
  text-align: left;
  align-items: flex-start;
  grid-column: 1;
}

.adjacent-post-card.next {
  text-align: right;
  align-items: flex-end;
  grid-column: 2;
}

@media (max-width: 640px) {
  .adjacent-post-card.next {
    grid-column: 1;
  }
}

.adjacent-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  opacity: 0.85;
}

.adjacent-nav-label svg {
  width: 15px;
  height: 15px;
}

.adjacent-nav-title {
  font-size: 0.95rem;
  color: var(--color-accent);
  line-height: 1.45;
  word-break: break-word;
  transition: color 0.15s ease;
}

.adjacent-post-card:hover .adjacent-nav-title {
  text-decoration: underline dashed;
}

.adjacent-post-placeholder {
  visibility: hidden;
}

/* Markdown Content (Astro-Paper Paper Prose) */
.markdown-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--color-text);
  word-break: break-word;
}

.markdown-body h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.8rem;
  color: var(--color-text);
  letter-spacing: -0.015em;
}

.markdown-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.markdown-body h3 {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.85rem;
  margin-bottom: 0.65rem;
  color: var(--color-text);
}

.markdown-body h4 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body h4:first-child {
  margin-top: 0;
}

/* 连续标题间距智能压缩（解决二三级标题紧挨时空隙过大问题） */
.markdown-body h1 + h2 {
  margin-top: 0.6rem;
}

.markdown-body h2 + h3 {
  margin-top: 0.5rem;
}

.markdown-body h3 + h4 {
  margin-top: 0.4rem;
}

.markdown-body p {
  margin-bottom: 1.5rem;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.markdown-body a {
  color: var(--color-accent);
  text-decoration: underline dashed;
  text-underline-offset: 4px;
}

.markdown-body a:hover {
  text-decoration-style: solid;
}

.markdown-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.75rem 0;
  font-style: italic;
  color: var(--color-text);
  opacity: 0.85;
  background: transparent;
}

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

.markdown-body blockquote p + p {
  margin-top: 0.75rem;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.45rem;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

/* Code Block Container (Wrapper & Header architecture) */
.code-block-wrapper {
  position: relative;
  margin: 1.75rem 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: var(--color-code-bg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background-color: rgba(125, 125, 125, 0.08);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-mono);
  min-height: 32px;
  user-select: none;
}

[data-theme="dark"] .code-block-header {
  background-color: rgba(255, 255, 255, 0.04);
}

.code-lang-label {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  user-select: none;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-family: inherit;
  color: var(--color-muted);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.85;
  transition: all 0.15s ease;
  line-height: 1;
  margin: 0;
  outline: none;
}

.code-copy-btn:hover {
  opacity: 1;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.code-copy-btn.copied {
  opacity: 1;
  color: #10b981;
  border-color: #10b981;
}

.code-copy-btn svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.code-block-wrapper pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
  line-height: 1.65;
  font-size: 0.9rem;
}

.code-block-wrapper pre code {
  padding: 0;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: inherit;
  color: var(--color-code-text);
  tab-size: 2;
  white-space: pre;
}

/* Fallback for unwrapped pre */
.markdown-body pre:not(.code-block-wrapper pre) {
  position: relative;
  background-color: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 2.4rem 1.25rem 1.25rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
}

.markdown-body code {
  font-family: var(--font-mono);
  background-color: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

.markdown-body pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* Highlight.js Syntax Highlighting Tokens (Light Mode) */
.hljs-comment,
.hljs-quote {
  color: #6a737d;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
  color: #d73a49;
  font-weight: 600;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
  color: #005cc5;
}
.hljs-string,
.hljs-doctag {
  color: #22863a;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
  color: #6f42c1;
  font-weight: 600;
}
.hljs-type,
.hljs-class .hljs-title {
  color: #e36209;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
  color: #22863a;
  font-weight: normal;
}
.hljs-regexp,
.hljs-link {
  color: #032f62;
}
.hljs-symbol,
.hljs-bullet {
  color: #005cc5;
}
.hljs-built_in,
.hljs-builtin-name {
  color: #e36209;
}
.hljs-meta {
  color: #737373;
}
.hljs-deletion {
  background-color: #ffeef0;
}
.hljs-addition {
  background-color: #f0fff4;
}
.hljs-emphasis {
  font-style: italic;
}
.hljs-strong {
  font-weight: bold;
}

/* Highlight.js Syntax Highlighting Tokens (Dark Mode - Astro-Paper One Dark) */
[data-theme="dark"] .hljs-comment,
[data-theme="dark"] .hljs-quote {
  color: #8b949e;
  font-style: italic;
}
[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-selector-tag,
[data-theme="dark"] .hljs-subst {
  color: #ff7b72;
  font-weight: 600;
}
[data-theme="dark"] .hljs-number,
[data-theme="dark"] .hljs-literal,
[data-theme="dark"] .hljs-variable,
[data-theme="dark"] .hljs-template-variable,
[data-theme="dark"] .hljs-tag .hljs-attr {
  color: #79c0ff;
}
[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-doctag {
  color: #a5d6ff;
}
[data-theme="dark"] .hljs-title,
[data-theme="dark"] .hljs-section,
[data-theme="dark"] .hljs-selector-id {
  color: #d2a8ff;
  font-weight: 600;
}
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-class .hljs-title {
  color: #ffa657;
}
[data-theme="dark"] .hljs-tag,
[data-theme="dark"] .hljs-name,
[data-theme="dark"] .hljs-attribute {
  color: #7ee787;
  font-weight: normal;
}
[data-theme="dark"] .hljs-regexp,
[data-theme="dark"] .hljs-link {
  color: #a5d6ff;
}
[data-theme="dark"] .hljs-symbol,
[data-theme="dark"] .hljs-bullet {
  color: #79c0ff;
}
[data-theme="dark"] .hljs-built_in,
[data-theme="dark"] .hljs-builtin-name {
  color: #ffa657;
}
[data-theme="dark"] .hljs-meta {
  color: #8b949e;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

/* Footer */
footer.site-footer {
  margin-top: auto;
  padding: 2.5rem 0 2rem 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* General Buttons & Forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: #ffffff;
  border: 1px solid var(--color-accent);
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background-color: var(--color-accent-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Search Page Styling (Astro-Paper Minimalist) */
.search-wrapper {
  margin-bottom: 2rem;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-icon {
  position: absolute;
  left: 0.9rem;
  width: 1.2rem;
  height: 1.2rem;
  color: var(--color-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.search-feedback {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.search-empty {
  color: var(--color-muted);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}

/* Pagination Navigation (Astro-Paper Faithful) */
.pagination-nav {
  margin: 1rem 0 3rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  user-select: none;
}

.pagination-indicator {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Disable View Transition Animations */
::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation: none !important;
}

/* Astro-Paper Shimmer Skeleton Screen */
.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  padding: 0.5rem 0 3rem 0;
}

.skeleton-box {
  background: linear-gradient(
    90deg,
    var(--color-code-bg) 25%,
    var(--color-border) 37%,
    var(--color-code-bg) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-breadcrumb {
  width: 130px;
  height: 14px;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  width: 200px;
  height: 32px;
  margin-bottom: 0.5rem;
}

.skeleton-subtitle {
  width: 280px;
  height: 16px;
  margin-bottom: 1.5rem;
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem 0 1.25rem 0;
  border-bottom: 1px dashed var(--color-border);
}

.skeleton-card-title {
  width: 65%;
  height: 22px;
}

.skeleton-card-meta {
  width: 140px;
  height: 14px;
}

.skeleton-card-desc {
  width: 90%;
  height: 14px;
}

.skeleton-card-desc-short {
  width: 55%;
  height: 14px;
}

/* Reading Scroll Progress Bar (Top of Screen) */
.read-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.read-progress-container.active {
  opacity: 1;
}

.read-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.08s linear;
}
