/* 文章页：一张凸起的大卡片承载正文，代码块、引用、表格做成凹槽 */

.post { padding: 28px 48px 36px; }
.post-nav { margin: 0 48px 40px; }

.post-head { margin-bottom: 28px; }
.crumbs { margin: 0 0 12px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.post-head h1 { margin: 0 0 14px; font-size: 30px; line-height: 1.35; font-weight: 800; }
.post-info { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- 正文排版 ---- */
.prose { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { line-height: 1.4; scroll-margin-top: 80px; }
.prose h2 { font-size: 23px; margin: 2.2em 0 0.8em; padding-left: 16px; position: relative; }
.prose h2::before {
  content: ''; position: absolute; left: 0; top: 0.45em; width: 6px; height: 6px; background: var(--accent);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 45%, transparent);
}
.prose h3 { font-size: 19px; margin: 1.8em 0 0.6em; }
.prose h4 { font-size: 17px; margin: 1.5em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0.9em 0; }
.prose ul, .prose ol { padding-left: 1.6em; }
.prose li + li { margin-top: 0.25em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; height: 2px; margin: 2.4em 0; border-radius: 2px; box-shadow: inset 1px 1px 2px var(--sh-dark), inset -1px -1px 2px var(--sh-light); }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.4em auto; border-radius: 14px; box-shadow: 6px 6px 16px var(--sh-dark), -6px -6px 16px var(--sh-light); }

.prose blockquote {
  margin: 1.4em 0; padding: 12px 20px; border-radius: 16px; color: var(--muted);
  box-shadow: inset 3px 3px 8px var(--sh-dark), inset -3px -3px 8px var(--sh-light);
}
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }

.prose :not(pre) > code {
  font-family: var(--mono); font-size: 0.88em; padding: 0.15em 0.45em; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-lo));
}
.prose pre {
  margin: 1.4em 0; padding: 16px 20px; border-radius: 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
  background: var(--code-bg);
  box-shadow: inset 3px 3px 8px var(--sh-dark), inset -3px -3px 8px var(--sh-light);
}
.prose pre code { font-family: inherit; }

.table-wrap { margin: 1.4em 0; overflow-x: auto; border-radius: 14px; box-shadow: inset 2px 2px 6px var(--sh-dark), inset -2px -2px 6px var(--sh-light); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { padding: 9px 14px; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--muted) 18%, transparent); }
.prose th { font-weight: 600; color: var(--muted); }
.prose tr:last-child td { border-bottom: 0; }

.math-block { margin: 1.2em 0; overflow-x: auto; overflow-y: hidden; }
.katex { font-size: 1.05em; }

.tags { margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 13px; text-decoration: none; color: var(--muted); padding: 5px 12px; border-radius: 10px;
  box-shadow: 3px 3px 8px var(--sh-dark), -3px -3px 8px var(--sh-light);
}
.tag:hover { color: var(--accent); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.nav-card {
  display: block; padding: 16px 20px; border-radius: 18px; text-decoration: none; font-weight: 600; line-height: 1.5;
  background: linear-gradient(145deg, var(--surface-hi), var(--surface-lo));
  box-shadow: 8px 8px 18px var(--sh-dark), -8px -8px 18px var(--sh-light);
  transition: box-shadow 0.15s;
}
.nav-card span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-bottom: 4px; }
.nav-card.next { text-align: right; }
.nav-card:hover { color: var(--accent); box-shadow: 4px 4px 10px var(--sh-dark), -4px -4px 10px var(--sh-light); }

/* ---- 代码高亮（highlight.js 的 token 类，颜色跟随主题） ---- */
:root, [data-theme='light'] { --code-bg: #eef1f6; --hl-kw: #a626a4; --hl-str: #50a14f; --hl-num: #986801; --hl-fn: #4078f2; --hl-type: #c18401; --hl-cmt: #9aa1ad; --hl-attr: #e45649; }
[data-theme='dark'] { --code-bg: #171b21; --hl-kw: #c678dd; --hl-str: #98c379; --hl-num: #d19a66; --hl-fn: #61afef; --hl-type: #e5c07b; --hl-cmt: #6b7280; --hl-attr: #e06c75; }
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword, .hljs-doctag { color: var(--hl-kw); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: var(--hl-str); }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: var(--hl-num); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--hl-fn); }
.hljs-type, .hljs-built_in, .hljs-title.class_, .hljs-class .hljs-title { color: var(--hl-type); }
.hljs-comment, .hljs-quote { color: var(--hl-cmt); font-style: italic; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-name, .hljs-selector-class, .hljs-selector-id, .hljs-deletion { color: var(--hl-attr); }
.hljs-meta { color: var(--hl-cmt); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

@media (max-width: 640px) {
  .post { padding: 18px 20px 24px; }
  .post-nav { margin: 0 20px 28px; }
  .post-head h1 { font-size: 23px; }
  .prose { font-size: 15.5px; }
  .prose h2 { font-size: 20px; }
  .prose pre { margin-left: -8px; margin-right: -8px; padding: 14px; font-size: 12.5px; }
  .post-nav { grid-template-columns: 1fr; gap: 14px; }
  .nav-card.next { text-align: left; }
}
