:root {
  --bg: #0b0e14;
  --bg-2: #11151f;
  --bg-3: #1a2030;
  --border: #232b3d;
  --text: #c9d4e3;
  --text-dim: #8a97ab;
  --accent: #1793d1;
  --accent-2: #2ec4f6;
  --cyan: #23d3d3;
  --orange: #e9a23b;
  --green: #7ec699;
  --code-bg: #0d1117;
  --code-text: #d7e3f4;
  --heading: #fff;
  --hero-bg: linear-gradient(135deg, #0d1b2a 0%, #0b0e14 60%, #0b0e14 100%);
  --glass-bg: rgba(17, 21, 31, 0.92);
  --glass-solid: rgba(17, 21, 31, 0.9);
  --hover-text: #fff;
  --accent-soft: rgba(23,147,209,0.15);
  --step-grad: linear-gradient(90deg, rgba(23,147,209,0.12), transparent);
  --step-grad-hover: linear-gradient(90deg, rgba(23,147,209,0.2), rgba(23,147,209,0.04));
  --row-alt: rgba(255,255,255,0.02);
  --float-bg: rgba(255,255,255,0.06);
  --float-border: rgba(255,255,255,0.15);
  --float-hover: rgba(255,255,255,0.14);
  --img-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --drawer-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  --selection-bg: rgba(46, 196, 246, 0.3);
  --selection-text: #fff;
}
:root[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-2: #ffffff;
  --bg-3: #e7ecf4;
  --border: #d4dce8;
  --text: #2d3748;
  --text-dim: #5f6f85;
  --accent: #0d74b3;
  --accent-2: #0891b2;
  --cyan: #0e8f9e;
  --code-bg: #f3f6fa;
  --code-text: #243246;
  --heading: #1b2430;
  --hero-bg: linear-gradient(135deg, #e6f0fa 0%, #f4f6fa 60%, #f4f6fa 100%);
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-solid: rgba(255, 255, 255, 0.95);
  --hover-text: #0b2e46;
  --accent-soft: rgba(13,116,179,0.14);
  --step-grad: linear-gradient(90deg, rgba(13,116,179,0.14), transparent);
  --step-grad-hover: linear-gradient(90deg, rgba(13,116,179,0.22), rgba(13,116,179,0.05));
  --row-alt: rgba(15,30,60,0.03);
  --float-bg: rgba(20,35,60,0.05);
  --float-border: rgba(20,35,60,0.18);
  --float-hover: rgba(20,35,60,0.1);
  --img-shadow: 0 8px 28px rgba(20, 40, 80, 0.22);
  --drawer-shadow: 0 0 60px rgba(15, 35, 70, 0.25);
  --selection-bg: rgba(8, 145, 178, 0.28);
  --selection-text: #08141f;
}
/* 主题切换过渡（仅切换瞬间） */
html.theme-anim, html.theme-anim * {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, fill .3s ease !important;
}
* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--bg-3) var(--bg); }
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ===== 阅读进度条 ===== */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 100; pointer-events: none;
}
.read-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--cyan));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(46, 196, 246, 0.6);
  transition: width 0.1s linear;
}

/* ===== 回到顶部 ===== */
.to-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 98;
  width: 44px; height: 44px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-solid);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 1.1rem;
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s, color 0.2s, visibility 0.3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.to-top:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }
.to-top:active { transform: translateY(0) scale(0.95); }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}
::selection { background: var(--selection-bg); color: var(--selection-text); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 移动端导航按钮 ===== */
.menu-btn { display: none; }
@media (max-width: 940px) {
  .menu-btn {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 14px; left: 14px; z-index: 100;
    width: 42px; height: 42px;
    background: var(--glass-bg);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 1.15rem; cursor: pointer;
    backdrop-filter: blur(6px);
    transition: border-color 0.15s, color 0.15s, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
  }
  .menu-btn:hover { border-color: var(--accent); color: var(--hover-text); }
  .menu-btn:active { transform: scale(0.92); }
  .sidebar {
    position: static !important;
    max-height: none !important;
    display: none;
    animation: none;
  }
  body.menu-open .sidebar {
    display: block;
    animation: fadeIn 0.25s ease both;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    margin-bottom: 16px;
  }
  body.menu-open .menu-btn { transform: rotate(90deg); }
  .hero.mini { padding-left: 64px; padding-right: 150px; }
  .hero.mini .crumbs { display: none; }
  .hero.mini .brand { max-width: calc(100vw - 214px); overflow: hidden; }
  .hero.mini .brand {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .github-corner { padding: 7px 12px; font-size: 0.75rem; }
  .github-corner svg { width: 15px; height: 15px; }
  .top-actions { top: 12px; right: 12px; }
}

/* ===== 入场动画 ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.12); }
}
@keyframes gradFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes bounceDown {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(6px); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.98); }
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 入场动画 ===== */
.page-title, .markdown-body { animation: fadeUp 0.5s ease both; }
.sidebar { animation: slideInLeft 0.45s ease both; }
.hero.mini .brand { animation: fadeUp 0.4s ease both; }
.hero.mini .crumbs { animation: fadeUp 0.4s ease 0.1s both; }
.pn, .page-foot { animation: fadeUp 0.5s ease 0.15s both; }

/* ===== Hero ===== */
.hero {
  background: var(--hero-bg);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 300px;
  background: radial-gradient(ellipse, rgba(23,147,209,0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46,196,246,0.35), rgba(35,211,211,0.35), transparent);
}
.hero .logo {
  width: 250px; height: auto;
  border-radius: 18px;
  margin-bottom: 18px;
  animation: floatY 5s ease-in-out infinite;
  filter: drop-shadow(0 6px 24px rgba(46, 196, 246, 0.25));
  transition: transform 0.3s ease;
}
.hero .logo:hover { transform: scale(1.06); }
.hero h1 {
  font-size: 2.1rem;
  background: linear-gradient(90deg, var(--accent-2), var(--cyan), var(--accent), var(--accent-2));
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  letter-spacing: 1px;
  animation: gradFlow 8s linear infinite;
}
.hero .subtitle { margin-top: 10px; color: var(--text-dim); font-size: 1rem; }
.hero .scroll-hint {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
  animation: pulse 2.4s ease-in-out infinite;
}
.hero .scroll-hint svg { animation: bounceDown 2.4s ease-in-out infinite; }
.badges { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.badge:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 196, 246, 0.5);
  box-shadow: 0 4px 18px rgba(46, 196, 246, 0.2);
}
.badge b { color: var(--accent-2); font-weight: 600; }
.badge.blue { color: var(--hover-text); background: rgba(23,147,209,0.15); border-color: rgba(23,147,209,0.5); }
:root[data-theme="light"] .badge.blue { color: #0b5c8f; background: rgba(13,116,179,0.12); border-color: rgba(13,116,179,0.4); }

/* ===== 徽章入场 ===== */
.badges .badge { animation: fadeUp 0.5s ease both; }
.badges .badge:nth-child(1) { animation-delay: 0.1s; }
.badges .badge:nth-child(2) { animation-delay: 0.2s; }
.badges .badge:nth-child(3) { animation-delay: 0.3s; }
.badges .badge:nth-child(4) { animation-delay: 0.4s; }

/* ===== 首页 logo 微光 ===== */
.hero .logo { position: relative; }
.hero .logo::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 18px;
  background: linear-gradient(115deg, transparent 40%, rgba(46,196,246,0.28) 50%, transparent 60%);
  background-size: 250% 100%;
  animation: shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

.hero.mini {
  padding: 18px 24px;
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-right: 180px;
}
@media (min-width: 1200px) { .hero.mini { padding-right: 200px; } }
.hero.mini .brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.hero.mini .brand img {
  width: 44px; height: auto;
  border-radius: 8px;
}
.hero.mini .crumbs { color: var(--text-dim); font-size: 0.9rem; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Layout ===== */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; padding: 20px 14px 60px; }
  .hero h1 { font-size: 1.5rem; }
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 0.88rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.sidebar:hover { border-color: rgba(23,147,209,0.4); box-shadow: 0 0 24px rgba(23,147,209,0.08); }
.sb-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sb-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,147,209,0.15); outline: none; }
.sb-tip {
  font-size: 0.75rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin: 4px 2px 8px;
  display: flex; align-items: center; gap: 8px;
}
.sb-tip::after {
  content: "";
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.sb-list a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  position: relative;
  transition: background 0.18s, color 0.18s, padding-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.sb-list a::before {
  content: "";
  position: absolute;
  left: 0; top: 20%;
  height: 60%; width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-2), var(--cyan));
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.18s, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.sb-list a:hover { background: var(--bg-3); color: var(--accent-2); padding-left: 14px; text-decoration: none; }
.sb-list a:hover::before, .sb-list a.cur::before { opacity: 1; transform: scaleY(1); }
.sb-list a.cur {
  background: var(--accent-soft);
  color: var(--accent-2);
  font-weight: 600;
  border-left: none;
}
.sb-list .group {
  margin: 14px 4px 5px;
  font-size: 0.75rem; color: var(--accent);
  font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase;
  transition: color 0.2s, padding-left 0.2s;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sb-list .group .grp-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  filter: saturate(0.95);
}
:root[data-theme="light"] .sb-list .group .grp-icon { filter: saturate(0.9) brightness(1.02); }
.sb-list .group:hover { color: var(--accent-2); padding-left: 2px; }
.sb-list .group.step {
  margin: 12px 4px 4px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: .5px;
  background: var(--step-grad);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  transition: background 0.25s, padding-left 0.25s;
}
.sb-list .group.step:hover { background: var(--step-grad-hover); padding-left: 14px; }

.sb-list a.sb-child { padding-left: 20px; }
.sb-list a.sb-child::before { left: 12px; }
.sb-list a.sb-child:hover { padding-left: 22px; }

/* ===== Main ===== */
main { min-width: 0; }
.page-title {
  font-size: 1.6rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 72px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: growBar 0.8s ease 0.2s both;
}
@keyframes growBar {
  from { width: 0; opacity: 0; }
  to { width: 72px; opacity: 1; }
}

/* ===== Markdown body ===== */
.markdown-body {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 36px;
  overflow-wrap: break-word;
  animation: fadeUp 0.6s ease both;
}
.page-title { animation: fadeUp 0.6s ease both; }
@media (max-width: 700px) { .markdown-body { padding: 20px 16px; } }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--heading);
  margin: 1.6em 0 0.7em;
  line-height: 1.4;
  scroll-margin-top: 20px;
}
.markdown-body h1 { font-size: 1.7rem; border-bottom: 1px solid var(--border); padding-bottom: .4em; }
.markdown-body h2 {
  font-size: 1.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .35em;
  position: relative;
  transition: color 0.2s;
}
.markdown-body h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 48px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--cyan));
  transition: width 0.3s ease;
}
.markdown-body h2:hover::after { width: 96px; }
.markdown-body h3 { font-size: 1.15rem; color: var(--accent-2); }
.markdown-body h4 { font-size: 1rem; color: var(--cyan); }
.markdown-body h1:first-child, .markdown-body h2:first-child { margin-top: 0; }
.markdown-body p { margin: 0.8em 0; }
.markdown-body strong { color: var(--heading); }
.markdown-body ul, .markdown-body ol { margin: 0.8em 0 0.8em 1.6em; }
.markdown-body li { margin: 0.3em 0; transition: color 0.2s; }
.markdown-body li::marker { color: var(--accent-2); }
.markdown-body li > ul, .markdown-body li > ol { margin: 0.2em 0 0.2em 1.4em; }
.markdown-body code {
  background: rgba(35,211,211,0.09);
  border: 1px solid rgba(35,211,211,0.22);
  border-radius: 5px;
  padding: 1px 7px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.88em;
  color: var(--cyan);
  overflow-wrap: break-word;
}
.markdown-body pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 1em 0;
  overflow-x: auto;
  line-height: 1.6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.markdown-body pre:hover {
  border-color: rgba(46, 196, 246, 0.4);
  box-shadow: 0 0 24px rgba(23, 147, 209, 0.12);
}
.markdown-body pre code {
  background: none; border: none; padding: 0;
  color: var(--code-text);
  font-size: 0.85em;
  white-space: pre;
  display: block;
}
.markdown-body pre code::-webkit-scrollbar { height: 8px; }
.markdown-body img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0.6em 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.markdown-body img:hover {
  transform: scale(1.015);
  border-color: rgba(46, 196, 246, 0.45);
  box-shadow: var(--img-shadow);
}
.markdown-body p img + img { margin-left: 8px; }
.markdown-body table {
  border-collapse: collapse;
  margin: 1em 0;
  width: 100%;
  font-size: 0.92em;
  display: block;
  overflow-x: auto;
  border-radius: 10px;
}
.markdown-body th, .markdown-body td {
  border: 1px solid var(--border);
  padding: 8px 14px;
  text-align: left;
}
.markdown-body th { background: var(--bg-3); color: var(--heading); }
.markdown-body tr:nth-child(even) td { background: var(--row-alt); }
.markdown-body tbody tr { transition: background 0.15s ease; }
.markdown-body tbody tr:hover td { background: rgba(46, 196, 246, 0.07); }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(23,147,209,0.07);
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin: 1em 0;
  color: var(--text-dim);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  position: relative;
}
.markdown-body blockquote::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--cyan));
  border-radius: 3px 0 0 3px;
}
.markdown-body blockquote:hover {
  border-color: var(--cyan);
  background: rgba(35, 211, 211, 0.08);
  transform: translateX(2px);
}
.markdown-body blockquote p { margin: 0.4em 0; }
.markdown-body a {
  position: relative;
  transition: color 0.15s ease;
}
.markdown-body a:not(.btn):not(.github-corner)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--accent-2), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.markdown-body a:hover::after { transform: scaleX(1); }
.markdown-body a:hover { text-decoration: none; }
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.8em 0;
}
.markdown-body del { color: var(--text-dim); }
.markdown-body details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 1em 0;
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.markdown-body details:hover { border-color: rgba(46, 196, 246, 0.35); }
.markdown-body details[open] { background: rgba(23,147,209,0.03); }
:root[data-theme="light"] .markdown-body details[open] { background: rgba(13,116,179,0.04); }
.markdown-body summary { cursor: pointer; font-weight: 600; color: var(--accent-2); transition: color 0.2s; }
.markdown-body summary:hover { color: var(--cyan); }
.markdown-body summary::marker { color: var(--accent); }
.markdown-body details > :not(summary) { animation: fadeUp 0.3s ease both; }
.markdown-body video { max-width: 100%; border-radius: 10px; display: block; margin: 0.6em 0; }
.markdown-body iframe { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }

/* ===== GitHub 入口 (右上角) ===== */
.top-actions {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 10px;
}
.github-corner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, color 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.github-corner:hover {
  border-color: var(--accent);
  color: var(--hover-text);
  text-decoration: none;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(23, 147, 209, 0.25);
}
.github-corner:active { transform: translateY(0) scale(0.97); }
.github-corner svg { width: 18px; height: 18px; fill: var(--text); transition: fill 0.2s, transform 0.3s; }
.github-corner:hover svg { fill: var(--accent-2); transform: rotate(8deg); }

/* ===== 主题切换按钮 ===== */
.theme-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, color 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, background-color 0.3s, border-color 0.3s;
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 28px rgba(23, 147, 209, 0.25);
}
.theme-btn:active { transform: scale(0.94); }
.theme-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.theme-btn .ic { display: none; }
.theme-btn[data-mode="auto"] .ic-auto { display: block; }
.theme-btn[data-mode="dark"] .ic-dark { display: block; }
.theme-btn[data-mode="light"] .ic-light { display: block; }
@media (max-width: 940px) {
  .theme-btn { width: 36px; height: 36px; }
  .top-actions { gap: 8px; }
}

/* ===== Prev/Next ===== */
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; }
.pn a {
  display: inline-block;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  color: var(--text);
  max-width: 46%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.pn a::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, rgba(23,147,209,0.1));
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.pn a:hover::after { opacity: 1; }
.pn a.prev::after { left: 0; }
.pn a.next::after { right: 0; transform: scaleX(-1); }
.pn a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 147, 209, 0.18);
}
.pn .prev:hover { transform: translateY(-2px) translateX(-3px); }
.pn .next:hover { transform: translateY(-2px) translateX(3px); }
.pn .next { margin-left: auto; }

/* ===== Footer ===== */
.page-foot {
  margin-top: 26px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); background: var(--float-bg);
  border: 1px solid var(--float-border); border-radius: 6px;
  opacity: 0; transform: scale(0.8);
  transition: opacity .2s, background .2s, color .2s, transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color .2s;
}
.markdown-body pre:hover .copy-btn { opacity: 1; transform: scale(1); }
.copy-btn:hover { background: var(--float-hover); color: var(--text); }
.copy-btn:active { transform: scale(0.9); }
.copy-btn.copied { background: rgba(76,175,80,0.2); border-color: rgba(76,175,80,0.5); color: #7edb87; }
@media (hover: none) { .copy-btn { opacity: 1; transform: scale(1); } }

/* ===== 打印 ===== */
@media print {
  .sidebar, .top-actions, .github-corner, .menu-btn, .theme-btn, .to-top, .pn, .page-foot, .contact-card, .copy-btn, .hero { display: none !important; }
  body { background: #fff; color: #000; }
  .markdown-body { background: none; border: none; padding: 0; }
  .layout { padding: 0; display: block; }
  :root[data-theme="light"], :root { --bg: #fff; --text: #000; --bg-2: #fff; --border: #ccc; }
}

.contact-card {
  margin: 2.2em 0 1em;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(23,147,209,0.12), rgba(46,196,246,0.05));
  border: 1px solid rgba(23,147,209,0.35);
  border-radius: 12px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.contact-card:hover {
  border-color: rgba(46,196,246,0.55);
  box-shadow: 0 8px 32px rgba(23,147,209,0.12);
  transform: translateY(-2px);
}
.contact-card h2 { margin: 0 0 10px; font-size: 1.25rem; color: var(--accent-2); }
.contact-card p { margin: 8px 0; color: var(--text-dim); }
.contact-card a { color: var(--accent-2); }
.qq-group {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 6px 0;
  padding: 8px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: 1.05rem;
}
.qq-group b { color: var(--accent-2); letter-spacing: 1px; }
.qq-group .copy-btn {
  position: static; opacity: 1; transform: scale(1);
  width: 26px; height: 26px;
}

/* ===== 首页 hero 内容区排版 ===== */
.hero .logo, .hero h1, .hero .subtitle, .hero .badges {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}
.hero .logo { animation-delay: 0.05s; }
.hero h1 { animation-delay: 0.2s; }
.hero .subtitle { animation-delay: 0.35s; }
.hero .badges { animation-delay: 0.5s; }

/* ===== 首页目录流程图 ===== */
.flow { margin: 1.4em 0; }
.flow-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.flow-step:hover {
  border-color: rgba(46, 196, 246, 0.5);
  border-left-color: var(--accent-2);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(23, 147, 209, 0.12);
}
.flow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.flow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--accent-2);
  background: rgba(23,147,209,0.12);
  border: 1px solid rgba(23,147,209,0.3);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.flow-icon svg { width: 15px; height: 15px; }
.flow-step:hover .flow-icon {
  transform: scale(1.12) rotate(-4deg);
  color: var(--cyan);
  background: rgba(23,147,209,0.2);
}
.flow-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
  background: rgba(23,147,209,0.1);
  border: 1px solid rgba(23,147,209,0.3);
  padding: 1px 10px;
  border-radius: 999px;
}
.flow-choice {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--orange);
  background: rgba(233, 162, 59, 0.12);
  border: 1px solid rgba(233, 162, 59, 0.4);
  padding: 1px 10px;
  border-radius: 999px;
}
.flow-step > a {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-2);
  display: inline-block;
  margin-bottom: 4px;
}
.flow-step > a:hover { color: var(--cyan); text-decoration: none; }
.flow-step > a::after { display: none; }
.flow-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.flow-items a {
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, background 0.18s;
}
.flow-items a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: var(--accent-soft);
  transform: translateY(-1px);
  text-decoration: none;
}
.flow-arrow {
  height: 30px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.flow-arrow::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--border), var(--accent));
}
.flow-arrow::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--accent);
  animation: bounceDown 1.8s ease-in-out infinite;
}
.flow-step { animation: fadeUp 0.5s ease both; }
@media (prefers-reduced-motion: reduce) {
  .flow-arrow::after { animation: none; }
  .flow-step { animation: none; }
}
