/* base —— reset / 排版 / 正文 / 代码高亮 / 分页 */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--color-bg);
  transition: background-color var(--dur) var(--ease);
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
  background: transparent;
  transition: color var(--dur) var(--ease);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 固定极光光晕铺底（不随滚动，不拦截点击） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--aurora);
  background-attachment: fixed;
}

img, picture, video { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--color-accent); }

h1, h2, h3, h4, h5 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

::selection { background: var(--neon-2); color: #fff; text-shadow: none; }

/* ---------- 文章正文 ---------- */
.post-content { font-size: 16px; color: var(--color-text); }
.post-content > *:first-child { margin-top: 0; }
.post-content p, .post-content ul, .post-content ol,
.post-content blockquote, .post-content pre, .post-content table {
  margin: 1.2em 0;
}
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  margin: 1.8em 0 0.6em;
  scroll-margin-top: 90px;
}
.post-content h2 { font-size: 1.6em; padding-top: 0.4em; }
.post-content h3 { font-size: 1.3em; }
.post-content a { color: var(--color-accent); border-bottom: 1px solid var(--color-accent-soft); }
.post-content a:hover { border-bottom-color: var(--color-accent); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li { margin: 0.4em 0; }
.post-content blockquote {
  position: relative;
  border-left: none;
  padding: 0.4em 0 0.4em 1.3em;
  color: var(--color-muted);
}
.post-content blockquote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-accent);
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
}
.post-content pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1em 1.3em;
  overflow-x: auto;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.86em;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}
.post-content th, .post-content td {
  border: 1px solid var(--color-border);
  padding: 0.5em 0.9em;
  text-align: left;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.4em 0;
}

/* 正文图片：圆角 + 细边框 + 轻阴影 */
.post-content img {
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin: 1.6em auto;
  height: auto;
}

/* ---------- Prism 服务端高亮配色（深色） ---------- */
.token.comment, .token.prolog, .token.cdata { color: #6a737d; }
.token.punctuation { color: #c9d1d9; }
.token.property, .token.tag, .token.boolean, .token.number,
.token.constant, .token.symbol { color: #79c0ff; }
.token.selector, .token.attr-name, .token.string, .token.char,
.token.builtin, .token.inserted { color: #a5d6ff; }
.token.operator, .token.entity, .token.url,
.language-css .token.string, .style .token.string { color: #ff7b72; }
.token.atrule, .token.attr-value, .token.keyword { color: #ff7b72; }
.token.function, .token.class-name { color: #d2a8ff; }
.token.regex, .token.important, .token.variable { color: #ffa657; }
:root[data-theme="light"] .token.comment { color: #6e6e68; }
:root[data-theme="light"] .token.punctuation { color: #333; }
:root[data-theme="light"] .token.keyword,
:root[data-theme="light"] .token.operator { color: #cf222e; }
:root[data-theme="light"] .token.string,
:root[data-theme="light"] .token.attr-value { color: #0a3069; }
:root[data-theme="light"] .token.number,
:root[data-theme="light"] .token.boolean { color: #0550ae; }
:root[data-theme="light"] .token.function,
:root[data-theme="light"] .token.class-name { color: #8250df; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}
.pagination .page-number,
.pagination .extend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
  color: var(--color-muted);
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pagination a.page-number:hover,
.pagination a.extend:hover {
  color: var(--neon-2);
  border-color: var(--neon-2);
  box-shadow: var(--glow-sm);
  transform: translateY(-2px);
}
.pagination .current {
  color: #fff;
  border-color: transparent;
  background: var(--grad-accent);
  box-shadow: var(--glow-sm);
}
.pagination .extend { font-weight: 700; letter-spacing: 0.08em; }
.pagination .space {
  min-width: auto;
  padding: 0 6px;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--color-muted);
}

/* ---------- 滚动淡入（渐进增强；无 JS / 减弱动效时默认可见） ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    will-change: opacity, transform;
  }
  html.js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 减少动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
