/* =========================================================
   AI 笔记 · 博客样式（AI Notes）
   ========================================================= */

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

:root {
  color-scheme: dark;
  --bg: #06070c;
  --bg-soft: #0b0d15;
  --surface: #0f121c;
  --surface-2: #161a27;
  --text: #eef1f8;
  --text-soft: #c6ccda;
  --muted: #8f99ae;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --accent: #8b9bff;
  --accent-2: #5eead4;
  --accent-3: #f9a8d4;
  --grad: linear-gradient(115deg, #8b9bff 0%, #5eead4 52%, #f9a8d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(139, 155, 255, 0.16), rgba(94, 234, 212, 0.10) 50%, rgba(249, 168, 212, 0.13));
  --shadow: 0 40px 100px -55px rgba(0, 0, 0, 0.95);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 68px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #111528;
  --text-soft: #333b52;
  --muted: #5c667d;
  --line: rgba(17, 21, 40, 0.10);
  --line-strong: rgba(17, 21, 40, 0.18);
  --accent: #4f5de8;
  --accent-2: #0d9488;
  --accent-3: #db2777;
  --grad: linear-gradient(115deg, #4f5de8, #0d9488 52%, #db2777);
  --grad-soft: linear-gradient(135deg, rgba(79, 93, 232, 0.10), rgba(13, 148, 136, 0.07) 50%, rgba(219, 39, 119, 0.07));
  --shadow: 0 30px 70px -45px rgba(24, 32, 64, 0.35);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(139, 155, 255, 0.13), transparent 62%),
    radial-gradient(900px 520px at 100% 2%, rgba(94, 234, 212, 0.09), transparent 58%),
    radial-gradient(800px 600px at 50% 110%, rgba(249, 168, 212, 0.07), transparent 60%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(79, 93, 232, 0.10), transparent 62%),
    radial-gradient(900px 520px at 100% 2%, rgba(13, 148, 136, 0.08), transparent 58%),
    radial-gradient(800px 600px at 50% 110%, rgba(219, 39, 119, 0.06), transparent 60%);
}

::selection {
  background: rgba(139, 155, 255, 0.35);
  color: var(--text);
}

a { color: inherit; }

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

button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 14px;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
}

/* ---------------- 导航 ---------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease, backdrop-filter 0.25s ease;
}

.site-nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}

.nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad);
  position: relative;
  box-shadow: 0 0 26px rgba(139, 155, 255, 0.45);
  flex: none;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--bg);
  opacity: 0.88;
}

.brand small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--muted);
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-links a.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.nav-toggle { display: none; }

/* ---------------- 通用按钮 / 标签 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--grad);
  color: #080a12;
  box-shadow: 0 18px 44px -18px rgba(99, 102, 241, 0.65);
}

.btn-primary:hover {
  box-shadow: 0 22px 54px -18px rgba(99, 102, 241, 0.8);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-accent {
  color: var(--accent-2);
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(94, 234, 212, 0.08);
}

/* ---------------- 首页 Hero ---------------- */

.hero {
  position: relative;
  padding: 92px 24px 56px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 72%);
  opacity: 0.55;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: orb-float 16s ease-in-out infinite;
}

.orb-1 { width: 420px; height: 420px; background: rgba(99, 102, 241, 0.4); top: -160px; left: 6%; }
.orb-2 { width: 360px; height: 360px; background: rgba(45, 212, 191, 0.28); top: 40px; right: 2%; animation-delay: -6s; }
.orb-3 { width: 320px; height: 320px; background: rgba(244, 114, 182, 0.22); bottom: -180px; left: 44%; animation-delay: -11s; }

@keyframes orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(22px, -26px, 0) scale(1.07); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  margin: 26px 0 22px;
  font-size: clamp(38px, 6.3vw, 74px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  max-width: 660px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 58px;
  flex-wrap: wrap;
}

.stat b {
  display: block;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat span {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------- 区块 ---------------- */

.section {
  padding: 76px 24px;
  position: relative;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.section-kicker {
  display: block;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.section-link {
  flex: none;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.section-link:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ---------------- 艺术封面 ---------------- */

.art {
  position: relative;
  overflow: hidden;
  background: #0a0c14;
  isolation: isolate;
}

.art::before {
  content: "";
  position: absolute;
  inset: -35%;
  background: conic-gradient(from 200deg at 50% 50%, #6366f1, #22d3ee, #f472b6, #6366f1);
  filter: blur(52px) hue-rotate(var(--hue, 0deg));
  opacity: 0.82;
  animation: art-spin 24s linear infinite;
  z-index: -2;
}

.art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.24), transparent 38%),
    linear-gradient(160deg, transparent 32%, rgba(5, 7, 13, 0.86) 100%);
  z-index: -1;
}

@keyframes art-spin {
  to { transform: rotate(360deg); }
}

.art-label {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(6, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f2f5ff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.art-glyph {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 6px;
  font-size: clamp(90px, 12vw, 150px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.07em;
  color: rgba(255, 255, 255, 0.17);
  user-select: none;
}

/* ---------------- 精选文章 ---------------- */

.featured {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.featured:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.featured .art {
  min-height: 320px;
}

.featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 44px 44px 40px;
}

.featured-body h3 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.featured-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.featured-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.featured-cta .arrow {
  transition: transform 0.25s ease;
}

.featured:hover .featured-cta .arrow {
  transform: translateX(5px);
}

/* ---------------- 筛选与文章网格 ---------------- */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.chip.is-active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.post-card.is-hidden {
  display: none;
}

.card-art {
  height: 170px;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.post-card:hover .card-art .art-inner,
.featured:hover .art .art-inner {
  transform: scale(1.04);
}

.art-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card-art .art-glyph { font-size: 82px; right: 18px; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 22px 22px 24px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

.card-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.card-body h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.card-body p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.card-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.card-more .arrow { transition: transform 0.25s ease; }
.post-card:hover .card-more .arrow { transform: translateX(4px); }

/* ---------------- 关于 & 归档 ---------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
}

.about-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px;
  background: var(--grad-soft);
  position: relative;
  overflow: hidden;
}

.about-card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  bottom: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 155, 255, 0.3), transparent 68%);
  pointer-events: none;
}

.about-card h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
}

.about-card p {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.85;
  max-width: 560px;
}

.about-card p:last-of-type { margin-bottom: 0; }

.about-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.archive {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 20px;
  background: var(--surface);
}

.archive h3 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.archive a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.archive a:last-child { border-bottom: 0; }

.archive a:hover { color: var(--text); }

.archive a span:last-child {
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 24px 28px;
  margin-top: 20px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}

.footer-brand p {
  margin: 12px 0 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col a {
  display: block;
  padding: 4px 0;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  max-width: 1140px;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}

.footer-bottom a {
  color: var(--muted);
  text-decoration: none;
}

.footer-bottom a:hover { color: var(--text); }

/* ---------------- 文章页 ---------------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 0;
  height: 3px;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(139, 155, 255, 0.6);
}

.article-hero {
  padding: 54px 24px 0;
}

.article-head {
  max-width: 860px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumb .sep { opacity: 0.5; }

.article-title {
  margin: 18px 0 18px;
  font-size: clamp(31px, 5vw, 54px);
  line-height: 1.16;
  letter-spacing: -0.032em;
  font-weight: 800;
}

.article-lede {
  max-width: 720px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(15.5px, 1.8vw, 18px);
  line-height: 1.8;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0 30px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.article-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.article-banner {
  max-width: 1080px;
  height: clamp(200px, 28vw, 320px);
  margin: 34px auto 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.article-banner .art-glyph { font-size: clamp(110px, 18vw, 220px); right: 34px; bottom: -6px; }

.article-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 58px 24px 84px;
  display: grid;
  grid-template-columns: minmax(0, 760px) 220px;
  gap: 58px;
  justify-content: center;
  align-items: start;
}

.article-layout.no-toc {
  grid-template-columns: minmax(0, 760px);
}

.article-body {
  min-width: 0;
  font-size: 17px;
  line-height: 1.92;
  color: var(--text-soft);
}

.article-body > *:first-child { margin-top: 0; }

.article-body h2 {
  margin: 2.5em 0 0.8em;
  font-size: clamp(23px, 3vw, 28px);
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.article-body h2::before {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: 15px;
  border-radius: 99px;
  background: var(--grad);
}

.article-body h3 {
  margin: 2em 0 0.65em;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.article-body p { margin: 0 0 1.35em; }

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  transition: border-color 0.2s ease;
}

.article-body a:hover {
  border-bottom-color: var(--accent);
}

.article-body strong { color: var(--text); font-weight: 650; }

.article-body ul,
.article-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.article-body li { margin: 0.45em 0; }

.article-body li::marker { color: var(--accent-2); }

.article-body blockquote {
  margin: 1.8em 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 16px;
}

.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
  font-family: var(--mono);
  font-size: 0.87em;
  padding: 0.16em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.article-body pre {
  position: relative;
  margin: 1.8em 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0a0c14;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.72;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: none;
  color: #dbe2f2;
  font-size: inherit;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #c9d2e8;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.article-body table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.article-body th,
.article-body td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
}

.article-body tr:last-child td { border-bottom: 0; }

.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.callout {
  margin: 1.8em 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.8;
}

.callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.callout p { margin: 0 0 0.7em; }
.callout p:last-child { margin-bottom: 0; }

.callout-tip {
  border-color: rgba(94, 234, 212, 0.32);
  background: rgba(94, 234, 212, 0.06);
}

.callout-tip strong { color: var(--accent-2); }

.callout-warn {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.06);
}

.callout-warn strong { color: #fbbf24; }

[data-theme="light"] .callout-warn strong { color: #b45309; }

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
  font-size: 13.5px;
}

.toc-title {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.toc a {
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.55;
  transition: color 0.2s ease;
}

.toc a:hover,
.toc a.is-active { color: var(--text); }

.toc a.is-active { font-weight: 600; }

.article-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.back-home {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.back-home:hover { color: var(--text); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.post-nav a {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.post-nav a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.post-nav span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-nav .next { text-align: right; }

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(10px);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover { border-color: var(--accent); color: var(--text); }

/* ---------------- 滚动出现动画 ---------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; }
  .featured .art { min-height: 250px; }
  .featured-body { padding: 34px; }
  .about-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 14px 24px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links a { padding: 12px 14px; font-size: 15px; }
  body.nav-open .nav-links {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .hero { padding-top: 66px; }
  .section { padding: 58px 22px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .post-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 34px; }
  .article-layout { padding-top: 44px; }
  .article-hero { padding-top: 40px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .footer-cols { gap: 40px; }
}

@media (max-width: 560px) {
  .nav-inner { padding: 0 18px; }
  .hero h1 { letter-spacing: -0.025em; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { gap: 26px; }
  .stat b { font-size: 22px; }
  .featured-body { padding: 26px; }
  .about-card { padding: 26px; }
  .article-body { font-size: 16px; }
  .article-body pre { padding: 18px; font-size: 12.5px; }
  .article-body table { font-size: 13px; }
  .article-body th,
  .article-body td { padding: 9px 10px; }
  .footer-inner { flex-direction: column; }
  .footer-cols { flex-direction: column; gap: 26px; }
  .to-top { right: 16px; bottom: 16px; }
}

@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;
  }
  .js .reveal { opacity: 1; transform: none; }
}
