/* =========================================================
   TG 工具箱 前台样式（GitBook 风格）
   ========================================================= */
:root {
  --brand: #2aabee;
  --brand-dark: #1d8fd0;
  --brand-soft: #eaf6fd;
  --text: #1f2933;
  --text-muted: #6b7a8c;
  --text-light: #93a1b0;
  --border: #e6e9ef;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-code: #f6f8fa;
  --danger: #d9534f;
  --success: #2e9e6b;
  --warn: #c98a00;
  --topbar-h: 64px;
  --sidebar-w: 272px;
  --toc-w: 220px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --shadow-brand: 0 14px 34px rgba(42, 171, 238, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
}

.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 100;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #2aabee, #6bd4ff, #9b8cff);
  box-shadow: 0 0 10px rgba(42, 171, 238, 0.65);
  transition: width 0.1s linear;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}
.topbar__brand:hover { text-decoration: none; }

.logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex: none;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(42, 171, 238, 0.35);
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.topbar__nav { display: flex; gap: 4px; }
.topbar__nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
}
.topbar__nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.topbar__nav a.is-active { color: var(--brand-dark); background: var(--brand-soft); }

.topbar__spacer { flex: 1; }

.topbar__search {
  position: relative;
  width: 220px;
  flex: none;
}
.topbar__search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.topbar__search input:focus { border-color: var(--brand); background: #fff; }
.topbar__search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-light);
}
.topbar__search-toggle { display: none; }
.topbar__search-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.mobile-search { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--brand { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(42, 171, 238, 0.35); }
.btn--brand:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { border-color: var(--border); color: var(--text); background: #fff; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: #fff; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn svg { width: 16px; height: 16px; }

.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: none;
}
.hamburger svg { width: 18px; height: 18px; fill: var(--text); }

/* ---------------- 三栏布局 ---------------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}
.layout--no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* ---------------- 左侧目录树 ---------------- */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 22px 14px 40px 20px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  font-size: 14px;
}
.sidebar__section { margin-bottom: 20px; }
.sidebar__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 10px 8px;
}

/* 首页入口 */
.nav-home {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}
.nav-home svg { width: 17px; height: 17px; fill: var(--brand); flex: none; }
.nav-home:hover { background: var(--bg-soft); text-decoration: none; }
.nav-home.is-active { background: var(--brand-soft); color: var(--brand-dark); }

/* 产品级折叠 */
.nav-group { margin-bottom: 2px; }
.nav-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--text-light);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s;
  flex: none;
}
.nav-group[open] > summary::before { transform: rotate(90deg); }
.nav-group > summary:hover { background: var(--bg-soft); }
.nav-group__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-group__count { color: var(--text-light); font-size: 11.5px; font-weight: 500; flex: none; }
.nav-group__body {
  padding: 2px 0 8px 10px;
  margin-left: 9px;
  border-left: 1px solid var(--border);
}

/* 项目介绍等普通入口 */
.nav-item {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-item.is-active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }

.nav-subtitle {
  padding: 8px 10px 3px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

/* 分类级折叠 */
.nav-cat > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.nav-cat > summary::-webkit-details-marker { display: none; }
.nav-cat > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid var(--text-light);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.15s;
  flex: none;
}
.nav-cat[open] > summary::before { transform: rotate(90deg); }
.nav-cat > summary:hover { background: var(--bg-soft); color: var(--text); }

.tree { list-style: none; margin: 0; padding: 0; }
.tree__link {
  display: block;
  margin: 1px 0 1px 12px;
  padding: 5px 10px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 13.5px;
}
.tree__link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.tree__link.is-active {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-left-color: var(--brand);
  font-weight: 600;
}
.sidebar__empty { padding: 6px 10px; color: var(--text-light); font-size: 12.5px; }

/* ---------------- 内容区 ---------------- */
.content { min-width: 0; padding: 36px 48px 72px; }
.content__inner { max-width: 820px; margin: 0 auto; }

/* ---------------- 动态首页首屏 ---------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: 28px;
  min-height: 430px;
  margin: -8px -18px 34px;
  padding: 42px 34px;
  overflow: hidden;
  border: 1px solid #d8effb;
  border-radius: 24px;
  background: linear-gradient(135deg, #f4fbff 0%, #eef8ff 52%, #f7f5ff 100%);
}
.hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: linear-gradient(rgba(42,171,238,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(42,171,238,.10) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, #000, transparent 85%);
  animation: hero-grid-drift 20s linear infinite;
}
.hero__glow { position: absolute; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.hero__glow--one { width: 280px; height: 280px; right: 22%; top: -130px; background: rgba(84, 205, 255, .25); animation: hero-glow 7s ease-in-out infinite; }
.hero__glow--two { width: 220px; height: 220px; right: -40px; bottom: -100px; background: rgba(145, 117, 255, .18); animation: hero-glow 9s ease-in-out -2s infinite reverse; }
.hero__copy, .hero__visual { position: relative; z-index: 1; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.hero__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #35c98b; box-shadow: 0 0 0 5px rgba(53,201,139,.15); }
.hero h1 { margin: 16px 0 14px; color: #172b3a; font-size: clamp(32px, 4vw, 48px); line-height: 1.18; letter-spacing: -.04em; }
.hero h1 strong { color: var(--brand-dark); font-weight: 750; }
.hero__copy > p { max-width: 470px; margin: 0; color: #60788b; font-size: 16px; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn--hero-ghost { border-color: #b9dff1; background: rgba(255,255,255,.64); color: #216e98; }
.btn--hero-ghost:hover { background: #fff; color: var(--brand-dark); }
.hero__stats { display: flex; gap: 24px; margin-top: 30px; }
.hero__stats div { display: flex; flex-direction: column; }
.hero__stats strong { color: #1e5f81; font-size: 21px; line-height: 1.2; }
.hero__stats span { color: #7790a1; font-size: 12px; }
.hero__unit { font-size: 13px !important; }
.hero__visual { min-height: 290px; display: grid; place-items: center; }
.hero-panel { position: relative; width: min(100%, 340px); aspect-ratio: 1.12; border: 1px solid rgba(255,255,255,.72); border-radius: 20px; background: linear-gradient(145deg, rgba(23,52,73,.96), rgba(20,35,57,.95)); box-shadow: 0 28px 55px rgba(24,63,91,.23); transform: perspective(900px) rotateY(-9deg) rotateX(4deg); animation: panel-float 6s ease-in-out infinite; }
.hero-panel__top { display: flex; align-items: center; gap: 6px; padding: 16px 18px; color: #91aabb; font-size: 11px; }
.hero-panel__top b { margin-left: auto; color: #b7d7e8; font-weight: 600; letter-spacing: .08em; }
.hero-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff7373; }.hero-dot:nth-child(2) { background: #ffd36a; }.hero-dot:nth-child(3) { background: #55d99c; }
.hero-panel__signal { position: absolute; left: 24px; right: 24px; top: 84px; display: grid; gap: 10px; }
.signal-line { height: 7px; width: 82%; border-radius: 99px; background: linear-gradient(90deg, #2aabee, #6fd5ff); opacity: .85; }.signal-line--short { width: 58%; opacity: .55; }.signal-line--tiny { width: 38%; opacity: .3; }
.hero-panel__orb { position: absolute; right: 28px; bottom: 48px; display: grid; place-items: center; width: 82px; height: 82px; border: 1px solid rgba(98,211,255,.55); border-radius: 50%; color: #83dcff; font-size: 32px; background: radial-gradient(circle, rgba(42,171,238,.36), rgba(42,171,238,.04) 68%); box-shadow: 0 0 35px rgba(42,171,238,.3); animation: orb-pulse 3.6s ease-in-out infinite; }
.hero-panel__status { position: absolute; left: 24px; bottom: 26px; color: #6fd5a7; font-size: 10px; letter-spacing: .12em; }.hero-panel__status i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.hero-float { position: absolute; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.75); border-radius: 10px; color: #41667d; background: rgba(255,255,255,.83); box-shadow: 0 12px 25px rgba(38,93,123,.14); font-size: 11px; font-weight: 600; backdrop-filter: blur(8px); }.hero-float span { color: var(--brand); font-size: 15px; }.hero-float--one { top: 18%; right: 0; animation: float-card 5.5s ease-in-out infinite; }.hero-float--two { bottom: 14%; left: 0; animation: float-card 6.5s ease-in-out -1.5s infinite reverse; }
.hero + .intro-section { margin-top: 0; }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-group] > * { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
[data-reveal-group].is-visible > * { opacity: 1; transform: none; }.card-grid.is-visible > *:nth-child(2) { transition-delay: .08s; }.card-grid.is-visible > *:nth-child(3) { transition-delay: .16s; }.card-grid.is-visible > *:nth-child(4) { transition-delay: .24s; }
@keyframes hero-grid-drift { to { transform: translate3d(34px, 34px, 0); } }
@keyframes hero-glow { 0%,100% { transform: scale(.9) translate3d(0,0,0); opacity: .65; } 50% { transform: scale(1.08) translate3d(-20px,16px,0); opacity: 1; } }
@keyframes panel-float { 0%,100% { transform: perspective(900px) rotateY(-9deg) rotateX(4deg) translateY(0); } 50% { transform: perspective(900px) rotateY(-6deg) rotateX(2deg) translateY(-8px); } }
@keyframes orb-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes float-card { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span.sep { color: var(--text-light); }

.page-title { margin: 0 0 10px; font-size: 30px; line-height: 1.35; }
.page-lead { color: var(--text-muted); font-size: 16px; margin: 0 0 24px; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  border: 1px solid var(--border);
}
.chip--brand { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }

/* ---------------- 右侧本页目录 ---------------- */
.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 38px 24px 40px 8px;
  font-size: 13px;
}
.toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc__list a {
  display: block;
  padding: 4px 0 4px 12px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.5;
}
.toc__list a:hover { color: var(--brand-dark); text-decoration: none; }
.toc__list a.is-active { color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }
.toc__list .toc__lvl3 a { padding-left: 24px; font-size: 12.5px; }

/* ---------------- 首页介绍区（页面首个区块） ---------------- */
.intro-section {
  padding: 0 0 26px;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--border);
}
.intro-section__title {
  font-size: 30px;
  line-height: 1.35;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.article--intro h2 { font-size: 18px; margin: 22px 0 10px; }
.article--intro h3 { font-size: 16px; margin: 18px 0 8px; }
.article--intro p { margin: 0 0 12px; color: var(--text-muted); }
.article--intro .blk-steps { margin-bottom: 14px; }
.article--intro .blk-callout { margin-bottom: 16px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 44px 0 18px;
}
.section-head h2 { font-size: 21px; margin: 0; }
.section-head a { font-size: 13px; }
.section-note { color: var(--text-light); font-size: 12px; }

/* ---------------- 产品与教程详情头部 ---------------- */
.product-heading, .tutorial-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.product-kicker, .tutorial-kicker { display: block; color: var(--brand-dark); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin-bottom: 8px; }
.product-heading .page-title, .tutorial-heading .page-title { margin-bottom: 0; }
.product-heading__mark { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #cbe9f7; border-radius: 16px; color: var(--brand); background: var(--brand-soft); font-size: 25px; box-shadow: var(--shadow-brand); animation: orb-pulse 3.6s ease-in-out infinite; }
.product-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 24px 0 28px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); }
.product-metrics > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--bg-soft); }
.product-metrics strong { color: var(--brand-dark); font-size: 21px; line-height: 1.2; }
.product-metrics span { color: var(--text-muted); font-size: 12px; }

/* ---------------- 产品卡片 ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  color: inherit;
}
.card:hover {
  text-decoration: none;
  border-color: #cfe8f8;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card__cover {
  height: 140px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card__cover-ph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}
.card__body { padding: 16px 18px 18px; }
.card__title-row { display: flex; align-items: center; gap: 8px; }
.card__title { flex: 1; font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.card__arrow { color: var(--brand); font-size: 20px; opacity: .65; transform: translate(-2px, 2px); transition: transform .2s, opacity .2s; }
.card:hover .card__arrow { opacity: 1; transform: translate(1px, -1px); }
.card__desc {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.card__price { color: var(--brand-dark); font-weight: 700; font-size: 15px; }
.card__price small { color: var(--text-light); font-weight: 400; margin-left: 6px; }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__hint { color: var(--text-light); font-size: 12px; }

/* ---------------- 列表 ---------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}
.list__item:first-child { border-top: 1px solid var(--border); }
.list__title { font-size: 16px; font-weight: 600; }
.list__title:hover { text-decoration: none; }
.list__desc { color: var(--text-muted); font-size: 13.5px; margin: 6px 0 8px; }
.list__meta { color: var(--text-light); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }

.group-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 30px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-soft);
}

/* ---------------- 正文块 ---------------- */
.article { font-size: 15.5px; }
.article > *:first-child { margin-top: 0; }
.article h2 {
  font-size: 23px;
  margin: 38px 0 14px;
  padding-top: 4px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article h3 {
  font-size: 18px;
  margin: 28px 0 12px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article h4 { font-size: 15.5px; margin: 0 0 4px; }
.article p { margin: 0 0 16px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}
.article pre { margin: 0; }
.article pre code { background: none; border: none; padding: 0; font-size: 13.5px; }

.blk-code {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 20px;
  background: var(--bg-code);
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: #eef2f6;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.code-copy { border: 1px solid var(--border); border-radius: 6px; padding: 4px 9px; color: var(--text-muted); background: rgba(255,255,255,.7); cursor: pointer; font: inherit; font-size: 11px; transition: all .15s; }
.code-copy:hover, .code-copy.is-copied { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.code-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.blk-code .highlight { overflow-x: auto; padding: 14px 16px; }
.blk-code-caption { color: var(--text-muted); font-size: 13px; padding: 0 16px 10px; margin: 0; }

.blk-image, .blk-video { margin: 0 0 20px; text-align: center; }
.blk-image img, .blk-video video {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 520px;
}
.blk-image img.is-zoomable, .blk-gallery img.is-zoomable { cursor: zoom-in; transition: transform .2s, box-shadow .2s; }
.blk-image img.is-zoomable:hover, .blk-gallery img.is-zoomable:hover { transform: scale(1.01); box-shadow: var(--shadow-md); }
.blk-video video { width: 100%; background: #000; }
.blk-image figcaption, .blk-video figcaption {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}
.blk-gallery { display: grid; gap: 12px; margin: 0 0 20px; }
.blk-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.blk-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.blk-gallery figure { margin: 0; }
.blk-gallery img { border: 1px solid var(--border); border-radius: 8px; width: 100%; }
.blk-gallery-caption { color: var(--text-muted); font-size: 13px; text-align: center; margin: -8px 0 20px; }

.blk-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; }
.blk-steps > li {
  position: relative;
  padding: 0 0 18px 44px;
  border-left: 2px solid var(--border);
  margin-left: 14px;
}
.blk-steps > li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.blk-steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -15px;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps-text { color: var(--text-muted); font-size: 14px; }
.blk-steps-title { font-weight: 600; margin: 0 0 12px; }

.blk-callout {
  border-radius: var(--radius);
  border: 1px solid;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14.5px;
}
.blk-callout .callout-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.blk-callout .callout-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.callout-info { background: #f2f8fd; border-color: #cfe6f7; color: #1c6fa3; }
.callout-tip { background: #f1faf4; border-color: #cdecd9; color: #1f7a4d; }
.callout-warning { background: #fff9ec; border-color: #f4e2b6; color: #956a00; }
.callout-important { background: #fdf2f2; border-color: #f4cfcf; color: #b04141; }
.blk-callout .callout-body { color: var(--text); }
.blk-divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------------- 上一篇 / 下一篇 ---------------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
}
.pager a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  background: #fff;
}
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager span { display: block; color: var(--text-light); font-size: 12px; margin-bottom: 3px; }
.pager .pager__next { text-align: right; }
.pager__empty { visibility: hidden; }
.related { margin-top: 46px; }
.related .section-head { margin-top: 0; }
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related-card { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 112px; padding: 15px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--bg-soft); transition: transform .2s, border-color .2s, box-shadow .2s; }
.related-card:hover { border-color: #bfe2f2; box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-3px); }
.related-card__number { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.related-card__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.related-card__body strong { font-size: 14px; line-height: 1.45; }
.related-card__body small { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.related-card__arrow { position: absolute; right: 12px; bottom: 10px; color: var(--brand); font-size: 18px; opacity: .65; transition: transform .2s; }
.related-card:hover .related-card__arrow { transform: translateX(4px); }

/* ---------------- CTA 横幅 ---------------- */
.cta {
  position: relative;
  overflow: hidden;
  margin-top: 56px;
  background: linear-gradient(125deg, #122333, #193a51 58%, #263252);
  border-radius: 14px;
  padding: 34px 38px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cta__grid { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(133,215,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(133,215,255,.35) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(90deg, #000, transparent 75%); animation: hero-grid-drift 22s linear infinite; }
.cta__glow { position: absolute; width: 240px; height: 240px; right: 8%; top: -170px; border-radius: 50%; background: rgba(68,196,255,.23); filter: blur(4px); animation: hero-glow 8s ease-in-out infinite; }
.cta > *:not(.cta__grid):not(.cta__glow) { position: relative; z-index: 1; }
.cta__eyebrow { display: block; margin-bottom: 8px; color: #76d7ff; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.cta h2 { margin: 0 0 6px; font-size: 22px; }
.cta p { margin: 0; color: #9fb0c2; font-size: 14px; }

/* ---------------- 页脚 ---------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 48px;
  color: var(--text-light);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-soft);
}
.footer a { color: var(--text-muted); }

/* ---------------- 公告弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 26px 26px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.modal__title { margin: 0 0 12px; font-size: 19px; }
.modal__body { color: var(--text-muted); font-size: 14.5px; }
.modal__body p { margin: 0 0 12px; }
.modal__actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.modal-mask[hidden] { display: none; }

/* ---------------- 搜索 ---------------- */
.search-hero { margin-bottom: 26px; }
.search-box {
  display: flex;
  gap: 10px;
  max-width: 560px;
}
.search-box input {
  flex: 1;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box button { height: 46px; padding: 0 22px; }
.empty {
  text-align: center;
  color: var(--text-light);
  padding: 60px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.empty h3 { color: var(--text-muted); margin: 0 0 8px; font-size: 16px; }
.lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(9, 20, 30, .86); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 94vw); max-height: 88vh; object-fit: contain; border-radius: 10px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.lightbox__close { position: absolute; top: 18px; right: 22px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 28px; line-height: 1; cursor: pointer; }
.error-page { margin-top: 60px; }
.error-page h1 { font-size: 52px; margin: 0 0 8px; color: var(--brand); }
.error-page__actions { margin-top: 18px; }
mark { background: #fff3bf; color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------------- 移动端 ---------------- */
.sidebar-mask {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(15, 23, 32, 0.35);
  z-index: 40;
}
.sidebar-mask.is-open { display: block; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar__nav { display: none; }
  .topbar__search { display: none; }
  .topbar__search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff; cursor: pointer; }
  .hamburger { display: inline-flex; }
  .layout, .layout--no-toc { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: auto;
    z-index: 50;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.is-open { transform: translateX(0); }
  .content { padding: 24px 18px 60px; }
  .mobile-search { display: block; padding: 10px 14px 0; background: var(--bg); }
  .mobile-search[hidden] { display: none; }
  .mobile-search__form { display: flex; gap: 8px; }
  .mobile-search__form input { min-width: 0; flex: 1; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
  .mobile-search__form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
  .mobile-search__form .btn { height: 40px; padding: 0 14px; }
  .hero { grid-template-columns: 1fr; min-height: auto; margin: -6px -4px 28px; padding: 30px 22px 24px; border-radius: 18px; }
  .hero__visual { min-height: 230px; }
  .hero-panel { width: min(100%, 300px); }
  .hero-float--one { right: -4px; }.hero-float--two { left: -4px; }
  .page-title { font-size: 24px; }
  .intro-section__title { font-size: 24px; }
  .intro-section { padding: 0 0 22px; }
  .pager { grid-template-columns: 1fr; }
  .related__grid { grid-template-columns: 1fr; }
  .product-heading__mark { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
  .cta { padding: 26px 22px; }
  .footer { padding: 20px 18px; }
  .blk-gallery.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .topbar__brand { min-width: 0; font-size: 14px; }
  .topbar__brand > span:last-child { max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
  .topbar > .btn { width: 38px; padding: 0; font-size: 0; }
  .hero h1 { font-size: 31px; }
  .hero__stats { gap: 16px; }
  .hero__stats strong { font-size: 19px; }
  .hero__visual { min-height: 205px; transform: scale(.92); margin: -8px 0 -10px; }
}

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