/* =====================================================================
   小站样式。浅色是暖白纸张感，深色是带一点蓝的墨色。主色青绿，点缀暖橙。
   ===================================================================== */
:root {
  --bg: #f8f6f1; --bg2: #efece4; --card: #ffffff; --card2: #fbfaf6;
  --text: #22272e; --text2: #3d444d; --muted: #6e7681; --faint: #9aa1a9;
  --line: #e6e1d6; --line2: #d9d3c6;
  --accent: #2f7a72; --accent2: #3f9a90; --accent-soft: #e2f0ed; --warm: #e0922f; --warm-soft: #fbefdc;
  --code-bg: #f1eee6; --pre-bg: #1e2329; --pre-text: #e6edf3; --mark: #fff1bf;
  --shadow-sm: 0 1px 2px rgba(60, 50, 30, .05);
  --shadow: 0 1px 2px rgba(60, 50, 30, .05), 0 8px 24px -14px rgba(60, 50, 30, .22);
  --shadow-lg: 0 2px 4px rgba(60, 50, 30, .05), 0 22px 46px -22px rgba(60, 50, 30, .35);
  --radius: 14px; --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151a; --bg2: #1a1e24; --card: #191d23; --card2: #1d2229;
    --text: #e3e7ec; --text2: #c3cad2; --muted: #8f99a4; --faint: #687280;
    --line: #262c34; --line2: #333a44;
    --accent: #6fcabd; --accent2: #8ad8cc; --accent-soft: #19302d; --warm: #f0ad55; --warm-soft: #33281a;
    --code-bg: #232931; --pre-bg: #0d1014; --pre-text: #dde3ea; --mark: #4a3d12;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 10px 30px -18px rgba(0,0,0,.7);
    --shadow-lg: 0 24px 50px -24px rgba(0,0,0,.85);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151a; --bg2: #1a1e24; --card: #191d23; --card2: #1d2229;
  --text: #e3e7ec; --text2: #c3cad2; --muted: #8f99a4; --faint: #687280;
  --line: #262c34; --line2: #333a44;
  --accent: #6fcabd; --accent2: #8ad8cc; --accent-soft: #19302d; --warm: #f0ad55; --warm-soft: #33281a;
  --code-bg: #232931; --pre-bg: #0d1014; --pre-text: #dde3ea; --mark: #4a3d12;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 10px 30px -18px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 50px -24px rgba(0,0,0,.85);
  color-scheme: dark;
}

/* ========== 基础 ========== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; overflow-x: clip; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
/* 背景：顶部一层很淡的彩色光 + 细颗粒，让大面积底色不发闷 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 520px at 12% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(900px 460px at 95% -12%, color-mix(in srgb, var(--warm) 8%, transparent), transparent 70%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { mix-blend-mode: screen; opacity: .25; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; opacity: .25; } }

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
img { max-width: 100%; }
.wrap { width: min(100% - 48px, 1100px); margin: 0 auto; }
main.wrap { flex: 1; padding: 44px 0 72px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--card); padding: 6px 12px; border-radius: 8px; box-shadow: var(--shadow); }

/* ========== 顶栏 ========== */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s, background .3s;
}
.site-head.scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgba(0,0,0,.45); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; letter-spacing: .5px; }
.brand:hover { color: var(--text); }
.logo {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-size: 16px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .4s var(--ease), border-radius .4s var(--ease);
}
.brand:hover .logo { transform: rotate(-8deg) scale(1.06); border-radius: 50%; }
.nav { display: flex; gap: 2px; margin-left: auto; min-width: 0; padding: 4px; border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; color: var(--muted); padding: 6px 13px; border-radius: 9px; font-size: 15px; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.theme-btn {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 17px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: border-color .2s, color .2s, transform .2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn:active { transform: scale(.92); }
.theme-btn span { position: absolute; inset: 0; display: grid; place-items: center; transition: transform .5s var(--ease), opacity .3s; }
.theme-btn .moon { transform: translateY(120%) rotate(-90deg); opacity: 0; }
:root[data-theme="dark"] .theme-btn .sun { transform: translateY(-120%) rotate(90deg); opacity: 0; }
:root[data-theme="dark"] .theme-btn .moon { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { transform: translateY(-120%) rotate(90deg); opacity: 0; }
  :root:not([data-theme="light"]) .theme-btn .moon { transform: none; opacity: 1; }
}

/* ========== 通用小部件 ========== */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pills.center { justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 14px;
  color: var(--text2); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), border-color .2s, color .2s, box-shadow .25s;
}
.pill:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.tag {
  display: inline-block; font-size: 12px; line-height: 1.7; padding: 1px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); transition: transform .2s var(--ease), background .2s, color .2s;
}
.tag::before { content: "#"; opacity: .55; margin-right: 1px; }
.tag:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--accent-soft)); transform: translateY(-1px); }
.tag.on { background: var(--accent); color: var(--bg); }
.tag small { opacity: .65; margin-left: 2px; }
.badge { margin-left: 8px; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--mark); color: var(--text); vertical-align: 2px; }
.empty { color: var(--muted); padding: 24px; list-style: none; text-align: center; border: 1px dashed var(--line2); border-radius: var(--radius); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.meta > time, .meta > span:not(.tags):not(.go) { display: inline-flex; align-items: center; gap: 5px; }
.meta > time::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--warm); opacity: .8; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* ========== 首页 ========== */
.hero {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 28px;
  margin: 0 0 52px; padding: 34px 36px; border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card) 92%, var(--accent-soft)), color-mix(in srgb, var(--card) 94%, var(--warm-soft)));
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -40% -10% auto auto; width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; left: -120px; bottom: -200px; width: 380px; height: 380px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--warm) 14%, transparent), transparent);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-30px, 24px, 0) scale(1.12); } }
.hero-main { display: flex; align-items: center; gap: 24px; min-width: 0; }
.hello { margin: 0 0 2px; color: var(--muted); font-size: 14px; letter-spacing: .5px; }
.hero h1 {
  margin: 0; font-size: clamp(28px, 5vw, 40px); line-height: 1.25; letter-spacing: 1px;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 50%, var(--text) 70%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s ease-in-out infinite;
}
@keyframes shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@media (forced-colors: active) { .hero h1 { background: none; color: CanvasText; } }
.tagline { margin: 8px 0 0; color: var(--text2); font-size: 16px; }
.avatar {
  flex: none; width: 88px; height: 88px; border-radius: 26px; object-fit: cover;
  display: grid; place-items: center; font-size: 36px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--card) 70%, transparent);
  transition: transform .5s var(--ease), border-radius .5s var(--ease);
}
.hero .avatar:hover { transform: rotate(-6deg) scale(1.05); border-radius: 50%; }
.avatar.lg { width: 112px; height: 112px; font-size: 46px; border-radius: 32px; }
.stats { display: flex; gap: 10px; flex: none; }
.stats a {
  display: flex; flex-direction: column; align-items: center; min-width: 86px; padding: 12px 10px; border-radius: 16px;
  background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid var(--line); color: var(--muted); font-size: 12px;
  transition: transform .3s var(--ease), border-color .2s, box-shadow .3s;
}
.stats a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); color: var(--muted); }
.stats b { font-size: 26px; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 44px; }
.sec-title { display: flex; justify-content: space-between; align-items: center; font-size: 19px; margin: 0 0 16px; }
.sec-title::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: linear-gradient(var(--accent), var(--warm)); margin-right: 10px; }
.sec-title { justify-content: flex-start; }
.sec-title a { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); }
.sec-title a:hover { color: var(--accent); }
.feature {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 24px 26px; margin-bottom: 6px;
  border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text);
  overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s, border-color .25s;
}
.feature::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--accent), var(--warm)); transform: scaleY(0); transform-origin: top; transition: transform .45s var(--ease); }
.feature:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.feature:hover::after { transform: scaleY(1); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--warm); }
.f-title { font-size: 22px; font-weight: 700; line-height: 1.4; }
.f-sum { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feature .go { margin-left: auto; color: var(--accent); font-weight: 600; transition: transform .3s var(--ease); }
.feature:hover .go { transform: translateX(4px); }
.cat-grid { display: grid; gap: 12px; }
.cat-card {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--text);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .25s;
}
.cat-card:hover { color: var(--text); transform: translateX(4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.c-icon { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); }
.c-name { font-weight: 600; }
.c-count { font-size: 12px; color: var(--muted); }
.c-latest { grid-column: 2 / 4; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-latest::before { content: "最近："; color: var(--faint); }
.easter { margin: 64px 0 0; text-align: center; }
.easter a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; font-size: 13px;
  color: var(--muted); border: 1px dashed var(--line2); transition: color .2s, border-color .2s, transform .3s var(--ease), background .2s;
}
.easter a:hover { color: var(--accent); border-color: var(--accent); border-style: solid; background: var(--accent-soft); transform: translateY(-2px); }
.easter a span { display: inline-block; transition: transform .4s var(--ease); }
.easter a:hover span { transform: rotate(-14deg) scale(1.2); }

/* ========== 列表页 ========== */
.page-title { font-size: clamp(28px, 5vw, 36px); margin: 0 0 6px; line-height: 1.3; letter-spacing: .5px; }
.page-title .clear { font-size: 14px; font-weight: 400; margin-left: 10px; vertical-align: middle; }
.page-title::after {
  content: ""; display: block; width: 44px; height: 4px; margin-top: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--warm)); animation: grow .8s .25s var(--ease) both;
}
@keyframes grow { from { width: 0; } }
.page-sub { color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.cloud .tag { font-size: 13px; padding: 3px 12px; }
.year { display: flex; align-items: center; gap: 14px; font-size: 15px; margin: 36px 0 6px; color: var(--muted); font-weight: 700; letter-spacing: 2px; }
.year::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.list { list-style: none; margin: 0; padding: 0; }
.item { position: relative; padding: 18px 18px 18px 20px; margin: 0 -18px 0 -20px; border-radius: 14px; transition: background .25s, transform .3s var(--ease); }
.item + .item::before { content: ""; position: absolute; left: 20px; right: 18px; top: 0; height: 1px; background: var(--line); }
.item:hover { background: var(--card); transform: translateX(4px); }
.item:hover::before, .item:hover + .item::before { opacity: 0; }
.item-title { font-size: 18px; font-weight: 650; color: var(--text); }
.item-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.item:hover .item-title { color: var(--accent); }
.item .tag, .item .badge { position: relative; z-index: 1; }
.item-sum { margin: 6px 0 10px; color: var(--muted); font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crumb { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.note-cat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); }
.note-cat h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 18px; }
.note-cat h2 .c-icon { grid-row: auto; }
.note-cat h2 a { color: var(--text); }
.note-cat h2 a:hover { color: var(--accent); }
.note-cat h2 small { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; padding: 2px 9px; border-radius: 999px; background: var(--bg2); }
.note-cat ol { margin: 0; padding: 0; list-style: none; counter-reset: n; }
.note-cat li { counter-increment: n; }
.note-cat li a { display: flex; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: 9px; color: var(--text2); font-size: 15px; transition: background .2s, color .2s, padding .3s var(--ease); }
.note-cat li a::before { content: counter(n, decimal-leading-zero); color: var(--faint); font: 12px/2 var(--mono); }
.note-cat li a:hover { background: var(--accent-soft); color: var(--accent); padding-left: 14px; }

/* ========== 文章页 ========== */
.doc { display: block; }
.doc.has-aside { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 60px; }
.article { min-width: 0; max-width: 760px; }
.article-head { margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.35; margin: 0 0 14px; letter-spacing: .5px; }
.aside { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 14px; scrollbar-width: thin; }
.aside-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 2px; }
.aside-title::before { content: ""; width: 14px; height: 2px; background: var(--warm); border-radius: 2px; }
.toc ol, .side-nav ol { list-style: none; margin: 0 0 30px; padding: 0; border-left: 2px solid var(--line); }
.toc li a, .side-nav li a { display: block; padding: 5px 12px; margin-left: -2px; color: var(--muted); border-left: 2px solid transparent; line-height: 1.5; transition: color .2s, border-color .25s, background .2s; }
.toc li.lv3 a { padding-left: 26px; font-size: 13px; }
.toc a:hover, .side-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.toc a.active, .side-nav a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.toc-inline { display: none; margin: 0 0 26px; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.toc-inline summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: "▾"; color: var(--muted); transition: transform .3s var(--ease); }
.toc-inline[open] summary::after { transform: rotate(180deg); }
.toc-inline ol { margin: 10px 0 2px; padding-left: 1.2em; }
.toc-inline li { padding: 2px 0; }
.toc-inline .lv3 { margin-left: 1em; font-size: 14px; }

.end-mark { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 52px 0 0; color: var(--faint); font-size: 13px; letter-spacing: 4px; }
.end-mark span { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, var(--line2)); }
.end-mark span:last-child { transform: scaleX(-1); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.pager a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--card); box-shadow: var(--shadow-sm); font-weight: 600; line-height: 1.5; }
.pager a:hover { color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-bottom: 2px; }
.pager .next { text-align: right; }

/* ========== 正文排版 ========== */
.prose { font-size: 17px; line-height: 1.9; color: var(--text2); overflow-wrap: break-word; }
.prose.narrow { max-width: 760px; }
.prose > :first-child { margin-top: 0; }
.prose :is(h2, h3, h4) { color: var(--text); scroll-margin-top: 90px; }
.prose h2 { position: relative; font-size: 24px; margin: 2.2em 0 .8em; padding-left: 16px; line-height: 1.4; }
.prose h2::before { content: ""; position: absolute; left: 0; top: .28em; bottom: .28em; width: 4px; border-radius: 4px; background: linear-gradient(var(--accent), var(--warm)); }
.prose h3 { font-size: 20px; margin: 1.8em 0 .6em; line-height: 1.45; }
.prose h4 { font-size: 17px; margin: 1.5em 0 .5em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose .table-wrap { margin: 0 0 1.2em; }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.prose li > ul, .prose li > ol { margin: .3em 0; }
.prose li.task { list-style: none; margin-left: -1.4em; }
.prose li.task input { margin-right: 8px; vertical-align: -1px; accent-color: var(--accent); }
.prose blockquote { position: relative; padding: .9em 1.2em .9em 1.4em; border-left: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text2); box-shadow: var(--shadow-sm); }
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font: .86em/1.6 var(--mono); background: var(--code-bg); color: var(--text); padding: .18em .45em; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.prose pre {
  position: relative; background: var(--pre-bg); color: var(--pre-text); border-radius: var(--radius); padding: 44px 20px 18px;
  overflow-x: auto; line-height: 1.65; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.05);
}
/* 代码块顶部的三个小圆点，像一个小窗口 */
.prose pre::after { content: ""; position: absolute; left: 18px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840; opacity: .85; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 14px; color: inherit; white-space: pre; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 12px; right: 16px; font: 11px/1.6 var(--mono); color: #8b949e; text-transform: uppercase; letter-spacing: 1px; transition: opacity .2s; }
.copy-btn {
  position: absolute; top: 9px; right: 10px; padding: 3px 11px; font-size: 12px; border-radius: 7px; border: 1px solid #3a4148;
  background: #252b31; color: #c9d1d9; cursor: pointer; opacity: 0; transition: opacity .15s, background-color .2s, color .2s;
}
.prose pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.prose pre:hover[data-lang]::before { opacity: 0; }
.copy-btn.ok { background: var(--accent); border-color: transparent; color: #0b1a18; opacity: 1; }
@media (hover: none) { .copy-btn { opacity: .85; } .prose pre[data-lang]::before { display: none; } }
.prose img { height: auto; border-radius: 12px; display: block; margin: 0 auto; box-shadow: var(--shadow); cursor: zoom-in; transition: opacity .5s ease, transform .4s var(--ease); }
.prose img:hover { transform: scale(1.01); }
.prose img.loading { opacity: 0; }
.prose hr { border: none; height: 1px; margin: 2.6em auto; background: linear-gradient(90deg, transparent, var(--line2), transparent); }
.prose del { color: var(--muted); }
.prose mark { background: var(--mark); color: inherit; padding: 0 .2em; border-radius: 3px; }
.prose a:not(.anchor) {
  color: var(--accent); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat, linear-gradient(color-mix(in srgb, currentColor 30%, transparent), color-mix(in srgb, currentColor 30%, transparent)) 0 100% / 100% 1px no-repeat;
  transition: background-size .35s var(--ease), color .2s;
}
.prose a:not(.anchor):hover { background-size: 100% 1px, 100% 1px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg2); font-weight: 650; color: var(--text); font-size: 14px; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background .2s; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.prose .anchor { margin-left: .4em; color: var(--faint); font-weight: 400; opacity: 0; text-decoration: none; transition: opacity .2s; }
.prose :is(h2, h3):hover .anchor, .prose .anchor:focus-visible { opacity: 1; }

/* ========== 关于 / 游戏 / 404 ========== */
.about-card {
  position: relative; overflow: hidden; display: flex; gap: 28px; align-items: center; margin: 0 0 40px; padding: 30px 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card) 92%, var(--accent-soft)), color-mix(in srgb, var(--card) 94%, var(--warm-soft)));
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.about-card h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.3; }
.about-card .bio { margin: 0; color: var(--text2); }
.group-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; font-size: 18px; }
.group-title small { color: var(--muted); font-size: 13px; font-weight: 400; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.game {
  --c: hsl(var(--h, 170) 60% 50%);
  position: relative; display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s, border-color .25s;
}
.game:hover { color: var(--text); transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, var(--line)); box-shadow: 0 18px 36px -20px color-mix(in srgb, var(--c) 70%, transparent); }
.g-icon {
  flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: color-mix(in srgb, var(--c) 16%, var(--card)); transition: transform .45s var(--ease);
}
.game:hover .g-icon { transform: scale(1.1) rotate(-8deg); }
.g-text { min-width: 0; }
.game b { display: block; font-size: 16px; }
.game small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.55; margin-top: 2px; }
.g-play {
  flex: none; margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); opacity: 0; transform: translateX(-8px) scale(.8);
  transition: opacity .3s, transform .35s var(--ease);
}
.game:hover .g-play, .game:focus-visible .g-play { opacity: 1; transform: none; }
@media (hover: none) { .g-play { opacity: 1; transform: none; } }
.not-found { text-align: center; padding: 70px 0 40px; }
.not-found h1 { font-size: clamp(72px, 16vw, 120px); line-height: 1; margin: 6px 0 10px; letter-spacing: 8px; background: linear-gradient(135deg, var(--accent), var(--warm)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.not-found p { color: var(--muted); }
.nf-fish { display: inline-block; font-size: 44px; animation: swim 5s ease-in-out infinite; }
@keyframes swim { 0% { transform: translateX(-40px) scaleX(1); } 45% { transform: translateX(40px) scaleX(1); } 50% { transform: translateX(40px) scaleX(-1); } 95% { transform: translateX(-40px) scaleX(-1); } 100% { transform: translateX(-40px) scaleX(1); } }

/* ========== 页脚 ========== */
.site-foot { position: relative; padding: 30px 0 calc(30px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; text-align: center; }
.site-foot::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(100% - 48px, 1100px); height: 1px; background: linear-gradient(90deg, transparent, var(--line2), transparent); }
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
.foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.foot-links svg { width: 13px; height: 13px; }
.foot-legal, .foot-legal a { color: var(--faint); }
.foot-legal a:hover { color: var(--accent); }

/* ========== 窄屏 ========== */
@media (max-width: 900px) {
  .doc.has-aside { display: block; }
  .aside { display: none; }
  .toc-inline { display: block; }
  .hero { flex-direction: column; align-items: stretch; }
  .stats { justify-content: stretch; }
  .stats a { flex: 1; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  main.wrap { padding: 28px 0 56px; }
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .site-head .wrap { gap: 8px; height: 58px; }
  .brand-text { display: none; }
  .nav { margin-left: auto; }
  .nav a { padding: 6px 10px; font-size: 14px; }
  .prose { font-size: 16px; }
  .hero { padding: 26px 20px; margin-bottom: 40px; border-radius: 20px; }
  .hero-main { flex-direction: column; text-align: center; }
  .hero .pills { justify-content: center; }
  .about-card { flex-direction: column; text-align: center; padding: 26px 20px; }
  .about-card .pills { justify-content: center; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .item { margin: 0 -12px; padding: 16px 12px; }
  .item + .item::before { left: 12px; right: 12px; }
  .feature { padding: 20px; }
  .prose pre { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 380px) {
  .nav a { padding: 6px 7px; }
  .stats b { font-size: 22px; }
  .stats a { min-width: 0; }
}

@media print {
  body::before, body::after, .site-head, .site-foot, .aside, .pager, .toc-inline, .copy-btn, .easter, .read-progress, .to-top, .end-mark { display: none !important; }
  .prose pre { white-space: pre-wrap; }
}

/* =====================================================================
   动画与交互效果
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* 页面之间切换：淡入淡出（Chrome / Edge 支持，其他浏览器照常跳转） */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
:root.theme-vt::view-transition-old(root), :root.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root.theme-anim, :root.theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }

/* 入场：内容依次轻轻浮上来 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main.wrap > * { animation: rise .6s var(--ease) both; }
main.wrap > :nth-child(2) { animation-delay: .06s; }
main.wrap > :nth-child(3) { animation-delay: .12s; }
main.wrap > :nth-child(4) { animation-delay: .18s; }
main.wrap > :nth-child(n+5) { animation-delay: .22s; }
.list > li, .note-grid > *, .games > *, .cat-grid > *, .cloud > *, .stats > * {
  animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 9) * 50ms + 120ms);
}
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(1) { --i: 1; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(2) { --i: 2; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(3) { --i: 3; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(4) { --i: 4; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(5) { --i: 5; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(6) { --i: 6; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(7) { --i: 7; }
:is(.list, .note-grid, .games, .cat-grid, .cloud, .stats) > :nth-child(8) { --i: 8; }

/* 滚动到才出现（由 site.js 给屏幕下方的元素加上）。只动 transform 和 opacity，不会让文字一直看不清 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); animation: none !important; }
.reveal.in { opacity: 1; transform: none; }

.theme-btn.spin span { animation: none; }

/* 卡片：鼠标处有一团柔光 */
.note-cat, .pager a, .about-card, .feature { transition: transform .35s var(--ease), box-shadow .35s ease, border-color .25s; }
.note-cat:hover, .pager a:hover {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow-lg);
}
.spot { position: relative; }
.spot > * { position: relative; }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%);
}
.spot:hover::before { opacity: 1; }
.game.spot::before { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c) 16%, transparent), transparent 65%); }
.pager small { transition: letter-spacing .3s var(--ease); }
.pager a:not(.next) small::before { content: "← "; }
.pager .next small::after { content: " →"; }
.pager a:hover small { letter-spacing: 1px; }

/* 图片放大 */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 4vmin;
  background: rgba(10, 12, 14, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s ease; cursor: zoom-out;
}
.lightbox.open { opacity: 1; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); transform: scale(.93); transition: transform .35s var(--ease); }
.lightbox.open img { transform: none; }

/* 阅读进度条、回到顶部 */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; pointer-events: none;
  transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--warm));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.to-top {
  position: fixed; right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); z-index: 30;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 18px; cursor: pointer; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .25s ease, transform .3s var(--ease), border-color .2s, color .2s;
}
.to-top svg { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.to-top circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top.show:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* 系统设置了「减少动态效果」时，关掉所有动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
