/* ============================================================
   文章阅读页专属样式
   共享变量与壳层见 base.css
   ============================================================ */

main {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 132px 24px 0;
}

/* ========== 文章头部 ========== */
.article-head { margin-bottom: 8px; }
.cat-tag {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--cyan);
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.28);
  margin-bottom: 22px;
}
.article-head h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: 0.2px;
  margin-bottom: 20px;
  background: linear-gradient(120deg, #ffffff 0%, #cbd5e1 45%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.article-meta .dot { color: rgba(255, 255, 255, 0.2); }

/* ========== 目录 ========== */
.toc {
  margin: 32px 0 8px;
  padding: 20px 24px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.toc-title {
  font-size: 12.5px;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 5px 0; }
.toc li::before {
  content: counter(toc) ".";
  color: var(--text-faint);
  font-size: 12.5px;
  margin-right: 9px;
  font-family: var(--mono);
}
.toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.toc a:hover { color: var(--cyan); }

/* ========== 正文排版 ========== */
.article-body { padding-top: 14px; }

.article-body p {
  font-size: 16.5px;
  line-height: 1.95;
  color: #c9d3e2;
  margin: 20px 0;
}

.article-body h2 {
  position: relative;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  margin: 58px 0 20px;
  padding-left: 18px;
  scroll-margin-top: 92px;
}
.article-body h2::before {
  content: "";
  position: absolute;
  left: 0; top: 0.42em;
  width: 4px; height: 0.95em;
  border-radius: 2px;
  background: var(--gradient);
}

.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  color: #eaf0f8;
  margin: 38px 0 14px;
  scroll-margin-top: 92px;
}

.article-body strong { color: #fff; font-weight: 600; }
.article-body em { color: var(--cyan); font-style: normal; }

.article-body a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
}
.article-body a:hover { border-bottom-color: var(--cyan); }

.article-body ul,
.article-body ol {
  margin: 18px 0 18px 4px;
  padding-left: 22px;
}
.article-body li {
  font-size: 16.5px;
  line-height: 1.9;
  color: #c9d3e2;
  margin: 9px 0;
}
.article-body li::marker { color: var(--violet); }
.article-body ul li::marker { color: var(--cyan); }

.article-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  margin: 46px 0;
}

.article-body blockquote {
  position: relative;
  margin: 26px 0;
  padding: 18px 24px 18px 26px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.07), rgba(129, 140, 248, 0.06));
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--violet);
}
.article-body blockquote p {
  margin: 8px 0;
  font-size: 16.5px;
  color: #dbe4f0;
}
.article-body blockquote p:first-child { margin-top: 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
  font-family: var(--mono);
  font-size: 0.875em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(129, 140, 248, 0.13);
  color: #c7d2fe;
  word-break: break-word;
}

.article-body pre {
  margin: 24px 0;
  padding: 20px 22px;
  border-radius: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  overflow-x: auto;
  line-height: 1.78;
}
.article-body pre code {
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 0;
  background: none;
  color: #a8b6cc;
  white-space: pre;
  word-break: normal;
}
.article-body pre code .cmt,
.article-body pre code .tok-cmt { color: #5c6b85; font-style: italic; }
.article-body pre code .tok-str { color: #86efac; }
.article-body pre code .tok-num { color: #fcd34d; }
.article-body pre code .tok-kw { color: #c4b5fd; }
.article-body pre code .tok-lit { color: #f9a8d4; }
.article-body pre code .tok-fn { color: #7dd3fc; }
.article-body pre code .tok-type { color: #f0abfc; }
.article-body pre code .tok-prop { color: #67e8f9; }
.article-body pre code .tok-op { color: #94a3b8; }

.article-body table {
  width: 100%;
  margin: 26px 0;
  border-collapse: collapse;
  font-size: 14.5px;
  display: block;
  overflow-x: auto;
}
.article-body thead th {
  text-align: left;
  font-weight: 600;
  color: #e8eef8;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  padding: 12px 14px;
  background: rgba(129, 140, 248, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  white-space: nowrap;
}
.article-body tbody td {
  padding: 12px 14px;
  color: #c2ccdc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.75;
  vertical-align: top;
}
.article-body tbody tr:hover td { background: rgba(255, 255, 255, 0.025); }
.article-body tbody td code { font-size: 12.5px; }

/* ========== 文末 ========== */
.article-foot {
  margin: 64px 0 0;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.tag-row span {
  font-size: 12.5px;
  padding: 5px 13px;
  border-radius: 999px;
  color: #e0e7ff;
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.28);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  min-height: 84px;
}
.post-nav-item:hover {
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}
.post-nav-item .label {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
}
.post-nav-item .title {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}
.post-nav-item.prev { text-align: left; }
.post-nav-item.next { text-align: right; justify-content: flex-end; }
.post-nav-item.all {
  min-height: 0;
  align-self: center;
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
  min-width: 108px;
}
.post-nav-item.all .title {
  font-size: 13.5px;
  color: var(--text-dim);
}
.post-nav-item.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--card-border);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.back-link:hover {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 720px) {
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav-item.prev,
  .post-nav-item.next { text-align: left; }
  .post-nav-item.is-empty { display: none; }
  .post-nav-item.all { order: -1; }
}

@media (max-width: 720px) {
  main { padding: 112px 20px 0; }
  .article-head h1 { font-size: 26px; }
  .article-body h2 { font-size: 20px; margin-top: 46px; }
  .article-body h3 { font-size: 17px; }
  .article-body p,
  .article-body li { font-size: 16px; }
  .article-body pre { padding: 16px; border-radius: 11px; }
  .article-body pre code { font-size: 12.5px; }
}
