/* ============================================================
   自旋存算 · 学术博客 — 全站样式
   设计系统：亮色默认 / 暗色 [data-theme="dark"]
   主色靛蓝 #3b5bdb，辅色紫 #7c3aed，强调金 #f59e0b
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;

  --bg: #ffffff;
  --bg-soft: #f4f6fc;
  --bg-card: #ffffff;
  --bg-inset: #eef1f9;
  --text: #1a2340;
  --text-2: #4c5678;
  --text-3: #8b93b0;
  --primary: #3b5bdb;
  --primary-strong: #2b46b8;
  --primary-soft: rgba(59, 91, 219, 0.09);
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.09);
  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.1);
  --border: #e3e8f3;
  --border-strong: #ccd4e6;
  --shadow-sm: 0 1px 2px rgba(26, 35, 64, 0.06);
  --shadow-md: 0 8px 28px -10px rgba(26, 35, 64, 0.16);
  --shadow-lg: 0 24px 60px -24px rgba(26, 35, 64, 0.28);
  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 64px;
  --gradient: linear-gradient(120deg, #3b5bdb 0%, #7c3aed 100%);
}

[data-theme="dark"] {
  --bg: #0c1122;
  --bg-soft: #111830;
  --bg-card: #141c36;
  --bg-inset: #1a2342;
  --text: #e9edf9;
  --text-2: #a9b3d1;
  --text-3: #6d7699;
  --primary: #8ba4ff;
  --primary-strong: #a5b9ff;
  --primary-soft: rgba(139, 164, 255, 0.13);
  --accent: #c4a6ff;
  --accent-soft: rgba(196, 166, 255, 0.14);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.13);
  --border: #232d4e;
  --border-strong: #33406b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent); }
ul, ol { padding-left: 1.4em; }
::selection { background: rgba(124, 58, 237, 0.22); }

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.35s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-wrap {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { font-size: 17px; letter-spacing: 0.02em; white-space: nowrap; }
.brand-text small {
  display: block; font-size: 10px; font-weight: 500; color: var(--text-3);
  letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.1;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--text-2); font-size: 14.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.site-nav a:hover { color: var(--primary); background: var(--primary-soft); }
.site-nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

.theme-toggle {
  margin-left: 6px; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-2); transition: color 0.2s, border-color 0.2s, transform 0.2;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold); transform: rotate(20deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle {
  display: none; width: 40px; height: 40px; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px; transform: translate(-50%, -50%);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; }
.nav-toggle span::before { transform: translate(-50%, -6px); }
.nav-toggle span::after { transform: translate(-50%, 6px); }
.nav-toggle.open span { opacity: 0; }
.nav-toggle.open span::before { transform: translate(-50%, 0) rotate(45deg); opacity: 1; }
.nav-toggle.open span::after { transform: translate(-50%, 0) rotate(-45deg); opacity: 1; }

/* ---------- Hero（始终深色） ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 480px at 82% 12%, rgba(124, 58, 237, 0.34), transparent 60%),
    radial-gradient(720px 420px at 8% 88%, rgba(59, 91, 219, 0.32), transparent 62%),
    linear-gradient(158deg, #0b1026 0%, #151d3e 52%, #101733 100%);
  color: #eef1fb;
  padding: calc(var(--header-h) + 76px) 0 96px;
}
.hero::before { /* 细网格纹理 */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; letter-spacing: 0.06em; color: #b9c6f5;
  border: 1px solid rgba(185, 198, 245, 0.28); background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 26px;
}
.hero-eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.hero-title {
  font-size: clamp(38px, 6vw, 58px); line-height: 1.15; font-weight: 800;
  letter-spacing: 0.01em; margin-bottom: 10px;
}
.hero-title .grad {
  background: linear-gradient(100deg, #9db4ff 0%, #c9a6ff 55%, #7dd3fc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(15px, 2.2vw, 18px); color: #aeb9de; margin-bottom: 14px; font-weight: 500; }
.hero-desc { font-size: 16px; color: #93a1c9; max-width: 640px; margin-bottom: 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.hero-tags .tag {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cfd9f8; font-size: 13px; padding: 5px 13px; border-radius: 999px; font-weight: 500;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 14px 44px; margin-top: 64px;
  padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-stat b { display: block; font-size: 24px; font-weight: 800; color: #fff; line-height: 1.2; }
.hero-stat span { font-size: 13px; color: #8b98c2; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-size: 15px; font-weight: 600; font-family: var(--font-sans);
  padding: 11px 24px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 22px -8px rgba(59, 91, 219, 0.55); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(124, 58, 237, 0.55); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--bg-card); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-light { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.28); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255, 255, 255, 0.18); color: #fff; transform: translateY(-2px); }
.btn-sm { padding: 7px 15px; font-size: 13.5px; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- 区块与标题 ---------- */
.section { padding: 84px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.16em;
  color: var(--primary); text-transform: uppercase; margin-bottom: 12px;
}
.section-title { font-size: clamp(26px, 4vw, 34px); font-weight: 800; line-height: 1.3; margin-bottom: 14px; }
.section-desc { color: var(--text-2); font-size: 16px; }
.section-head.center .section-desc { margin: 0 auto; }

/* ---------- 卡片与网格 ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center; color: #fff; background: var(--gradient);
  box-shadow: 0 6px 16px -6px rgba(59, 91, 219, 0.5);
}
.card-icon svg { width: 23px; height: 23px; }
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.card-text { font-size: 14.5px; color: var(--text-2); }
.card-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-size: 14px; font-weight: 600;
}
.card-link svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.card-link:hover svg { transform: translateX(4px); }

/* 研究/文章卡片图标配色 */
.card-icon.i-blue { background: linear-gradient(135deg, #3b5bdb, #5c7cfa); }
.card-icon.i-violet { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-icon.i-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.card-icon.i-gold { background: linear-gradient(135deg, #d97706, #fbbf24); }
.card-icon.i-rose { background: linear-gradient(135deg, #e11d48, #fb7185); }
.card-icon.i-sky { background: linear-gradient(135deg, #0284c7, #38bdf8); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; font-size: 12.5px; font-weight: 500;
  color: var(--primary); background: var(--primary-soft);
  padding: 3px 11px; border-radius: 999px; line-height: 1.6;
}
.tag.t-violet { color: var(--accent); background: var(--accent-soft); }
.tag.t-gold { color: var(--gold); background: var(--gold-soft); }

/* ---------- 文章卡片 ---------- */
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.post-card-cover {
  height: 132px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #16204a, #2a1e5e);
  display: flex; align-items: center; justify-content: center;
}
.post-card-cover svg { width: 74px; height: 74px; opacity: 0.95; }
.post-card-cover.c-blue { background: linear-gradient(120deg, #1e3a8a, #3b5bdb); }
.post-card-cover.c-violet { background: linear-gradient(120deg, #4c1d95, #7c3aed); }
.post-card-cover.c-teal { background: linear-gradient(120deg, #134e4a, #0d9488); }
.post-card-cover.c-gold { background: linear-gradient(120deg, #78350f, #d97706); }
.post-card-cover.c-rose { background: linear-gradient(120deg, #881337, #e11d48); }
.post-card-cover.c-sky { background: linear-gradient(120deg, #0c4a6e, #0284c7); }
.post-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3); margin-bottom: 10px;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.post-title { font-size: 17.5px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); }
.post-excerpt { font-size: 14px; color: var(--text-2); flex: 1; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- 时间线（动态 / 教育经历） ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--primary), var(--accent));
  border-radius: 2px; opacity: 0.35;
}
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -27px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.timeline-date {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--primary); background: var(--primary-soft);
  padding: 2px 10px; border-radius: 6px; margin-bottom: 8px;
}
.timeline-title { font-size: 16.5px; font-weight: 700; margin-bottom: 4px; }
.timeline-org { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.timeline-text { font-size: 14px; color: var(--text-2); }

/* ---------- 子页面页头 ---------- */
.page-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 360px at 85% 20%, rgba(124, 58, 237, 0.3), transparent 60%),
    radial-gradient(560px 320px at 6% 90%, rgba(59, 91, 219, 0.28), transparent 62%),
    linear-gradient(158deg, #0b1026 0%, #151d3e 60%, #101733 100%);
  color: #eef1fb;
  padding: calc(var(--header-h) + 64px) 0 64px;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
}
.page-hero-inner { position: relative; z-index: 2; }
.page-hero-title { font-size: clamp(30px, 5vw, 42px); font-weight: 800; margin-bottom: 12px; }
.page-hero-sub { color: #aeb9de; font-size: 16px; max-width: 680px; }
.breadcrumb {
  position: relative; z-index: 2; font-size: 13px; color: #8b98c2; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: #b9c6f5; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: 0.5; }

/* ---------- 关于页 ---------- */
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.avatar-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; text-align: center; box-shadow: var(--shadow-sm);
  position: sticky; top: calc(var(--header-h) + 24px);
}
.avatar-ring {
  width: 132px; height: 132px; margin: 0 auto 20px; border-radius: 50%;
  background: conic-gradient(from 210deg, #3b5bdb, #7c3aed, #38bdf8, #3b5bdb);
  padding: 4px; display: grid; place-items: center;
  animation: spin-slow 14s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.avatar-ring-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg-card);
  display: grid; place-items: center;
  font-size: 44px; font-weight: 800;
  background-clip: padding-box;
  animation: spin-slow-rev 14s linear infinite;
}
@keyframes spin-slow-rev { to { transform: rotate(-360deg); } }
.avatar-ring-inner span {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.avatar-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.avatar-role { font-size: 13.5px; color: var(--text-2); margin-bottom: 18px; line-height: 1.6; }
.avatar-meta { font-size: 13px; color: var(--text-3); border-top: 1px dashed var(--border); padding-top: 16px; }
.avatar-meta div { display: flex; justify-content: space-between; padding: 3px 0; }
.avatar-meta b { color: var(--text-2); font-weight: 600; }

.kv-list { display: grid; gap: 18px; }
.kv-item { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.kv-key {
  font-size: 13px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border-radius: 7px;
  padding: 4px 0; text-align: center;
}
.kv-val { font-size: 15px; color: var(--text-2); }
.kv-val b { color: var(--text); }

/* ---------- 论文列表 ---------- */
.pub-item {
  display: grid; grid-template-columns: 76px 1fr; gap: 22px;
  padding: 26px 0; border-bottom: 1px dashed var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-year {
  font-size: 15px; font-weight: 800; color: var(--text-3);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.pub-title { font-size: 16.5px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.pub-authors { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.pub-authors b { color: var(--text); }
.pub-venue { font-size: 14px; color: var(--text-2); font-style: italic; margin-bottom: 10px; }
.pub-venue .badge {
  font-style: normal; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 9px; border-radius: 6px; margin-right: 8px; vertical-align: 1px;
}
.badge-sci { color: #b45309; background: var(--gold-soft); }
.badge-conf { color: var(--primary); background: var(--primary-soft); }
.badge-pre { color: var(--accent); background: var(--accent-soft); }
.pub-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; font-weight: 600; }
.pub-links a { display: inline-flex; align-items: center; gap: 5px; }
.pub-links svg { width: 13px; height: 13px; }

/* ---------- 提示框 ---------- */
.callout {
  border-radius: var(--radius); padding: 18px 22px; font-size: 14.5px;
  border: 1px solid; display: flex; gap: 14px; align-items: flex-start; line-height: 1.7;
}
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.callout-info { background: var(--primary-soft); border-color: rgba(59, 91, 219, 0.25); color: var(--text-2); }
.callout-info svg { color: var(--primary); }
.callout-warn { background: var(--gold-soft); border-color: rgba(217, 119, 6, 0.3); color: var(--text-2); }
.callout-warn svg { color: var(--gold); }
.callout b { color: var(--text); }

/* ---------- 文章正文排版 ---------- */
.post-header { padding: calc(var(--header-h) + 56px) 0 44px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.post-header .post-meta { font-size: 13.5px; margin-bottom: 16px; }
.post-header-title { font-size: clamp(26px, 4.5vw, 38px); font-weight: 800; line-height: 1.35; margin-bottom: 16px; }
.post-header-sub { font-size: 16.5px; color: var(--text-2); max-width: 720px; }
.post-author-row {
  display: flex; align-items: center; gap: 12px; margin-top: 26px;
  padding-top: 22px; border-top: 1px dashed var(--border);
}
.post-author-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--gradient); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
}
.post-author-info { font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.post-author-info b { display: block; color: var(--text); font-size: 14.5px; }

.prose { font-size: 16px; color: var(--text); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: 25px; font-weight: 800; line-height: 1.4; margin-top: 2.2em;
  padding-left: 14px; border-left: 4px solid var(--primary);
}
.prose h3 { font-size: 19px; font-weight: 700; margin-top: 1.9em; }
.prose h3::before { content: "▸ "; color: var(--accent); }
.prose h4 { font-size: 16px; font-weight: 700; margin-top: 1.6em; color: var(--text-2); }
.prose p { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 700; }
.prose em { font-style: normal; color: var(--accent); font-weight: 600; }
.prose a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--primary); }
.prose ul, .prose ol { color: var(--text-2); display: grid; gap: 0.5em; }
.prose li::marker { color: var(--primary); }
.prose li b { color: var(--text); }
.prose blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 14px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2); font-size: 15px;
}
.prose blockquote p { color: inherit; }
.prose code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--bg-inset); color: var(--primary-strong);
  padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border);
}
.prose pre {
  background: #0d1428; color: #dbe4ff; border-radius: var(--radius);
  padding: 20px 24px; overflow-x: auto; font-size: 14px; line-height: 1.7;
  border: 1px solid #232d4e;
}
.prose pre code { background: none; border: none; color: inherit; padding: 0; font-size: inherit; }
.prose figure {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.prose figure svg { width: 100%; height: auto; margin: 0 auto; }
.prose figcaption { text-align: center; font-size: 13.5px; color: var(--text-3); margin-top: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--bg-inset); font-weight: 700; color: var(--text); white-space: nowrap; }
.prose td { color: var(--text-2); }
.prose hr { border: none; border-top: 1px dashed var(--border); margin: 2.4em 0; }
.prose .ref-list { font-size: 13.5px; color: var(--text-3); display: grid; gap: 0.6em; }
.prose .ref-list li::marker { color: var(--text-3); }
.prose .math { font-family: var(--font-mono); font-size: 0.92em; color: var(--text); }

/* 文章底部导航 */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 56px;
}
.post-nav a {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; transition: border-color 0.2s, transform 0.2s;
}
.post-nav a:hover { border-color: var(--primary); transform: translateY(-2px); }
.post-nav .dir { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.post-nav .t { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5; }
.post-nav a:hover .t { color: var(--primary); }
.post-nav .next { text-align: right; }
.post-nav .next .dir { justify-content: flex-end; }

/* ---------- 联系页 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-list { display: grid; gap: 14px; }
.contact-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; transition: border-color 0.2s, transform 0.2s;
}
.contact-item:hover { border-color: var(--primary); transform: translateY(-2px); }
.contact-item .ci-icon {
  width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.contact-item .ci-icon svg { width: 20px; height: 20px; }
.contact-item .ci-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 2px; }
.contact-item .ci-value { font-size: 15px; font-weight: 600; color: var(--text); word-break: break-all; }

.contact-form {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-sm);
}
.form-field { margin-bottom: 20px; }
.form-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-field input, .form-field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 15px; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus, .form-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-field textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.form-note { font-size: 12.5px; color: var(--text-3); margin-top: 14px; }

.social-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.social-link {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.social-link:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }
.social-link svg { width: 19px; height: 19px; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 52px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.footer-desc { font-size: 14px; color: var(--text-2); max-width: 340px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--text-2); }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-3);
}
.footer-bottom .heart { color: var(--accent); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--gradient); color: #fff; border: none;
  display: grid; place-items: center; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { transform: translateY(-3px); }
.back-top svg { width: 18px; height: 18px; }

/* ---------- CTA 横幅 ---------- */
.cta-banner {
  position: relative; overflow: hidden; border-radius: 20px;
  background:
    radial-gradient(500px 260px at 88% 18%, rgba(124, 58, 237, 0.4), transparent 60%),
    linear-gradient(120deg, #16204a 0%, #2a1e5e 100%);
  color: #eef1fb; padding: 56px 48px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.cta-banner h3 { font-size: clamp(21px, 3vw, 27px); font-weight: 800; margin-bottom: 8px; }
.cta-banner p { color: #aeb9de; font-size: 15px; max-width: 520px; }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 留言板 ---------- */
.giscus-box { min-height: 220px; }
.giscus-frame { width: 100%; border: none; }
.gb-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.gb-item-new { border-color: var(--primary); animation: gb-in 0.5s ease; }
@keyframes gb-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.gb-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gb-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--gradient); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.gb-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.gb-time { font-size: 12.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.gb-content { font-size: 14.5px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.gb-empty { text-align: center; color: var(--text-3); padding: 36px 0; font-size: 14.5px; }
.gb-status { font-size: 13.5px; margin-top: 12px; min-height: 20px; }
.gb-status-ok { color: #0d9488; }
[data-theme="dark"] .gb-status-ok { color: #2dd4bf; }
.gb-status-err { color: #e11d48; }
[data-theme="dark"] .gb-status-err { color: #fb7185; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .avatar-card { position: static; max-width: 340px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 14px 24px 20px; box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .site-nav.open { transform: none; opacity: 1; visibility: visible; }
  .site-nav a { padding: 11px 14px; font-size: 15px; }
  .theme-toggle { margin-left: auto; margin-top: 8px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .hero { padding: calc(var(--header-h) + 52px) 0 72px; }
  .hero-stats { gap: 14px 30px; margin-top: 44px; }
  .cta-banner { padding: 40px 28px; }
  .post-nav { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 1fr; gap: 8px; }
  .pub-year { font-size: 13px; }
  .prose { font-size: 15.5px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .back-top { right: 16px; bottom: 16px; }
}
