/* ============================================================
   LoFly Bio — Scientific Editorial / Lab Instrument design system
   Fonts: Fraunces (display serif) · IBM Plex Sans (body) · IBM Plex Mono (data)
   Motif: binding-curve (SPR sensorgram) trace + lab-notebook grid
   ============================================================ */

:root {
  --paper: #F6F3EC;
  --paper-2: #EFEBE0;
  --ink: #12201F;
  --ink-2: #1D3231;
  --teal: #0F7B72;
  --teal-bright: #1FA89B;
  --amber: #E09A3E;
  --line: #D6D0C2;
  --muted: #5E6D6B;
  --chip: #E9E4D6;
  --white: #FDFCF9;

  --serif: "Fraunces", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --sans: "IBM Plex Sans", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Noto Sans Mono", ui-monospace, monospace;

  --shadow-hard: 4px 4px 0 var(--ink);
  --radius: 2px;

  /* semantic states (derived from palette, per brand-guidelines §2) */
  --ok: #1FA89B;
  --warn: #E09A3E;
  --danger: #B4432E;
  --ok-tint: #E0F2EE;
  --warn-tint: #F3E4C3;
  --danger-tint: #F4DEDA;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- shared layout ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ---------- grain / atmosphere ---------- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.13 0 0 0 0 0.12 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .5;
}
.wrap, .site-header, .hero, .ticker, .site-footer { position: relative; z-index: 1; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 18px; padding-bottom: 14px; gap: 16px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.35rem;
  letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 10px;
}
.brand .mark {
  font-family: var(--mono); font-size: .6em; font-weight: 500;
  color: var(--teal); letter-spacing: .14em; text-transform: uppercase;
}
.site-nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: .85rem;
  letter-spacing: .02em; border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--teal); border-color: var(--teal); }
.lang {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--teal);
  border: 1px solid var(--teal); border-radius: 999px;
  padding: 4px 12px; text-decoration: none; transition: background .15s, color .15s;
}
.lang:hover { background: var(--teal); color: var(--white); }

/* ---------- hero (homepage) ---------- */
.hero {
  background: var(--ink); color: var(--paper);
  padding: 72px 0 56px;
  background-image:
    linear-gradient(var(--ink-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-2) 1px, transparent 1px);
  background-size: 44px 44px;
  overflow: hidden;
}
.hero .kicker { color: var(--teal-bright); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 380; font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05; letter-spacing: -.02em;
  margin: 14px 0 18px; max-width: 15ch;
}
.hero .sub { color: #B9C6C3; font-size: 1.06rem; max-width: 52ch; }
.hero .trace { width: min(560px, 90%); margin-top: 34px; }

/* binding-curve trace animation */
.trace path {
  fill: none; stroke: var(--teal-bright); stroke-width: 2.4;
  stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: trace-draw 1.8s cubic-bezier(.4,0,.2,1) forwards;
}
.trace .t-grid { stroke: var(--ink-2); stroke-width: 1; }
@keyframes trace-draw { to { stroke-dashoffset: 0; } }

/* ---------- ticker ---------- */
.ticker {
  background: var(--amber); color: var(--ink);
  overflow: hidden; border-bottom: 1px solid var(--ink);
  padding: 10px 0; white-space: nowrap;
}
.ticker-track {
  display: inline-block; animation: ticker 30s linear infinite;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .12em;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- section headings (index) ---------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--ink); margin: 64px 0 26px; padding-bottom: 10px;
}
.sec-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin: 0; }
.sec-head .mono-note { font-family: var(--mono); font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }

/* ---------- index list (editorial) ---------- */
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 18px; align-items: baseline;
  padding: 15px 4px; border-bottom: 1px solid var(--line);
}
.index-list .idx { font-family: var(--mono); color: var(--teal); font-size: .78rem; }
.index-list a {
  color: var(--ink); text-decoration: none; font-family: var(--serif);
  font-size: 1.14rem; line-height: 1.3; transition: color .15s;
}
.index-list a:hover { color: var(--teal); }
.index-list .tag { font-family: var(--mono); font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- module cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; margin: 36px 0 8px; }
.card {
  background: var(--white); border: 1px solid var(--ink);
  box-shadow: var(--shadow-hard);
  padding: 24px 22px; position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:nth-child(2n) { transform: translateY(10px); }
.card:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; width: 100%;
  background: var(--teal); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.card:hover::after { transform: scaleX(1); }
.card .c-no { font-family: var(--mono); font-size: .7rem; color: var(--teal); letter-spacing: .14em; }
.card h3 { font-family: var(--serif); font-weight: 520; font-size: 1.3rem; margin: 10px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.card .c-arrow {
  display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: .78rem;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--teal);
  transition: color .15s;
}
.card .c-arrow:hover { color: var(--teal); }

/* ---------- content page ---------- */
.doc { max-width: 860px; margin: 0 auto; padding: 56px 28px 80px; }
.doc-head { margin-bottom: 40px; border-bottom: 2px solid var(--ink); padding-bottom: 30px; position: relative; }
.kicker {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .18em; color: var(--teal);
}
.doc-head h1 {
  font-family: var(--serif); font-weight: 420; font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.08; letter-spacing: -.015em; margin: 14px 0 16px; max-width: 22ch;
}
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.doc-meta b { color: var(--ink); font-weight: 500; }
.badge {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  color: #8a5a10; background: var(--warn-tint); border: 1px solid #DDB96A;
  padding: 3px 10px; border-radius: 999px; vertical-align: middle;
}
.badge.ok { color: #0b5b53; background: var(--ok-tint); border-color: var(--ok); }
.badge.warn { color: #8a5a10; background: var(--warn-tint); border-color: #DDB96A; }
.badge.danger { color: #8a2f1e; background: var(--danger-tint); border-color: var(--danger); }
.doc .trace { width: 240px; margin-top: 24px; opacity: .9; }

/* ---------- body typography ---------- */
.doc-body { font-size: 1.01rem; }
.doc-body h2 {
  font-family: var(--serif); font-weight: 520; font-size: 1.5rem;
  margin: 46px 0 14px; letter-spacing: -.01em;
  display: flex; align-items: baseline; gap: 12px;
}
.doc-body h2::before {
  content: "◆"; font-size: .55em; color: var(--teal); transform: translateY(-2px);
}
.doc-body h3 { font-family: var(--serif); font-weight: 520; font-size: 1.15rem; margin: 32px 0 10px; }
.doc-body p { margin: 0 0 16px; }
.doc-body ul, .doc-body ol { padding-left: 1.2em; }
.doc-body li { margin-bottom: 8px; }
.doc-body strong { font-weight: 600; }
.doc-body code { font-family: var(--mono); font-size: .86em; background: var(--chip); padding: 1px 6px; border-radius: 3px; }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }

/* data-sheet tables */
.doc-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0 26px;
  font-size: .92rem; border: 1px solid var(--ink);
}
.doc-body thead th {
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-weight: 500; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .1em;
  text-align: left; padding: 10px 12px; border-right: 1px solid var(--ink-2);
}
.doc-body tbody td {
  border: 1px solid var(--line); padding: 10px 12px; vertical-align: top;
}
.doc-body tbody tr:nth-child(even) { background: var(--paper-2); }
.doc-body tbody td:first-child { font-family: var(--mono); font-size: .84rem; }

/* blockquote as callout */
.doc-body blockquote {
  margin: 24px 0; padding: 16px 20px;
  background: var(--chip); border-left: 3px solid var(--teal);
  font-family: var(--serif); font-style: italic; font-size: 1.06rem;
}
.doc-body blockquote strong { font-style: normal; }

/* ---------- CTA cluster ---------- */
.cta-cluster {
  margin-top: 48px; padding-top: 26px; border-top: 2px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 14px;
}
.cta {
  font-family: var(--mono); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--paper); background: var(--teal); text-decoration: none;
  padding: 13px 22px; border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.cta:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); background: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 44px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.site-footer .mono { font-family: var(--mono); font-size: .74rem; }

/* ---------- staggered load ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2,.7,.3,1) forwards; }
.reveal:nth-child(1) { animation-delay: .05s; }
.reveal:nth-child(2) { animation-delay: .12s; }
.reveal:nth-child(3) { animation-delay: .19s; }
.reveal:nth-child(4) { animation-delay: .26s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card:nth-child(2n) { transform: none; }
  .index-list li { grid-template-columns: 34px 1fr; }
  .index-list .tag { display: none; }
  .hero { padding: 48px 0 40px; }
  .doc { padding: 40px 20px 64px; }
}

/* ============================================================
   v3 — UI/UX Pro Max upgrade (referencing abcam.com / rndsystems.com)
   sticky search header · breadcrumbs · trust chips · footer sitemap · a11y
   ============================================================ */

/* ---------- a11y: skip link + focus + reduced motion ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-family: var(--mono); font-size: .78rem; text-decoration: none;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
a:focus-visible, .cta:focus-visible, .card:focus-visible { outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .trace path { stroke-dasharray: none; stroke-dashoffset: 0; }
  .ticker-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sticky header + search ---------- */
.site-header { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px); background: color-mix(in srgb, var(--paper) 88%, transparent); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.site-search input {
  width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--ink);
  background: var(--white); font-family: var(--sans); font-size: .92rem; color: var(--ink);
  border-radius: 0;
}
.site-search::before {
  content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%);
  font-size: 1.1rem; color: var(--teal); font-weight: 700;
}
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 120;
  background: var(--white); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  max-height: 380px; overflow: auto; display: none;
}
.search-results.open { display: block; }
.search-results a {
  display: block; padding: 10px 14px; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: .9rem;
}
.search-results a:hover, .search-results a:focus { background: var(--paper-2); }
.search-results .sr-kind { font-family: var(--mono); font-size: .66rem; color: var(--teal); text-transform: uppercase; letter-spacing: .1em; margin-right: 8px; }
.search-empty { padding: 12px 14px; color: var(--muted); font-size: .85rem; }

/* ---------- breadcrumbs ---------- */
.breadcrumbs {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px;
}
.breadcrumbs a { color: var(--teal); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--line); }

/* ---------- trust chips ---------- */
.trust-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.chip {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 4px 10px; color: var(--ink);
  background: var(--paper-2);
}
.chip.pending { border-style: dashed; color: var(--muted); }
.chip .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; }
.chip.pending .dot { background: var(--warn); }

/* ---------- footer sitemap ---------- */
.site-footer { border-top: 2px solid var(--ink); margin-top: 48px; padding: 40px 0 44px; background: var(--paper-2); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 28px; }
.footer-grid h4 { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--teal); margin: 0 0 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { color: var(--ink); text-decoration: none; font-size: .86rem; }
.footer-grid a:hover { color: var(--teal); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }

/* ---------- nav active + products/resources pages ---------- */
.site-nav a.active { color: var(--teal); border-color: var(--teal); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 26px 0; }
.prod-card { background: var(--white); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 18px 20px; text-decoration: none; color: var(--ink); display: block; transition: transform .15s, box-shadow .15s; }
.prod-card:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.prod-card .p-kind { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--teal); }
.prod-card h3 { font-family: var(--serif); font-weight: 520; font-size: 1.15rem; margin: 8px 0 6px; }
.prod-card p { margin: 0; color: var(--muted); font-size: .85rem; }

/* v2.0 application engines */
.workflow-steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 26px; }
.workflow-steps li { counter-increment: step; position: relative; padding: 8px 0 8px 44px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.workflow-steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 8px;
  font-family: var(--mono); font-size: .78rem; color: var(--teal);
}

/* ---- docs layout（BsAb 市场报告左侧菜单栏，DeepSeek docs 风格）---- */
.docs-wrap { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 0; max-width: 1260px; margin: 0 auto; }
.docs-side { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); padding: 30px 20px 44px; }
.docs-side h4 { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; color: var(--teal); margin: 0 0 8px; }
.docs-side ul { list-style: none; margin: 0 0 22px; padding: 0; }
.docs-side li { margin: 1px 0; }
.docs-side a { display: block; padding: 5px 10px; color: var(--ink); text-decoration: none; font-size: .84rem; line-height: 1.4; border-left: 2px solid transparent; }
.docs-side a:hover { color: var(--teal); }
.docs-side a.active { color: var(--teal); border-left-color: var(--teal); background: var(--paper-2); }
.docs-side .side-ver { font-family: var(--mono); font-size: .68rem; color: var(--muted); margin: 0 10px 16px; }
.docs-main { padding: 30px 36px 70px; min-width: 0; }
.docs-main .doc-head { margin-bottom: 10px; }
.docs-main .doc-body table { width: 100%; }
@media (max-width: 960px) {
  .docs-wrap { grid-template-columns: 1fr; }
  .docs-side { position: static; max-height: none; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 18px; }
  .docs-side ul { display: flex; flex-wrap: wrap; gap: 3px 6px; margin-bottom: 10px; }
  .docs-side li { margin: 0; }
  .docs-side a { padding: 3px 9px; border-left: 0; border-bottom: 2px solid transparent; font-size: .8rem; }
  .docs-side a.active { border-bottom-color: var(--teal); background: transparent; }
  .docs-main { padding: 22px 18px 60px; }
}

/* ---- docs 布局增强（report 页 UI/UX 优化）---- */
/* 正文行长控制（§5 line-length 60-75ch）与表格宽度 */
.docs-main .doc-body p, .docs-main .doc-body li, .docs-main .doc-body blockquote { max-width: 74ch; }
.docs-main .doc-body h2 { margin-top: 38px; font-family: var(--serif); font-weight: 560; }
.docs-main .doc-body h3 { margin-top: 26px; }
.docs-main .doc-body table { width: 100%; font-variant-numeric: tabular-nums; }
.docs-main .doc-body th, .docs-main .doc-body td { font-size: .84rem; }
/* 数字表格使用等宽数字，防止列宽跳动（§6 number-tabular） */
.docs-main .doc-meta b, .docs-side .side-ver { font-variant-numeric: tabular-nums; }
/* 侧栏 active 指示符（非仅颜色，§1 color-not-only） */
.docs-side a.active::before { content: "◆ "; color: var(--teal); font-size: .6rem; vertical-align: 1px; }
.docs-side .side-ver { display: inline-block; background: var(--paper-2); border: 1px solid var(--line); padding: 3px 8px; border-radius: 3px; margin: 0 10px 16px; }
/* 落地页统计条（§10 data emphasis） */
.docs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin: 26px 0 8px; }
.docs-stats .stat { border: 1px solid var(--line); background: var(--paper-2); padding: 14px 16px; }
.docs-stats .stat b { display: block; font-family: var(--serif); font-size: 1.6rem; font-weight: 560; color: var(--ink); line-height: 1.1; }
.docs-stats .stat span { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* 章节前后翻页（§9 predictable back / docs pattern） */
.docs-pager { display: flex; gap: 12px; margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--line); }
.docs-pager a { flex: 1; display: block; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; font-size: .86rem; transition: border-color .15s ease, color .15s ease; }
.docs-pager a:hover { border-color: var(--teal); color: var(--teal); }
.docs-pager .pn { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.docs-pager .next { text-align: right; }
.docs-pager .pn-empty { flex: 1; }
/* 触达目标与焦点（§1/§2） */
.docs-side a { min-height: 30px; }
@media (max-width: 960px) {
  .docs-side a { min-height: 32px; }
  .docs-pager { flex-direction: column; }
  .docs-side ul { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
  .docs-side li { flex: 0 0 auto; margin: 0; }
  .docs-side a { white-space: nowrap; }
  .docs-side ul:last-of-type { display: none; }
}

/* ---- 报告页溢出防护（章节页 4px 溢出 + 表格内部滚动）---- */
.docs-main { overflow-x: clip; }
.docs-main .doc-body table { display: block; max-width: 100%; overflow-x: auto; }
.docs-main .doc-body pre, .docs-main .doc-body code { max-width: 100%; }

/* ============================================================
   UI v2（PRD v4.1）— tokens v2 + 共享组件层
   参考 rndsystems.com 组件结构；品牌 token（色板/字体）不变
   ============================================================ */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --container: 1160px;
  --shadow-soft: 0 1px 2px rgba(18,32,31,.05), 0 4px 14px rgba(18,32,31,.08);
}
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 2px; }
.svg-sprite { display: none; }

/* ZH 排版修正：CJK 全角字符宽于 ch 基准，放宽标题换行宽度（US-6 字体度量专项） */
html[lang="zh"] .hero h1 { max-width: 12em; }
html[lang="zh"] .doc-head h1 { max-width: 16em; }

/* sticky 全站导航（US-5） */
.site-header { position: sticky; top: 0; z-index: 60; }
@supports (backdrop-filter: blur(6px)) {
  .site-header { background: rgba(246, 243, 236, .92); backdrop-filter: blur(6px); }
}

/* ---------- icon 品类网格（US-2，R&D "Explore Our Portfolio" 结构） ---------- */
.icon-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-4);
  margin: var(--space-6) 0 var(--space-2);
}
.icon-tile {
  display: block; background: var(--white); border: 1px solid var(--ink);
  padding: 18px 14px 16px; text-decoration: none; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.icon-tile:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.icon-tile .tile-icon { width: 30px; height: 30px; color: var(--teal); display: block; }
.icon-tile b { display: block; font-family: var(--serif); font-weight: 560; font-size: 1.02rem; margin: 10px 0 4px; line-height: 1.2; }
.icon-tile span { display: block; color: var(--muted); font-size: .8rem; line-height: 1.45; }
@media (max-width: 1080px) { .icon-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .icon-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .icon-tile { padding: 14px 12px 12px; } }

/* ---------- What's New teaser 卡（US-3，index/审校数据驱动） ---------- */
.teaser-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5);
  margin: var(--space-6) 0 var(--space-2);
}
.teaser {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--white); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  padding: 20px 20px 18px; text-decoration: none; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.teaser:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.teaser .t-kicker {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); display: flex; justify-content: space-between; gap: 8px;
}
.teaser .t-kicker time { color: var(--muted); font-variant-numeric: tabular-nums; }
.teaser h3 { font-family: var(--serif); font-weight: 540; font-size: 1.16rem; line-height: 1.28; margin: 0; }
.teaser p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.teaser .t-arrow { margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: .74rem; color: var(--teal); letter-spacing: .08em; }
@media (max-width: 900px) { .teaser-grid { grid-template-columns: 1fr; gap: var(--space-4); } }

/* ---------- stat strip（数据证据语言，全幅深色带） ---------- */
.stat-strip { background: var(--ink); color: var(--paper); padding: var(--space-6) 0; border-bottom: 1px solid var(--ink); }
.stat-strip .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.stat-strip .stat b {
  display: block; font-family: var(--serif); font-weight: 560; font-size: 2rem;
  line-height: 1.05; font-variant-numeric: tabular-nums;
}
.stat-strip .stat span {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .14em;
  text-transform: uppercase; color: #9FB3AF;
}
@media (max-width: 760px) { .stat-strip .stat-row { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); } }

/* ---------- 页脚 Stay Connected（US-5，R&D 四栏页脚结构） ---------- */
.footer-connect {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--space-3) var(--space-6); border: 1px solid var(--line); background: var(--paper);
  padding: 18px 22px; margin-bottom: var(--space-6);
}
.footer-connect .fc-title { font-family: var(--serif); font-weight: 560; font-size: 1.08rem; margin: 0; }
.footer-connect .fc-title small { display: block; font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.footer-connect .connect-links { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-connect .connect-links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; border: 1px solid var(--ink);
  padding: 7px 13px; background: var(--white); transition: background .15s, color .15s;
}
.footer-connect .connect-links a:hover { background: var(--teal); border-color: var(--teal); color: var(--white); }
.footer-connect .connect-links svg { width: 14px; height: 14px; }

/* ---------- 首页分区节奏（UI v2） ---------- */
.home-section { margin-top: var(--space-8); }
.home-section .sec-head { margin: 0 0 var(--space-5); }

/* ---------- 内页双栏 + TOC（US-4，R&D/abcam 文档式阅读） ---------- */
.doc.has-toc { max-width: 1160px; }
.doc-grid { display: block; }
@media (min-width: 1080px) {
  .doc.has-toc .doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 44px; align-items: start; }
  .doc-toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
}
.doc-toc { border-left: 1px solid var(--line); padding: 4px 0 4px 18px; font-size: .84rem; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 2px 0; }
.doc-toc a {
  display: block; padding: 4px 8px; color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent; margin-left: -19px; line-height: 1.4;
  transition: color .15s, border-color .15s;
}
.doc-toc a:hover { color: var(--teal); border-left-color: var(--teal); }
.toc-title {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 10px;
}
@media (max-width: 1079px) { .doc-toc { display: none; } }

/* ---------- CTA 收口带（US-4 Next steps） ---------- */
.cta-final {
  border: 1px solid var(--ink); background: var(--paper-2); box-shadow: var(--shadow-hard);
  padding: 20px 24px 22px; margin: 52px 0 0;
}
.cta-final .cta-cluster { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- 相关内容（US-4 Related） ---------- */
.related { margin-top: 40px; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.rel-card {
  display: flex; flex-direction: column; gap: 8px; background: var(--white);
  border: 1px solid var(--line); padding: 16px 16px 14px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.rel-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.rel-card .tag { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.rel-card b { font-family: var(--serif); font-weight: 540; font-size: .98rem; line-height: 1.3; }
@media (max-width: 900px) { .rel-grid { grid-template-columns: 1fr; } }

/* ---------- Opportunity Score 卡（US-pair，GP 评分可视化） ---------- */
.score-card {
  display: flex; align-items: center; gap: 20px; background: var(--white);
  border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  padding: 18px 22px; margin: 14px 0 6px; max-width: 460px;
}
.score-card .score-num {
  font-family: var(--serif); font-weight: 600; font-size: 3rem; line-height: 1;
  color: var(--teal); font-variant-numeric: tabular-nums; min-width: 74px; text-align: center;
}
.score-card .score-info b { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.score-card .score-info p { margin: 6px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }
.score-card .badge { vertical-align: middle; margin-left: 8px; }

/* pair 页列表文本列（li-text 占 1fr 主列） */
.index-list .li-text { min-width: 0; overflow-wrap: break-word; }

/* ---- UI v2 S5：内页移动端溢出修复（对齐报告页表格方案 + 长词换行）---- */
.doc-body { overflow-wrap: break-word; }
@media (max-width: 1160px) {
  .doc .doc-body table { display: block; max-width: 100%; overflow-x: auto; }
}

/* ---- UI v2 S5：Lighthouse a11y/perf 修复 ---- */
/* 页脚小标题：h3（修 heading-order）+ ink-2（paper-2 底对比度 11.4:1，teal 4.3:1 不足） */
.footer-grid h3 { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-2); margin: 0 0 10px; }
.cta-final .toc-title { color: var(--ink-2); }
/* 正文页 trace 装饰不参与 LCP 动画（静态呈现，阅读页无入场干扰） */
.doc .trace path { animation: none; stroke-dashoffset: 0; }
