/* ==========================================================================
   CreeperConfettiPro Wiki — 样式表 / Stylesheet
   毛玻璃 + 极光背景 + 动效 / Glassmorphism, aurora backdrop, motion
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #f6f9f8;
  --bg-elev: #ffffff;
  --bg-soft: #f2f6f4;
  --bg-soft-2: #e9efec;
  --border: #e0e8e4;
  --border-strong: #cbd6d0;
  --text: #101a16;
  --text-2: #3a4741;
  --muted: #64756c;

  --accent: #128f4e;
  --accent-strong: #0c7a41;
  --accent-soft: #e4f7ec;
  --accent-border: #b3e3c9;

  --warn: #a95f06;
  --warn-soft: #fdf4e3;
  --warn-border: #efd6a3;
  --danger: #ad2318;
  --danger-soft: #fdeeed;
  --danger-border: #f2c4bf;
  --info: #1a55c4;
  --info-soft: #ecf2fe;
  --info-border: #c3d6f7;

  --code-bg: #0d1720;
  --code-text: #e7eef6;

  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-ring: rgba(16, 32, 26, .07);

  --shadow-sm: 0 1px 2px rgba(14, 30, 24, .05);
  --shadow-md: 0 12px 34px rgba(14, 40, 30, .10);
  --shadow-lg: 0 26px 60px rgba(14, 40, 30, .14);

  --blob-1: rgba(47, 190, 120, .30);
  --blob-2: rgba(80, 150, 235, .22);
  --blob-3: rgba(250, 200, 90, .20);

  --radius: 14px;
  --topbar-h: 62px;
  --ease: cubic-bezier(.22, .68, .28, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #080f13;
  --bg-elev: #0e171d;
  --bg-soft: #121c22;
  --bg-soft-2: #18242b;
  --border: #22303a;
  --border-strong: #31424e;
  --text: #e9f1f4;
  --text-2: #bccbd2;
  --muted: #8397a1;

  --accent: #46d38c;
  --accent-strong: #6ee6a6;
  --accent-soft: #12301f;
  --accent-border: #2b5c3f;

  --warn: #efb15c;
  --warn-soft: #2a2114;
  --warn-border: #4c3a1d;
  --danger: #f08a80;
  --danger-soft: #2c1917;
  --danger-border: #54302c;
  --info: #7fb0f8;
  --info-soft: #15223a;
  --info-border: #2a4066;

  --code-bg: #060c11;
  --code-text: #dde7f1;

  --glass: rgba(14, 22, 28, .62);
  --glass-strong: rgba(12, 20, 26, .84);
  --glass-border: rgba(255, 255, 255, .07);
  --glass-ring: rgba(255, 255, 255, .05);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .55);

  --blob-1: rgba(38, 180, 118, .26);
  --blob-2: rgba(52, 110, 210, .24);
  --blob-3: rgba(190, 120, 40, .14);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 18px);
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* ---------- 极光背景 / aurora backdrop ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  will-change: transform;
}
body::before {
  width: 46vw;
  height: 46vw;
  top: -14vw;
  left: -10vw;
  background: radial-gradient(circle at 30% 30%, var(--blob-1), transparent 70%);
  animation: drift1 26s ease-in-out infinite alternate;
}
body::after {
  width: 42vw;
  height: 42vw;
  top: 6vw;
  right: -12vw;
  background: radial-gradient(circle at 60% 40%, var(--blob-2), transparent 70%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.bg-fx {
  position: fixed;
  z-index: -1;
  width: 36vw;
  height: 36vw;
  bottom: -16vw;
  left: 24vw;
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle at 50% 50%, var(--blob-3), transparent 70%);
  pointer-events: none;
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(6vw, 4vw, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-5vw, 6vw, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(-6vw, -5vw, 0) scale(1.15); } }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶栏 / topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-ring);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.topbar.scrolled {
  background: var(--glass-strong);
  box-shadow: 0 6px 26px rgba(10, 30, 22, .08);
}
[data-theme="dark"] .topbar.scrolled { box-shadow: 0 6px 26px rgba(0, 0, 0, .5); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  box-shadow: 0 3px 10px rgba(18, 143, 78, .28);
  border: 1px solid var(--glass-border);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }

.brand-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--border);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search { position: relative; width: 268px; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 32px;
  border: 1px solid var(--glass-ring);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  background: var(--bg-elev);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow: auto;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  transform-origin: top center;
}
.search-results.open { display: block; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

.search-results a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  transition: background .12s;
}
.search-results a:hover, .search-results a.active {
  background: var(--accent-soft);
  text-decoration: none;
}
.search-results .r-title { font-weight: 600; }
.search-results .r-meta { color: var(--muted); font-size: 11.5px; }
.search-results .r-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }

.iconbtn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-ring);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elev) 55%, transparent);
  color: var(--text-2);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
  position: relative;
}
.iconbtn:hover {
  background: var(--bg-elev);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}
.iconbtn:active { transform: scale(.94); }

.langbtn {
  width: auto;
  min-width: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
.langbtn svg { opacity: .7; }

/* GitHub 图标按钮 / GitHub icon button */
.ghbtn { text-decoration: none; }
.ghbtn:hover { text-decoration: none; }
.ghbtn svg { transition: transform .3s var(--ease); }
.ghbtn:hover svg { transform: scale(1.12) rotate(-5deg); }

.menu-btn { display: none; }

/* ---------- 布局 / layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 208px;
  gap: 42px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 30px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 26px 14px 40px 0;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.nav-group { margin-bottom: 20px; }
.nav-group-title {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .09em;
  color: var(--muted);
  text-transform: uppercase;
  padding: 0 10px 7px;
}
.nav a {
  position: relative;
  display: block;
  padding: 6px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.5;
  transition: background .18s, color .18s, padding-left .18s var(--ease);
}
.nav a::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height .22s var(--ease);
}
.nav a:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text);
  text-decoration: none;
  padding-left: 16px;
}
.nav a:hover::before { height: 12px; }
.nav a.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent-strong);
  font-weight: 650;
}
[data-theme="dark"] .nav a.active { color: var(--accent); background: rgba(70, 211, 140, .12); }
.nav a.active::before { height: 18px; }

/* 侧栏顶部的「回主页」入口 / back to landing */
.nav .nav-home {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.nav .nav-home:hover { color: var(--accent-strong); }

.main { min-width: 0; padding: 34px 0 72px; }
.content { max-width: 880px; }

/* 语言块切换 */
.lang-block { animation: langIn .38s var(--ease); }
@keyframes langIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 排版 / typography ---------- */
h1 {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -.024em;
  font-weight: 750;
  margin: 0 0 12px;
}
h2 {
  font-size: 23px;
  line-height: 1.32;
  letter-spacing: -.012em;
  font-weight: 720;
  margin: 46px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
  position: relative;
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  transition: width .8s var(--ease);
}
h2.in::after { width: 92px; }
h3 {
  font-size: 16.5px;
  font-weight: 680;
  margin: 28px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
h4 { font-size: 14.5px; font-weight: 680; margin: 20px 0 8px; color: var(--text-2); }

p { margin: 0 0 14px; color: var(--text-2); }
.lead, .content > p:first-of-type {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.76;
}
ul, ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-2); }
li { margin: 5px 0; }
li > ul, li > ol { margin: 5px 0; }
strong { color: var(--text); font-weight: 680; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }

.anchor-link {
  opacity: 0;
  margin-left: 8px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: opacity .18s;
}
h2:hover .anchor-link, h3:hover .anchor-link { opacity: 1; }

/* ---------- 代码 / code ---------- */
code {
  font-family: var(--mono);
  font-size: 12.6px;
  background: var(--bg-soft-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
  white-space: nowrap;
}
pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 12.8px;
  line-height: 1.66;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: var(--shadow-sm);
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: #2b3a4d; border-radius: 4px; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
  font-family: var(--font);
  color: #9fb0c4;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s, transform .18s, color .18s, background .18s;
}
pre:hover .copy-btn { opacity: 1; transform: none; }
.copy-btn:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.copy-btn.done { color: #6ee0a4; border-color: #2b5c3d; }

.tok-c { color: #7d8fa5; font-style: italic; }
.tok-k { color: #7ee787; }
.tok-s { color: #ffab70; }
.tok-n { color: #79c0ff; }

/* ---------- 表格 / tables ---------- */
.table-wrap {
  border: 1px solid var(--glass-ring);
  border-radius: var(--radius);
  overflow: auto;
  margin: 0 0 20px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13.4px; }
thead th {
  text-align: left;
  font-weight: 680;
  color: var(--text);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
td code, th code { white-space: nowrap; }

/* ---------- 提示块 / callouts ---------- */
.callout {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  background: var(--bg-soft);
  margin: 0 0 18px;
  font-size: 14px;
}
.callout p { margin: 0; color: var(--text-2); }
.callout p + p { margin-top: 8px; }
.callout .co-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  margin-top: 3px;
  flex: 0 0 auto;
}
.callout strong { color: var(--text); }
.callout.note { background: color-mix(in srgb, var(--info-soft) 78%, transparent); border-color: var(--info-border); border-left-color: var(--info); }
.callout.tip { background: color-mix(in srgb, var(--accent-soft) 78%, transparent); border-color: var(--accent-border); border-left-color: var(--accent); }
.callout.warn { background: color-mix(in srgb, var(--warn-soft) 78%, transparent); border-color: var(--warn-border); border-left-color: var(--warn); }
.callout.danger { background: color-mix(in srgb, var(--danger-soft) 78%, transparent); border-color: var(--danger-border); border-left-color: var(--danger); }
.callout.note .co-icon { color: var(--info); }
.callout.tip .co-icon { color: var(--accent); }
.callout.warn .co-icon { color: var(--warn); }
.callout.danger .co-icon { color: var(--danger); }

/* ---------- 徽章 / badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-ring);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-2);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.badge.green { background: color-mix(in srgb, var(--accent-soft) 85%, transparent); border-color: var(--accent-border); color: var(--accent-strong); }
[data-theme="dark"] .badge.green { color: var(--accent); }
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- 卡片 / cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  position: relative;
  display: block;
  padding: 20px 21px;
  border: 1px solid var(--glass-ring);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.card:hover::after { opacity: 1; }
a.card:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.card .c-title {
  font-weight: 680;
  font-size: 14.5px;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card .c-desc { font-size: 13px; color: var(--muted); line-height: 1.62; }

/* ---------- 首页 hero ---------- */
.hero { padding: 10px 0 8px; }
.hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hero-logo {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(18, 143, 78, .25);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero h1 { font-size: 38px; margin: 0; }
.hero .lead { font-size: 17px; max-width: 660px; }
.hero .lead b { white-space: nowrap; }

/* ---------- 步骤 / steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 20px; }
.steps > li {
  position: relative;
  padding: 0 0 20px 40px;
  border-left: 1px solid var(--border);
  margin-left: 13px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -13px;
  top: -1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 750;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.steps > li:hover::before { transform: scale(1.12); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
[data-theme="dark"] .steps > li::before { color: var(--accent); }
.steps .s-title { font-weight: 680; color: var(--text); margin-bottom: 4px; }

/* ---------- 目录 / TOC ---------- */
.toc {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 42px 0 40px;
  font-size: 12.6px;
}
.toc-title {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 3px 0 3px 10px;
  margin-left: -11px;
  border-left: 2px solid transparent;
  color: var(--muted);
  line-height: 1.5;
  transition: color .18s, border-color .18s, padding-left .18s;
}
.toc a:hover { color: var(--text); text-decoration: none; padding-left: 14px; }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 650; }
[data-theme="dark"] .toc a.active { color: var(--accent); }
.toc .lv3 { padding-left: 22px; font-size: 12px; }

/* ---------- 翻页 / pager ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 52px 0 0;
  max-width: 848px;
}
.pager a {
  display: block;
  padding: 13px 16px;
  border: 1px solid var(--glass-ring);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .22s, background .22s, transform .22s var(--ease), box-shadow .22s;
}
.pager a:hover {
  border-color: var(--accent-border);
  background: var(--glass-strong);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pager .p-label { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.pager .p-title { font-weight: 650; color: var(--text); font-size: 14px; }
.pager .next { text-align: right; }
.pager .next:only-child { grid-column: 2; }

.foot {
  max-width: 880px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* ---------- 流程图 / figure ---------- */
.figure {
  border: 1px solid var(--glass-ring);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 14px 10px;
  margin: 0 0 20px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.figure svg { display: block; width: 100%; height: auto; min-width: 560px; }
.figure .fig-cap { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }

.flow-dash {
  stroke-dasharray: 6 5;
  animation: dashmove 1.6s linear infinite;
}
@keyframes dashmove { to { stroke-dashoffset: -22; } }

/* ---------- GUI 示意图 / inventory schematic ---------- */
.gui-window {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 10px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}
.gui-title {
  text-align: center;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  padding: 2px 0 10px;
  letter-spacing: .01em;
}
.gui-grid {
  display: grid;
  grid-template-columns: repeat(9, 46px);
  grid-auto-rows: 46px;
  gap: 4px;
  justify-content: center;
}
.gslot {
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-soft-2);
  color: var(--text-2);
  font-size: 9.5px;
  line-height: 1.1;
  text-align: center;
  padding: 2px;
  transition: transform .18s var(--ease), box-shadow .18s;
}
.gslot:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.gslot.style {
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elev));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}
.gslot.style::after {
  content: "";
  width: 16px;
  height: 16px;
  background: color-mix(in srgb, var(--accent) 72%, transparent);
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
}
.gslot.filler {
  background: color-mix(in srgb, var(--bg-soft-2) 55%, transparent);
  border-color: var(--border);
}
.gslot.act {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev));
  border-color: var(--accent-border);
  color: var(--accent-strong);
  font-weight: 650;
}
[data-theme="dark"] .gslot.act { color: var(--accent); }
.gslot.num {
  background: var(--bg-elev);
  border-color: var(--border-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}
.gui-cap { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 0 22px; }

/* ---------- bStats 数据条 / live stats ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
  max-width: 640px;
}
.stat-card {
  padding: 13px 15px;
  border: 1px solid var(--glass-ring);
  border-radius: 11px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
}
a.stat-link { text-decoration: none; }
a.stat-link:hover { text-decoration: none; }
.stat-num {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat-num.small { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-delta { font-size: 11.5px; font-weight: 650; letter-spacing: 0; }
.stat-delta.up { color: #16a34a; }
.stat-delta.down { color: #dc2626; }
[data-theme="dark"] .stat-delta.up { color: #4ade80; }
[data-theme="dark"] .stat-delta.down { color: #f87171; }

/* ---------- 平台入口 / platform links ---------- */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 22px;
}
.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--glass-ring);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s, color .2s;
}
.link-pill:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.lp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.lp-arrow { opacity: .45; font-size: 11px; transition: transform .2s var(--ease), opacity .2s; }
.link-pill:hover .lp-arrow { opacity: 1; transform: translate(1px, -1px); }
.link-pill.discord .lp-dot { background: #5865f2; }
.link-pill.github .lp-dot { background: #24292f; }
.link-pill.modrinth .lp-dot { background: #1bd96a; }
.link-pill.hangar .lp-dot { background: #f7a41d; }
.link-pill.spigot .lp-dot { background: #ed8106; }
[data-theme="dark"] .link-pill.github .lp-dot { background: #e6edf3; }
.link-pill.sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.foot-social { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }


/* ---------- 按钮 / buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s, background .25s, border-color .25s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, #17a35a, #0d7a43);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(15, 122, 66, .28);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(15, 122, 66, .38); }
.btn-ghost { background: var(--glass); border-color: var(--glass-ring); color: var(--text-2); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---------- 下载页 / download ---------- */
.dl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 22px;
  min-height: 24px;
}
.dl-meta .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 650;
  font-size: 12px;
}
[data-theme="dark"] .dl-meta .pill { color: var(--accent); }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.dl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--glass-ring);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  overflow: hidden;
}
.dl-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #5bb8ff);
  opacity: .85;
}
.dl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-border); }
.dl-card h3 { margin: 2px 0 0; font-size: 17px; }
.dl-card .dl-sub { font-size: 12.5px; color: var(--muted); margin: 0; }
.dl-card .dl-file {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-soft-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  word-break: break-all;
}
.dl-stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.dl-stats b { color: var(--text); font-weight: 650; }
.dl-card .btn { margin-top: auto; width: 100%; }

.dl-skeleton {
  height: 200px;
  border-radius: 14px;
  border: 1px solid var(--glass-ring);
  background: linear-gradient(100deg, var(--bg-soft) 20%, var(--bg-soft-2) 40%, var(--bg-soft) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

.dl-note { font-size: 12.5px; color: var(--muted); }
.dl-error {
  border: 1px solid var(--warn-border);
  background: var(--warn-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 20px;
}
.dl-error p { margin: 0 0 10px; color: var(--text-2); font-size: 13.5px; }

.release-notes {
  margin-top: 8px;
  padding: 18px 20px;
  border: 1px solid var(--glass-ring);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.72;
}
.release-notes:empty { display: none; }
.release-notes > *:first-child { margin-top: 0; }
.release-notes > *:last-child { margin-bottom: 0; }
.release-notes h3,
.release-notes h4,
.release-notes h5,
.release-notes h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  border: 0;
  padding: 0;
  margin: 22px 0 8px;
  scroll-margin-top: 0;
}
.release-notes h3 { font-size: 17px; }
.release-notes h4 { font-size: 15.5px; }
.release-notes h5 { font-size: 14.5px; }
.release-notes h6 { font-size: 13.5px; }
.release-notes h3::after,
.release-notes h4::after { display: none; }
.release-notes p { margin: 0 0 10px; color: var(--text-2); }
.release-notes ul,
.release-notes ol { margin: 0 0 12px; padding-left: 20px; }
.release-notes li { margin: 3px 0; }
.release-notes hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}
.release-notes blockquote {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-left: 3px solid var(--accent-border);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: 13px;
}
.release-notes blockquote p { margin: 0; }
.release-notes table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.release-notes thead th {
  background: var(--bg-soft);
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
}
.release-notes tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.release-notes tbody tr:last-child td { border-bottom: 0; }
.release-notes pre {
  background: var(--code-bg);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 12.2px;
  margin: 0 0 14px;
}
.release-notes pre code { font-size: inherit; background: none; border: 0; padding: 0; white-space: pre; }
.release-notes code { font-size: 12px; }

/* ---------- 滚动进场 / scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 主题切换圆形扩散 / view transition ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  border-radius: 0;
  overflow: hidden;
}
::view-transition-new(root) { z-index: 9999; }
::view-transition-old(root) { z-index: 1; }

/* 颜色本身也做过渡，切换时不会硬跳（View Transition 不可用时尤其明显） */
body {
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

html.theme-fading body,
html.theme-fading .topbar,
html.theme-fading .card,
html.theme-fading .home-card,
html.theme-fading .btn,
html.theme-fading .gui-demo,
html.theme-fading .hs-code,
html.theme-fading .home-links a,
html.theme-fading .badge,
html.theme-fading .link-pill,
html.theme-fading .callout,
html.theme-fading .table-wrap,
html.theme-fading .sidebar,
html.theme-fading .toc,
html.theme-fading .foot {
  transition: background-color .42s var(--ease), color .42s var(--ease),
              border-color .42s var(--ease), box-shadow .42s var(--ease);
}

/* ---------- 移动端 / responsive ---------- */
@media (max-width: 1279px) {
  .shell { grid-template-columns: 234px minmax(0, 1fr); gap: 30px; }
  .toc { display: none; }
}
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 18px; gap: 0; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: 272px;
    max-height: none;
    background: var(--glass-strong);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    padding: 20px 16px 40px;
    transform: translateX(-102%);
    transition: transform .28s var(--ease);
    z-index: 55;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; }
  .main { padding: 26px 0 56px; }
  .search { width: 150px; }
  .search kbd { display: none; }
  .brand-sub { display: none; }
  .hero h1 { font-size: 28px; }
  .hero-logo { width: 50px; height: 50px; border-radius: 13px; }
  h1 { font-size: 25px; }
  h2 { font-size: 19px; margin-top: 34px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; text-align: left; }
  .cards.two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .search { display: none; }
  .topbar-right { gap: 6px; }
  .langbtn span { display: none; }
  .langbtn { width: 36px; padding: 0; }
}

.overlay {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0;
  background: rgba(8, 18, 14, .42);
  z-index: 50;
  opacity: 0;
  transition: opacity .25s;
}
.overlay.show { display: block; opacity: 1; }
@media (min-width: 900px) { .overlay { display: none !important; } }

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }

/* ---------- 降级 / fallbacks ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .search-results, .card, .callout, .table-wrap, .figure, .pager a,
  .badge, .dl-card, .gui-grid, .release-notes, .sidebar {
    background: var(--bg-elev);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* 小圆点 / small dot */
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  animation: pulse 2.4s ease-out infinite;
}
