/*
Theme Name: Tixao Lab (AI 提效实验室)
Template: generatepress
Version: 1.0.0
Description: VitePress 文档风定制主题：墨绿品牌色、毛玻璃导航、代码块、callout、TOC、暗色模式
Author: MR.SHI
*/

/* ============================================================
   设计令牌（对齐 codex-china.com 的 VitePress + 墨绿定制色）
   ============================================================ */
:root {
  /* 品牌色 */
  --brand-1: #087f5b;
  --brand-2: #0b6b50;
  --brand-3: #075d46;
  --brand-soft: rgba(8, 127, 91, .14);
  --green-1: #18794e;

  /* 表面与文字（亮色） */
  --bg: #ffffff;
  --bg-alt: #f6f6f7;
  --bg-elv: #ffffff;
  --bg-soft: #f6f6f7;
  --divider: #e2e2e3;
  --text-1: #3c3c43;
  --text-2: #67676c;
  --text-3: #929295;

  /* 派生半透明色（禁 color-mix：部分浏览器/强制暗色扩展解析不了，会导致背景丢失显白） */
  --header-bg: rgba(255, 255, 255, .82);
  --brand-line: rgba(8, 127, 91, .28);
  --brand-line-strong: rgba(8, 127, 91, .45);
  --zebra-bg: rgba(246, 246, 247, .55);

  /* 代码 */
  --code-bg: rgba(142, 150, 170, .14);
  --code-color: #476582;
  --code-block-bg: #f6f6f7;
  --code-block-header: #ececed;

  /* callout */
  --tip-bg: rgba(8, 127, 91, .12);
  --tip-border: #087f5b;
  --warn-bg: rgba(234, 179, 8, .13);
  --warn-border: #d4a006;
  --danger-bg: rgba(220, 38, 38, .1);
  --danger-border: #c81e1e;
  --info-bg: rgba(8, 127, 91, .08);
  --info-border: #087f5b;

  /* 字号/间距 */
  --nav-h: 64px;
  --content-w: 46rem;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-2: 0 4px 16px rgba(15, 61, 46, .10), 0 1px 3px rgba(0, 0, 0, .06);

  /* 字体 */
  --font-base: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* 暗色模式（跟随系统） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b1f;
    --bg-alt: #161618;
    --bg-elv: #202127;
    --bg-soft: #202127;
    --divider: #2e2e32;
    --text-1: #dfdfd6;
    --text-2: #98989f;
    --text-3: #6a6a71;
    --green-1: #30a46c;
    --code-bg: rgba(101, 117, 133, .16);
    --code-color: #c6c6d0;
    --header-bg: rgba(27, 27, 31, .82);
    --brand-line: rgba(48, 164, 108, .35);
    --brand-line-strong: rgba(48, 164, 108, .5);
    --zebra-bg: rgba(22, 22, 24, .55);
    --code-block-bg: #161618;
    --code-block-header: #202127;
    --tip-bg: rgba(16, 185, 129, .16);
    --warn-bg: rgba(234, 179, 8, .14);
    --danger-bg: rgba(220, 38, 38, .16);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, .45);
  }
}

/* ============================================================
   基础
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--nav-h); /* 固定导航占位 */
}

a { color: var(--brand-1); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; }

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

::selection { background: var(--brand-soft); }

/* 布局容器 */
.lab-container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
   导航栏（毛玻璃固定）
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--divider);
}

.site-header .inside-header {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 滚动后：背景加深 + 阴影（垫在深色 hero 上时尤其明显）。禁 color-mix，用实色 */
.site-header.scrolled {
  background: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  border-bottom-color: var(--divider);
}

/* 站标：墨绿方块 + 站名 */
.main-title, .site-branding .main-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  line-height: 1;
}
.main-title a {
  color: var(--text-1);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
}
.main-title a::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--green-1), var(--brand-3));
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.main-title a:hover { color: var(--brand-2); }

/* 主菜单 */
.main-navigation { font-size: .925rem; background: transparent; }
/* GP 默认给容器/子菜单白底，暗色模式会露白——显式清零 */
.main-navigation .sub-menu { background: var(--bg-elv); border: 1px solid var(--divider); box-shadow: var(--shadow-1); }
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: .35rem;
  margin: 0; padding: 0;
}
.main-navigation li { margin: 0; }
.main-navigation a {
  display: block;
  padding: .45rem .8rem;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.main-navigation a:hover {
  color: var(--brand-2);
  background: var(--brand-soft);
  text-decoration: none;
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a { color: var(--brand-2); font-weight: 600; }

/* ---- 压过 GP 定制器内联输出（--contrast:#222 深灰暗色下不可见 / --accent 默认蓝不搭）----
   复制 GP 选择器结构 + !important 双保险，全部走本站 design token（有暗色版本） */
.main-navigation .main-nav ul li a,
.main-navigation .menu-bar-items a,
.main-navigation .menu-toggle { color: var(--text-1) !important; }
.main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a,
.main-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a,
.main-navigation .menu-bar-item:hover > a { color: var(--brand-2) !important; }
.main-navigation .main-nav ul li[class*="current-menu-"] > a { color: var(--brand-2) !important; }
.main-navigation .navigation-search input[type="search"] { color: var(--text-1) !important; }

/* 正文/卡片区链接压回墨绿（GP 内联 a{color:var(--accent)} 默认蓝在样式表之后，需 !important） */
.entry-content a,
.entry-title a,
.entry-meta a,
.widget a,
.comments-area a { color: var(--brand-1) !important; }
.entry-content a:hover, .entry-content a:focus,
.entry-title a:hover, .entry-meta a:hover,
.widget a:hover, .comments-area a:hover { color: var(--brand-2) !important; }
/* 页脚弱链接保持灰，不被上面规则殃及 */
.site-footer a, .site-info a, .inside-site-info a { color: var(--text-2) !important; }
.site-footer a:hover, .site-info a:hover, .inside-site-info a:hover { color: var(--brand-2) !important; }

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  border: 1px solid var(--divider);
  background: var(--bg-elv);
  border-radius: var(--radius-s);
  padding: .5rem .75rem;
  font-size: .9rem;
  color: var(--text-1);
  cursor: pointer;
}
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; align-items: center; gap: .4rem; }
  .main-navigation.toggled ul,
  .main-navigation ul {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--divider);
    padding: .75rem 1.5rem 1.25rem;
    gap: .15rem;
  }
  .main-navigation.toggled ul { display: flex; }
}

/* ============================================================
   首页（深色 hero + 玻璃拟态 + 微交互）
   ============================================================ */
.lab-home { display: block; }

/* ---- Hero：深绿黑渐变 + 光晕 + 网格，底部渐隐过渡到正文 ---- */
.lab-hero {
  position: relative;
  text-align: center;
  padding: 6rem 1.5rem 5.5rem;
  overflow: hidden;
  background:
    linear-gradient(165deg, #0b0f0d 0%, #0e1411 42%, #101815 100%);
  isolation: isolate;
}
.lab-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(42rem 22rem at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(42rem 22rem at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}
.lab-hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(34rem 18rem at 20% -5rem, rgba(8, 127, 91, .38), transparent 68%),
    radial-gradient(28rem 16rem at 82% 0%, rgba(24, 121, 78, .22), transparent 70%),
    radial-gradient(20rem 12rem at 60% 8rem, rgba(48, 164, 108, .10), transparent 70%);
  pointer-events: none;
}
.lab-hero::after { /* 底部渐隐，与正文底色无缝衔接 */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 7rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
/* 鼠标追光：radial 圆随指针（--mx/--my 由 JS 写入） */
.lab-hero-spot {
  position: absolute; inset: 0;
  z-index: 1;
  background: radial-gradient(16rem 16rem at var(--mx, 50%) var(--my, 0%), rgba(94, 234, 164, .1), transparent 62%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.lab-hero-spot.on { opacity: 1; }
.lab-hero-inner { position: relative; z-index: 2; max-width: 54rem; margin: 0 auto; }

.lab-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: .34rem .9rem;
  border-radius: 999px;
  letter-spacing: .04em;
  animation: lab-float-in .7s ease both;
}
.lab-badge i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35c48a;
  box-shadow: 0 0 0 3px rgba(53, 196, 138, .22);
  animation: lab-pulse 2.4s ease-in-out infinite;
}

.lab-hero h1 {
  margin: 1.5rem 0 0;
  font-size: clamp(2.3rem, 5.6vw, 3.5rem);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
  animation: lab-float-in .7s .08s ease both;
}
.lab-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #5eeaa4 8%, #35c48a 48%, #0f9d6d 92%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lab-hero .lab-sub {
  margin: 1.15rem auto 0;
  max-width: 36rem;
  font-size: 1.075rem;
  color: rgba(255, 255, 255, .68);
  line-height: 1.8;
  animation: lab-float-in .7s .16s ease both;
}
.lab-hero .lab-sub strong { color: rgba(255, 255, 255, .95); font-weight: 600; }

.lab-actions { margin-top: 2.1rem; display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; animation: lab-float-in .7s .24s ease both; }
.lab-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7em 1.6em;
  border-radius: var(--radius-m);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
}
.lab-btn svg { transition: transform .18s; }
.lab-btn:hover svg { transform: translateX(3px); }
.lab-btn:hover { text-decoration: none; transform: translateY(-2px); }
.lab-btn-primary {
  background: linear-gradient(180deg, #37c98f, #0a8a60);
  color: #fff;
  box-shadow: 0 4px 18px rgba(16, 160, 110, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.lab-btn-primary:hover { color: #fff; box-shadow: 0 8px 26px rgba(16, 160, 110, .55), inset 0 1px 0 rgba(255, 255, 255, .22); }
.lab-btn-ghost {
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lab-btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, .32); background: rgba(255, 255, 255, .12); }

.lab-hero-stats {
  margin-top: 2.8rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  animation: lab-float-in .7s .32s ease both;
}
.lab-hero-stats .lab-stat {
  text-align: center;
  min-width: 8.5rem;
  padding: .9rem 1.4rem;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-l);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.lab-hero-stats .lab-stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 750;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.lab-hero-stats .lab-stat span { font-size: .78rem; color: rgba(255, 255, 255, .55); }

/* ---- Hero 装饰：自动化终端窗 ---- */
.lab-hero-terminal {
  display: none;
  position: absolute;
  right: 2rem;
  bottom: 2.8rem;
  z-index: 2;
  width: 18rem;
  text-align: left;
  pointer-events: none; /* 纯装饰，不挡交互 */
  background: rgba(13, 20, 17, .82);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--radius-l);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: lab-term-float 6s ease-in-out infinite;
}
@media (min-width: 1180px) { .lab-hero-terminal { display: block; } }
.lab-term-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
}
.lab-term-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.lab-term-bar i:first-child { background: #37c98f; }
.lab-term-bar span {
  margin-left: .5rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: rgba(255, 255, 255, .45);
}
.lab-term-body { padding: .8rem .95rem 1rem; font-family: var(--font-mono); font-size: .74rem; line-height: 1.9; }
.lab-term-body p { margin: 0; color: rgba(255, 255, 255, .72); }
.lab-term-body em { font-style: normal; color: rgba(255, 255, 255, .4); margin-left: .4rem; }
.lab-term-body .t-ok { color: #37c98f; }
.lab-term-body .t-run { color: #fbbf24; }
.lab-term-body .t-done {
  margin-top: .5rem;
  padding-top: .55rem;
  border-top: 1px dashed rgba(255, 255, 255, .14);
  color: #5eeaa4;
  font-weight: 600;
}

@keyframes lab-float-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes lab-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(53, 196, 138, .22); }
  50%      { box-shadow: 0 0 0 5px rgba(53, 196, 138, .1); }
}
@keyframes lab-term-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* 通用 section */
.lab-section { padding: 3.5rem 1.5rem; }
.lab-section-head { max-width: 46rem; margin: 0 auto 2.2rem; text-align: center; }
.lab-section-head .lab-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-1);
}
.lab-section-head h2 {
  margin: .5rem 0 .4rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-1);
}
.lab-section-head p { margin: 0; color: var(--text-2); font-size: .95rem; }

/* 滚动渐显（theme.js IntersectionObserver 加 .visible） */
.lab-reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s cubic-bezier(.22,.61,.36,1), transform .65s cubic-bezier(.22,.61,.36,1); }
.lab-reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lab-reveal { opacity: 1; transform: none; transition: none; }
  .lab-hero-terminal, .lab-badge i { animation: none; }
}

/* 顶部滚动进度条 */
.lab-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  background: linear-gradient(90deg, var(--brand-1), var(--green-1), #5eeaa4);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
  pointer-events: none;
}

/* 主按钮涟漪 */
.lab-btn-primary { position: relative; overflow: hidden; }
.lab-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  transform: scale(0);
  animation: lab-ripple .62s cubic-bezier(.22,.61,.36,1) forwards;
  pointer-events: none;
}
@keyframes lab-ripple {
  to { transform: scale(1); opacity: 0; }
}

/* 卡片倾斜时由 JS 直写 transform， transition 只在 pointermove 时短、离开时回弹 */
.lab-cat-card, .lab-post-item { will-change: transform; }
.lab-cat-card:not(:hover), .lab-post-item:not(:hover) { transition: border-color .25s, box-shadow .25s, transform .45s cubic-bezier(.22,.61,.36,1); }

/* 平滑锚点滚动 */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 栏目卡片 */
.lab-cats-grid {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.1rem;
}
.lab-cat-card {
  position: relative;
  display: block;
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-l);
  padding: 1.5rem 1.4rem 1.3rem;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.lab-cat-card::before { /* 顶部渐变细线，hover 时展开 */
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand-1), var(--green-1));
  transform: scaleX(0);
  transition: transform .3s;
}
.lab-cat-card:hover {
  border-color: var(--brand-line-strong);
  box-shadow: 0 12px 32px rgba(8, 90, 62, .14);
  transform: translateY(-4px);
  text-decoration: none;
}
.lab-cat-card:hover::before { transform: scaleX(1); }
.lab-cat-card .lab-cat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-1), var(--green-1));
  box-shadow: 0 4px 12px rgba(8, 127, 91, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: transform .25s, box-shadow .25s;
}
.lab-cat-card:hover .lab-cat-icon { transform: scale(1.06) rotate(-3deg); box-shadow: 0 6px 18px rgba(8, 127, 91, .4); }
.lab-cat-card .lab-cat-icon svg { width: 22px; height: 22px; stroke: #fff; }
.lab-cat-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-1);
}
.lab-cat-card p {
  margin: 0 0 1rem;
  font-size: .86rem;
  line-height: 1.65;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab-cat-card .lab-cat-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand-1);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.lab-cat-card .lab-cat-more::after { content: "→"; transition: transform .2s; }
.lab-cat-card:hover .lab-cat-more::after { transform: translateX(3px); }
.lab-cat-card .lab-cat-more .lab-cat-count { color: var(--text-3); font-weight: 500; margin-left: .3rem; }
.lab-cat-card .lab-cat-more .lab-cat-count::after { content: ""; }

/* 最新文章列表 */
.lab-post-list { max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.lab-post-item {
  position: relative;
  display: block;
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-l);
  padding: 1.25rem 1.4rem 1.15rem;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.lab-post-item::before { /* 左侧绿条，hover 展开 */
  content: "";
  position: absolute; left: 0; top: .8rem; bottom: .8rem; width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand-1), var(--green-1));
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .25s;
}
.lab-post-item:hover {
  border-color: var(--brand-line-strong);
  box-shadow: 0 10px 28px rgba(8, 90, 62, .12);
  transform: translateY(-2px);
  text-decoration: none;
}
.lab-post-item:hover::before { transform: scaleY(1); }
.lab-post-item .lab-post-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .76rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: .4rem;
}
.lab-post-item .lab-post-meta .lab-post-cat {
  font-family: var(--font-base);
  background: var(--brand-soft);
  color: var(--brand-2);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-weight: 600;
}
.lab-post-item .lab-post-meta .lab-post-mins { color: var(--text-3); }
.lab-post-item .lab-post-meta .lab-post-mins::before { content: "· "; }
.lab-post-item h3 {
  margin: 0 0 .35rem;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.5;
  transition: color .2s;
}
.lab-post-item:hover h3 { color: var(--brand-2); }
.lab-post-item p {
  margin: 0 0 .7rem;
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab-post-item .lab-post-arrow {
  font-size: .8rem;
  font-weight: 600;
  color: var(--brand-1);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  opacity: .82;
}
.lab-post-item .lab-post-arrow svg { transition: transform .2s; }
.lab-post-item:hover .lab-post-arrow { opacity: 1; }
.lab-post-item:hover .lab-post-arrow svg { transform: translateX(4px); }

/* CTA */
.lab-cta { padding: 1.5rem 1.5rem 5.5rem; }
.lab-cta-box {
  position: relative;
  max-width: 52rem;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(120deg, #075d46 0%, #087f5b 52%, #0b6b50 100%);
  border-radius: calc(var(--radius-l) + 6px);
  padding: 3.4rem 2rem;
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(7, 93, 70, .28);
}
.lab-cta-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(22rem 12rem at 18% -3rem, rgba(94, 234, 164, .28), transparent 68%),
    radial-gradient(18rem 10rem at 85% 110%, rgba(53, 196, 138, .2), transparent 70%);
  pointer-events: none;
}
.lab-cta-box h2 { position: relative; margin: 0 0 .6rem; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.lab-cta-box p { position: relative; margin: 0 auto 1.7rem; max-width: 28rem; color: rgba(255, 255, 255, .78); font-size: .95rem; }
.lab-cta-box .lab-btn-primary {
  position: relative;
  background: #fff;
  color: #075d46;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
}
.lab-cta-box .lab-btn-primary:hover { color: #075d46; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }

/* ============================================================
   文章页 / 归档页
   ============================================================ */
.site-content { padding: 2.5rem 1.5rem 4rem; }
.site-content .content-area,
.site-content .inside-content-area,
.site-main { max-width: var(--content-w); margin: 0 auto; }

/* 文章卡（归档/搜索/分类列表） */
.blog .post, .archive .post, .search .post {
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-l);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.1rem;
  transition: border-color .2s, box-shadow .2s;
}
.blog .post:hover, .archive .post:hover, .search .post:hover {
  border-color: var(--brand-line-strong);
  box-shadow: var(--shadow-1);
}

/* 文章标题与元信息 */
.entry-title, .page .entry-title {
  font-size: 1.9rem;
  font-weight: 750;
  letter-spacing: -.022em;
  line-height: 1.3;
  margin: 0 0 .6rem;
}
.entry-title a { color: var(--text-1); text-decoration: none; }
.entry-title a:hover { color: var(--brand-2); }

.entry-meta, .entry-meta a {
  font-size: .82rem;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.entry-meta { margin-bottom: 1.6rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--divider); }
.entry-meta .cat-links a {
  font-family: var(--font-base);
  background: var(--brand-soft);
  color: var(--brand-2);
  border-radius: 999px;
  padding: .1rem .6rem;
  font-weight: 600;
  margin-left: .3rem;
}
.entry-meta .cat-links a:hover { text-decoration: none; background: var(--brand-1); color: #fff; }

/* 正文排版（vp-doc 风） */
/* ============================================================
   文章页（文档风：内容直铺，不用 GP 默认白卡片）
   ============================================================ */
.single .inside-article,
.page .inside-article,
.archive .inside-article,
.blog .inside-article,
.search .inside-article {
  background: transparent; /* GP 默认白卡片底，暗色模式清零 */
  padding-left: 0;
  padding-right: 0;
}
.single .entry-header,
.page .entry-header,
.archive .page-header,
.blog .page-header,
.search .page-header { background: transparent; }

/* ============================================================
   正文排版（中文长文阅读优化）
   ============================================================ */
.entry-content {
  font-size: 1.0625rem;          /* 17px：长文更舒适，告别 16px 偏小 */
  line-height: 1.92;             /* 中文行距，透气不拥挤 */
  color: var(--text-1);
  letter-spacing: .01em;         /* 中文微间距，避免字挤字 */
  word-break: break-word;
  overflow-wrap: anywhere;
  text-wrap: pretty;             /* 避免孤行、优化换行 */
  hanging-punctuation: allow-end;
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

.entry-content p {
  margin: 1.3em 0;
  text-align: justify;           /* 中文两端对齐，版式更端正 */
  text-justify: inter-ideograph;
}
/* 标题后的首段收紧，段落节奏更自然 */
.entry-content h2 + p,
.entry-content h3 + p,
.entry-content h4 + p { margin-top: .55em; }

.entry-content strong { font-weight: 700; color: var(--text-1); }
.entry-content em { font-style: italic; color: var(--text-1); }

.entry-content a {
  font-weight: 500;
  color: var(--brand-2);
  text-decoration: underline;
  text-decoration-color: var(--brand-line-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.entry-content a:hover {
  color: var(--brand-1);
  text-decoration-color: var(--brand-1);
  text-decoration-thickness: 2px;
}

/* 标题层级：h2 分隔线 + h3 左侧色条，层级一眼可辨 */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  position: relative;
  color: var(--text-1);
  font-weight: 700;
  letter-spacing: -.01em;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.entry-content h2 {
  font-size: 1.5rem;
  line-height: 1.45;
  margin: 2.6em 0 1em;
  padding-bottom: .5em;
  border-bottom: 1px solid var(--divider);
}
.entry-content h3 {
  font-size: 1.22rem;
  line-height: 1.5;
  margin: 2em 0 .85em;
  padding-left: .7em;
  border-left: 3px solid var(--brand-1);
}
.entry-content h4 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 1.6em 0 .6em;
}

/* 标题锚点 */
.entry-content h2, .entry-content h3, .entry-content h4 { position: relative; }
.header-anchor {
  position: absolute;
  left: -1.35em;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--brand-1);
  font-weight: 400;
  text-decoration: none;
  transition: opacity .15s;
  font-size: .85em;
}
.entry-content h2:hover .header-anchor,
.entry-content h3:hover .header-anchor,
.entry-content h4:hover .header-anchor { opacity: .8; }
@media (max-width: 900px) { .header-anchor { display: none; } }

/* 行内代码 */
.entry-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--code-bg);
  color: var(--code-color);
  border-radius: 5px;
  padding: .15em .42em;
  font-weight: 500;
  word-break: break-word;
}

/* 代码块 */
.entry-content pre, .entry-content pre code {
  font-family: var(--font-mono);
  font-size: .875rem;
  line-height: 1.75;
}
.entry-content pre {
  background: var(--code-block-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  margin: 1.5em 0;
  -webkit-overflow-scrolling: touch;
  tab-size: 2;
}
.entry-content pre code { background: none; padding: 0; color: var(--text-1); font-size: inherit; }

.code-block-wrap { margin: 1.4em 0; position: relative; }
.code-block-wrap pre { margin: 0; border-radius: 0 0 var(--radius-m) var(--radius-m); border-top: none; }
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--code-block-header);
  border: 1px solid var(--divider);
  border-bottom: none;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  padding: .35rem .5rem .35rem .95rem;
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-3);
}
.code-copy-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: .74rem;
  font-family: var(--font-base);
  padding: .25rem .6rem;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.code-copy-btn:hover { background: var(--bg-alt); color: var(--brand-2); }
.code-copy-btn.copied { color: var(--brand-1); font-weight: 600; }

/* 表格 */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  margin: 1.6em 0;
  display: table;
}
.entry-content table th, .entry-content table td {
  border: 1px solid var(--divider);
  padding: .7em 1em;
  text-align: left;
  line-height: 1.65;
  vertical-align: top;
}
.entry-content table th {
  background: var(--bg-alt);
  font-weight: 650;
  white-space: nowrap;
  color: var(--text-1);
}
.entry-content table td { color: var(--text-1); }
.entry-content table tr:nth-child(2n) td { background: var(--zebra-bg); }
.table-wrap { overflow-x: auto; margin: 1.6em 0; border-radius: var(--radius-m); max-width: 100%; }
.table-wrap table { margin: 0; }

/* 修复：GeneratePress 的 .site-content 是 flex，主列默认 min-width:auto，
 * 会被宽表格/长代码的 min-content 撑破，导致整页横向溢出（移动端尤其明显）。
 * 显式置 0 让主列可以收缩，宽内容交给 .table-wrap / pre 自己内部滚动。 */
.site-content,
#main,
.content-area,
.lab-single,
.lab-single-body,
.lab-single-content {
  min-width: 0;
}

/* 引用块（callout 风） */
.entry-content blockquote {
  margin: 1.6em 0;
  padding: 1em 1.25em;
  background: var(--tip-bg);
  border-left: 4px solid var(--tip-border);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  color: var(--text-1);
  font-size: 1rem;
  line-height: 1.85;
}
.entry-content blockquote p { margin: .35em 0; }
.entry-content blockquote p:first-child { margin-top: 0; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote strong:first-child { color: var(--brand-3); }

/* 列表 */
.entry-content ul, .entry-content ol { padding-left: 1.6em; margin: 1.2em 0; }
.entry-content li { margin: .45em 0; line-height: 1.8; }
.entry-content li::marker { color: var(--brand-1); }
.entry-content ul ul, .entry-content ol ol { margin: .4em 0; }

/* 分隔线 */
.entry-content hr { border: none; border-top: 1px solid var(--divider); margin: 2.6em 0; }

/* 图片 */
.entry-content .wp-block-image, .entry-content figure { margin: 1.8em 0; text-align: center; }
.entry-content .wp-block-image img, .entry-content img {
  border-radius: var(--radius-m);
  border: 1px solid var(--divider);
  max-width: 100%;
  height: auto;
}
.entry-content figcaption, .entry-content .wp-block-image figcaption {
  margin-top: .6em;
  font-size: .82rem;
  color: var(--text-3);
  text-align: center;
}

/* 上下篇导航 */
.post-navigation, #nav-below {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  font-size: .9rem;
}
.post-navigation a, #nav-below a { color: var(--text-2); }
.post-navigation a:hover, #nav-below a:hover { color: var(--brand-2); }

/* 归档页标题 */
.page-header { margin-bottom: 2rem; }
.page-header .page-title {
  font-size: 1.7rem;
  font-weight: 750;
  letter-spacing: -.02em;
  margin: 0;
}

/* ============================================================
   侧栏（目录卡片 + 小部件卡片）
   ============================================================ */
.widget-area.sidebar { font-size: .88rem; }
.widget-area .widget {
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-l);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.widget-area .widget-title, .widget-area .widgettitle {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .7rem;
  color: var(--text-1);
}
.widget-area .widget ul { list-style: none; margin: 0; padding: 0; }
.widget-area .widget ul li { margin: .3rem 0; }
.widget-area .widget ul li a { color: var(--text-2); font-size: .87rem; line-height: 1.55; }
.widget-area .widget ul li a:hover { color: var(--brand-2); }
.widget-area .widget select,
.widget-area .widget input[type="text"],
.widget-area .widget input[type="search"] {
  width: 100%;
  border: 1px solid var(--divider);
  border-radius: var(--radius-s);
  padding: .4em .6em;
  font-size: .88rem;
  background: var(--bg);
  color: var(--text-1);
}
.widget-area .widget .search-form button,
.widget-area .widget .search-submit {
  margin-top: .5rem;
  background: linear-gradient(180deg, var(--green-1), var(--brand-1));
  color: #fff;
  border: none;
  border-radius: var(--radius-s);
  padding: .42em 1.1em;
  font-size: .85rem;
  cursor: pointer;
}

/* 右侧目录（TOC 卡片，位于侧栏顶部） */
.lab-toc {
  font-size: .8rem;
}
.lab-toc .lab-toc-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .6rem;
}
.lab-toc ul { list-style: none; margin: 0; padding: 0; }
.lab-toc li { margin: 0; }
.lab-toc a {
  display: block;
  padding: .28rem .7rem;
  border-left: 2px solid var(--divider);
  color: var(--text-2);
  line-height: 1.5;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.lab-toc a:hover { color: var(--brand-2); text-decoration: none; }
.lab-toc a.active { color: var(--brand-2); border-left-color: var(--brand-1); font-weight: 600; }
.lab-toc .toc-h3 a { padding-left: 1.4rem; font-size: .94em; }
@media (max-width: 768px) { .lab-toc:not(.lab-toc--float) { display: none; } }

/* ---- 无侧栏布局：桌面右侧浮动目录（修复目录掉到页脚下方） ---- */
.lab-toc--float {
  position: fixed;
  top: 92px;
  right: 16px;
  width: 200px;
  max-height: calc(100dvh - 190px);
  overflow-y: auto;
  padding: .85rem .6rem .95rem;
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  z-index: 70;
  font-size: .78rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.lab-toc--float .lab-toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 0 .55rem;
}
.lab-toc--float::-webkit-scrollbar { width: 5px; }
.lab-toc--float::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 3px; }
.lab-toc-close { display: none; }
.lab-toc-toggle {
  position: fixed;
  left: 16px;
  bottom: 22px;
  z-index: 80;
  display: none;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem .55rem .7rem;
  border: 1px solid var(--divider);
  border-radius: 999px;
  background: var(--bg-elv);
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-2);
}
.lab-toc-toggle svg { width: 16px; height: 16px; }
.lab-toc-toggle:hover { color: var(--brand-2); border-color: var(--brand-line); }
.lab-toc-toggle:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }
.lab-toc-mask {
  position: fixed;
  inset: 0;
  z-index: 69;
  display: none;
  background: rgba(12, 22, 18, .45);
}
.lab-toc-mask.on { display: block; }
body.lab-toc-lock { overflow: hidden; }

/* ---- <1280px：目录改为底部抽屉 ---- */
@media (max-width: 1279px) {
  .lab-toc--float {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: 68dvh;
    padding: 1rem 1.1rem 1.5rem;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    border-bottom: 0;
    transform: translateY(104%);
    transition: transform .28s cubic-bezier(.32, .72, 0, 1);
    box-shadow: 0 -8px 30px rgba(10, 20, 16, .18);
  }
  .lab-toc--float.open { transform: none; }
  .lab-toc--float .lab-toc-title { padding: 0 0 .35rem; }
  .lab-toc--float .lab-toc-title::before {
    content: '';
    position: absolute;
    top: .45rem;
    left: 50%;
    width: 38px;
    height: 4px;
    margin-left: -19px;
    border-radius: 2px;
    background: var(--divider);
  }
  .lab-toc--float .lab-toc-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--divider);
    border-radius: 50%;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
  }
  .lab-toc--float .lab-toc-close svg { width: 14px; height: 14px; }
  .lab-toc--float .lab-toc-close:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }
  .lab-toc--float a { padding: .55rem .7rem; font-size: .95rem; }
  .lab-toc-toggle { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-toc--float { transition: none; }
}

/* ---- 分享栏 ---- */
.lab-share {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 2.4rem 0 0; padding: 1rem 1.1rem;
  border: 1px solid var(--divider); border-radius: var(--radius-m);
  background: var(--bg-soft);
}
.lab-share-label { font-size: .82rem; font-weight: 600; color: var(--text-3); }
.lab-share-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .42rem .85rem; border: 1px solid var(--divider); border-radius: 999px;
  background: var(--bg-elv); color: var(--text-2); font-size: .82rem;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.lab-share-btn:hover { color: var(--brand-2); border-color: var(--brand-line); background: var(--brand-soft); }
.lab-share-btn:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }
.lab-share-btn[hidden] { display: none; }

/* ---- 上一篇 / 下一篇 ---- */
.lab-postnav { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 2.2rem; }
.lab-postnav-item {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1rem 1.1rem; border: 1px solid var(--divider); border-radius: var(--radius-m);
  background: var(--bg-elv); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lab-postnav-item:hover { border-color: var(--brand-line-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.lab-postnav-label { font-size: .74rem; color: var(--text-3); letter-spacing: .04em; }
.lab-postnav-title { font-size: .92rem; font-weight: 600; color: var(--text-1); line-height: 1.45; }
.lab-postnav-next { text-align: right; align-items: flex-end; }
@media (max-width: 640px) {
  .lab-postnav { grid-template-columns: 1fr; }
  .lab-postnav-next { text-align: left; align-items: flex-start; }
}

/* ---- 轻提示 ---- */
.lab-toast {
  position: fixed; left: 50%; bottom: 88px; z-index: 95;
  transform: translate(-50%, 12px);
  padding: .6rem 1rem; border-radius: 999px;
  background: #0f2f26; color: #fff; font-size: .84rem;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 24px rgba(10, 25, 20, .28);
}
.lab-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---- 站内搜索 ---- */
.lab-search-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 .8rem; margin-left: auto;
  border: 1px solid var(--divider); border-radius: 999px;
  background: transparent; color: var(--text-2);
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  cursor: pointer; vertical-align: middle;
  flex: 0 0 auto; align-self: center;
  transition: color .15s, border-color .15s, background .15s;
}
.lab-search-btn:hover { color: var(--brand-2); border-color: var(--brand-line); }
.lab-search-btn:focus-visible { outline: 2px solid var(--brand-1); outline-offset: 2px; }
.lab-search-wrap {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 18vh; background: rgba(10, 20, 16, .45);
  backdrop-filter: blur(2px);
}
.lab-search-wrap.on { display: flex; }
.lab-search-form {
  display: flex; gap: .5rem; width: min(620px, 92vw); padding: .7rem;
  background: var(--bg-elv); border: 1px solid var(--divider);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(8, 20, 16, .28);
}
.lab-search-form input {
  flex: 1; min-width: 0; padding: .7rem .9rem;
  border: 1px solid var(--divider); border-radius: 8px;
  background: var(--bg); color: var(--text-1); font-size: .95rem;
}
.lab-search-form input:focus { outline: 2px solid var(--brand-line-strong); outline-offset: 1px; }
.lab-search-go {
  padding: .7rem 1.1rem; border: none; border-radius: 8px;
  background: var(--brand-1); color: #fff; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.lab-search-go:hover { background: var(--brand-2); }
.lab-search-close {
  padding: 0 .35rem; border: none; background: transparent;
  color: var(--text-3); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.lab-search-close:hover { color: var(--text-1); }

/* 回到顶部 */
.lab-top-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.75rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--bg-elv);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s, color .15s, border-color .15s;
  z-index: 50;
  box-shadow: var(--shadow-1);
}
.lab-top-btn.show { opacity: 1; visibility: visible; }
.lab-top-btn:hover { color: var(--brand-2); border-color: var(--brand-1); }
.lab-top-btn svg { width: 16px; height: 16px; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--divider);
  background: var(--bg-alt);
  padding: 2.2rem 1.5rem;
  margin-top: 0;
}
.site-footer .inside-site-info,
.site-footer .inside-footer,
.site-footer .site-info {
  max-width: 72rem;
  margin: 0 auto;
  font-size: .85rem;
  color: var(--text-2);
  background: transparent; /* GP 默认 site-info 白底，暗色模式清零 */
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--brand-2); }

/* ============================================================
   登录页美化
   ============================================================ */
body.login {
  background:
    radial-gradient(30rem 16rem at 20% -5rem, var(--brand-soft), transparent 70%),
    radial-gradient(26rem 14rem at 85% 0%, rgba(24, 121, 78, .10), transparent 70%),
    var(--bg);
  padding-top: 0;
}
body.login #login { padding-top: 6vh; }
body.login h1 a {
  background: none;
  width: auto;
  height: auto;
  text-indent: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--brand-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
body.login h1 a::before {
  content: "";
  width: 14px; height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--green-1), var(--brand-3));
  box-shadow: 0 0 0 3px var(--brand-soft);
}
body.login form {
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
  padding: 1.6rem 1.5rem;
}
body.login .button-primary {
  background: linear-gradient(180deg, var(--green-1), var(--brand-1));
  border: none;
  border-radius: var(--radius-m);
  box-shadow: 0 2px 8px rgba(8, 127, 91, .3);
  text-shadow: none;
}
body.login .button-primary:hover { background: var(--brand-2); }
body.login .button-primary:focus { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-1); }
body.login input[type="text"], body.login input[type="password"] {
  border: 1px solid var(--divider);
  border-radius: var(--radius-s);
  padding: .35em .7em;
  font-size: .95rem;
}
body.login input[type="text"]:focus, body.login input[type="password"]:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px var(--brand-soft); }
body.login .message, body.login .notice { border-radius: var(--radius-m); }

/* 小屏微调 */
@media (max-width: 768px) {
  .lab-hero { padding: 3.5rem 1.25rem 3rem; }
  .lab-section { padding: 2.5rem 1.25rem; }
  .lab-hero-stats { gap: 1.6rem; }
  .entry-title, .page .entry-title { font-size: 1.55rem; }
  .site-content { padding: 1.75rem 1.25rem 3rem; }
}

/* ============================================================
   文章详情页：深色标题头图带 + 干净阅读版式
   ============================================================ */
html { overflow-x: hidden; } /* 配合全幅 hero，防 100vw 滚动条溢出 */

.lab-single { display: block; margin-inline: auto; } /* 容器内居中：全幅 hero 公式要求父链视口居中 */

.lab-single-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(40rem 22rem at 16% -8rem, var(--brand-soft), transparent 70%),
    radial-gradient(34rem 18rem at 84% -4rem, rgba(24, 121, 78, .12), transparent 70%),
    linear-gradient(180deg, #0b0f0d 0%, #101815 100%);
}
.lab-single-hero::after { /* 底部渐隐到正文底色，与首页一致 */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 6rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.lab-single-inner { position: relative; z-index: 1; max-width: 46rem; margin: 0 auto; }
.lab-single-cat {
  display: inline-block;
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
  color: var(--brand-3);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  padding: .3rem .85rem; border-radius: 999px;
  text-decoration: none;
  transition: transform .15s, border-color .15s;
}
.lab-single-cat:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--brand-line-strong); color: var(--brand-2); }
.lab-single-title {
  margin: 1.3rem 0 0;
  font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  line-height: 1.24; font-weight: 800; letter-spacing: -.02em;
  color: #fff;
}
.lab-single-meta {
  margin-top: 1.25rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  flex-wrap: wrap;
  font-size: .85rem; color: rgba(255, 255, 255, .62);
}
.lab-single-meta-item { display: inline-flex; align-items: center; gap: .35rem; }
.lab-single-meta-item svg { opacity: .85; }
.lab-single-meta-dot { opacity: .4; }

.lab-single-body { max-width: 46rem; margin: 0 auto; padding: 2.6rem 1.5rem 4rem; }
.lab-single-content.lab-reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.lab-single-content.lab-reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lab-single-content.lab-reveal { opacity: 1; transform: none; transition: none; }
}

/* 相关阅读 */
.lab-single-foot { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--divider); }
.lab-foot-head {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 1.1rem;
}
.lab-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.lab-related-card {
  display: block; background: var(--bg-elv); border: 1px solid var(--divider);
  border-radius: var(--radius-l); padding: 1.15rem 1.2rem; text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.lab-related-card:hover { border-color: var(--brand-line-strong); box-shadow: var(--shadow-1); transform: translateY(-3px); text-decoration: none; }
.lab-related-cat { font-size: .76rem; font-weight: 600; color: var(--brand-1); }
.lab-related-card h3 { margin: .4rem 0 .6rem; font-size: .98rem; font-weight: 600; line-height: 1.45; color: var(--text-1); }
.lab-related-card:hover h3 { color: var(--brand-2); }
.lab-related-more { font-size: .82rem; font-weight: 600; color: var(--text-3); }
.lab-related-card:hover .lab-related-more { color: var(--brand-1); }

.lab-single-back { margin-top: 2.5rem; text-align: center; }

@media (max-width: 768px) {
  .lab-single-hero { padding: 3.5rem 1.25rem 3rem; }
  .lab-single-body { padding: 2rem 1.25rem 3rem; }
}
