/* ==========================================================================
   CertAgent 文档中心
   依赖 main.css 中的设计令牌与站点 Header / Footer 样式
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.docs-page .grad {
  background: linear-gradient(100deg, var(--brand) 8%, #17a2ff 52%, var(--mint-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   Header search trigger
   -------------------------------------------------------------------------- */

.doc-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.doc-search-trigger:hover {
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-color: #cfdcff;
}

.doc-search-trigger svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.doc-search-trigger kbd {
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(16, 30, 54, 0.04);
}

.mobile-nav__search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 4px;
  color: var(--text);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 17px;
  font-weight: 600;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Docs home — hero
   -------------------------------------------------------------------------- */

.docs-hero {
  position: relative;
  overflow: hidden;
  padding: 74px 0 66px;
  background:
    radial-gradient(620px 320px at 12% 0%, rgba(47, 107, 255, 0.1), transparent 70%),
    radial-gradient(520px 300px at 88% 6%, rgba(11, 211, 165, 0.09), transparent 70%),
    linear-gradient(180deg, #f7f9ff 0%, #fff 100%);
  border-bottom: 1px solid var(--line-soft);
}

.docs-hero__glow {
  position: absolute;
  top: -180px;
  right: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.13), transparent 68%);
  pointer-events: none;
}

.docs-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 60px;
  align-items: center;
}

.docs-hero__copy h1 {
  font-size: clamp(38px, 4.5vw, 56px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.docs-hero__copy,
.docs-hero__panel {
  min-width: 0;
}

.docs-hero__desc {
  max-width: 580px;
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
}

.docs-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  height: 56px;
  margin-top: 28px;
  padding: 0 16px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.docs-search-box:hover {
  border-color: #c9d8ff;
  box-shadow: 0 12px 30px -18px rgba(47, 107, 255, 0.45);
}

.docs-search-box svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--brand);
}

.docs-search-box span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-search-box kbd {
  flex: none;
  padding: 3px 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.docs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
}

.docs-hero__meta b {
  color: var(--brand-deep);
}

.docs-hero__panel {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.docs-hero__panel-title {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.docs-hero__row {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 13px 14px;
  border-radius: 12px;
  transition: background 0.2s, transform 0.2s;
}

.docs-hero__row:hover {
  background: var(--bg);
  transform: translateX(2px);
}

.docs-hero__row-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 11px;
}

.docs-hero__row-icon svg {
  width: 20px;
  height: 20px;
}

.docs-hero__row-body {
  flex: 1;
  min-width: 0;
}

.docs-hero__row-body b {
  display: block;
  font-size: 14.5px;
  color: var(--text);
}

.docs-hero__row-body small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted-2);
}

.docs-hero__row-arrow {
  flex: none;
  color: var(--muted-2);
  font-size: 15px;
}

.docs-hero__panel-note {
  padding: 12px 14px;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Docs home — sections & cards
   -------------------------------------------------------------------------- */

.docs-section {
  padding: 88px 0;
}

.docs-section--bg {
  background: var(--bg);
}

.docs-section--tight {
  padding: 72px 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}

.doc-card:hover {
  transform: translateY(-4px);
  border-color: #cfdcf5;
  box-shadow: var(--shadow);
}

.doc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 13px;
}

.doc-card__icon svg {
  width: 23px;
  height: 23px;
}

.doc-card--mint .doc-card__icon {
  color: var(--mint-deep);
  background: var(--mint-soft);
}

.doc-card--amber .doc-card__icon {
  color: #a66a00;
  background: var(--amber-soft);
}

.doc-card--violet .doc-card__icon {
  color: #5b43d6;
  background: #f0edff;
}

.doc-card__num {
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.doc-card h3 {
  margin-top: 20px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.doc-card > p {
  margin-top: 9px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
}

.doc-card__points {
  display: grid;
  gap: 9px;
  margin: 20px 0 24px;
}

.doc-card__points li {
  position: relative;
  padding-left: 21px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #4d5d78;
}

.doc-card__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 6px;
  height: 10px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(42deg);
}

.doc-card--mint .doc-card__points li::before {
  border-color: var(--mint-deep);
}

.doc-card--amber .doc-card__points li::before {
  border-color: #c88409;
}

.doc-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted-2);
}

.doc-card__foot a {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
}

.doc-card__foot a span {
  display: inline-block;
  transition: transform 0.2s;
}

.doc-card:hover .doc-card__foot a span {
  transform: translateX(3px);
}

/* Role cards */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.role-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.role-card:hover {
  transform: translateY(-3px);
  border-color: #cfdcf5;
  box-shadow: var(--shadow-sm);
}

.role-card__tag {
  align-self: flex-start;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 999px;
}

.role-card--mint .role-card__tag {
  color: #056751;
  background: var(--mint-soft);
}

.role-card--amber .role-card__tag {
  color: #966100;
  background: var(--amber-soft);
}

.role-card--violet .role-card__tag {
  color: #5b43d6;
  background: #f0edff;
}

.role-card b {
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text);
}

.role-card p {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.role-card__link {
  margin-top: 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-deep);
}

/* Popular chapters */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.popular-item {
  position: relative;
  padding: 20px 52px 20px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.popular-item:hover {
  transform: translateY(-2px);
  border-color: #cfdcf5;
  box-shadow: var(--shadow-sm);
}

.popular-item__doc {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.popular-item b {
  display: block;
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--text);
}

.popular-item p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.popular-item__arrow {
  position: absolute;
  top: 50%;
  right: 20px;
  color: var(--brand);
  transform: translateY(-50%);
  transition: transform 0.2s;
}

.popular-item:hover .popular-item__arrow {
  transform: translate(3px, -50%);
}

/* Reading guide */
.reading-guide {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 56px;
  align-items: start;
  padding: 48px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.reading-steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
}

.reading-steps li {
  position: relative;
  padding: 16px 18px 16px 58px;
  background: var(--bg);
  border-radius: 12px;
  counter-increment: step;
}

.reading-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 16px;
  top: 15px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.reading-steps b {
  font-size: 14.5px;
  color: var(--text);
}

.reading-steps p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Document page — hero
   -------------------------------------------------------------------------- */

.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 90;
  height: 3px;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #17a2ff 55%, var(--mint));
  transition: width 0.12s linear;
}

.doc-hero {
  padding: 34px 0 38px;
  background:
    radial-gradient(520px 260px at 8% 0%, rgba(47, 107, 255, 0.08), transparent 70%),
    linear-gradient(180deg, #f7f9ff 0%, #fff 100%);
  border-bottom: 1px solid var(--line-soft);
}

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted-2);
}

.doc-breadcrumb a:hover {
  color: var(--brand-deep);
}

.doc-breadcrumb span[aria-current] {
  color: var(--text);
  font-weight: 600;
}

.doc-hero__main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  margin-top: 26px;
}

.doc-hero__copy {
  min-width: 0;
}

.doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-kicker__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.13);
}

.doc-kicker__dot--mint {
  background: var(--mint-deep);
  box-shadow: 0 0 0 4px rgba(11, 211, 165, 0.15);
}

.doc-kicker__dot--amber {
  background: #d58a09;
  box-shadow: 0 0 0 4px rgba(247, 164, 29, 0.16);
}

.doc-hero h1 {
  margin-top: 12px;
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.028em;
  font-weight: 800;
}

.doc-lead {
  max-width: 760px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.doc-chip {
  padding: 5px 11px;
  font-size: 11.5px;
  color: #45556f;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.doc-hero__actions {
  display: flex;
  flex: none;
  gap: 10px;
  padding-bottom: 4px;
}

/* --------------------------------------------------------------------------
   Document page — three column layout
   -------------------------------------------------------------------------- */

.docs-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 236px;
  gap: 38px;
  align-items: start;
  padding-top: 42px;
  padding-bottom: 48px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #d5ddeb transparent;
}

.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: #d5ddeb;
  border-radius: 6px;
}

.docs-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-sidebar__title {
  margin: 22px 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.docs-sidebar__head .docs-sidebar__title {
  margin-top: 0;
}

.docs-sidebar__close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.docs-sidebar__close svg {
  width: 17px;
  height: 17px;
}

.docs-switch {
  display: grid;
  gap: 4px;
}

.docs-switch__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.18s, border-color 0.18s;
}

.docs-switch__item:hover {
  background: var(--bg);
}

.docs-switch__item.is-current {
  background: var(--brand-soft);
  border-color: #dbe5ff;
}

.docs-switch__mini {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.docs-switch__mini svg {
  width: 16px;
  height: 16px;
}

.docs-switch__item b {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text);
}

.docs-switch__item small {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.doc-toc {
  padding-bottom: 12px;
}

.doc-toc .toc-list,
.doc-toc .toc-sub {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-item--h2 > a {
  display: block;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #3d4b63;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}

.toc-item--h2 > a:hover {
  color: var(--brand-deep);
  background: var(--bg);
}

.toc-item--h2 > a.is-active {
  color: var(--brand-deep);
  background: linear-gradient(90deg, var(--brand-soft), transparent);
  border-left-color: var(--brand);
}

.toc-sub {
  margin-left: 9px !important;
  padding-left: 7px !important;
  border-left: 1px solid var(--line);
}

.toc-sub a {
  display: block;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  border-radius: 6px;
}

.toc-sub a:hover {
  color: var(--brand-deep);
  background: var(--bg);
}

.toc-sub a.is-active {
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Document body
   -------------------------------------------------------------------------- */

.doc-body {
  min-width: 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: #1a2740;
}

.doc-body > :first-child {
  margin-top: 0;
}

.doc-body h2 {
  position: relative;
  margin: 68px 0 20px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-size: clamp(23px, 2.3vw, 29px);
  line-height: 1.32;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #0d1730;
  scroll-margin-top: calc(var(--header-h) + 26px);
}

.doc-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc-notice + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.doc-body h3 {
  margin: 40px 0 14px;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #12203a;
  scroll-margin-top: calc(var(--header-h) + 26px);
}

.doc-body h4 {
  margin: 28px 0 10px;
  font-size: 16.5px;
  color: #16253f;
}

.doc-body p {
  margin: 14px 0;
}

.doc-body strong {
  color: #0a1428;
  font-weight: 650;
}

.doc-body em {
  color: #34445f;
}

.doc-body ul,
.doc-body ol {
  margin: 14px 0 18px;
  padding-left: 22px;
}

.doc-body ul {
  list-style: disc;
}

.doc-body ol {
  list-style: decimal;
}

.doc-body li {
  margin: 7px 0;
  padding-left: 2px;
}

.doc-body li::marker {
  color: var(--brand);
}

.doc-body li > ul,
.doc-body li > ol {
  margin: 7px 0;
}

.doc-body a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.doc-body a:hover {
  color: var(--brand);
}

.doc-body code {
  padding: 0.14em 0.4em;
  font-family: var(--mono);
  font-size: 0.87em;
  color: #173c7a;
  background: #f1f5fb;
  border: 1px solid #e3eaf5;
  border-radius: 5px;
  word-break: break-word;
}

.doc-body hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Safety notice at the top of the install manual */
.doc-notice {
  display: flex;
  gap: 13px;
  margin: 0 0 30px;
  padding: 16px 18px;
  color: #654c0d;
  background: #fff8e9;
  border: 1px solid #f3dda8;
  border-left: 3px solid #e6a11a;
  border-radius: 0 12px 12px 0;
}

.doc-notice svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
  color: #b97c05;
}

.doc-notice b {
  display: block;
  font-size: 14px;
  color: #5c4408;
}

.doc-notice p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #6f571a;
}

/* Tables */
.table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.doc-body table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.65;
}

.doc-body th {
  padding: 10px 14px;
  color: #26344d;
  background: #f6f8fd;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.doc-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.doc-body tbody tr:last-child td {
  border-bottom: 0;
}

.doc-body tbody tr:nth-child(even) td {
  background: #fcfdff;
}

/* Callouts */
.doc-body blockquote {
  margin: 22px 0;
  padding: 15px 18px;
  color: #3a4963;
  background: #f6f9ff;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
}

.doc-body blockquote p {
  margin: 0;
}

.doc-body blockquote p + p,
.doc-body blockquote ul,
.doc-body blockquote ol {
  margin-top: 8px;
}

.doc-body blockquote code {
  background: #eaf0fc;
  border-color: #d8e3f8;
}

.doc-body .doc-callout--warn {
  color: #654c0d;
  background: #fff8e9;
  border-left-color: #e6a11a;
}

.doc-body .doc-callout--warn code {
  color: #6b4a00;
  background: #fff1cf;
  border-color: #f3dda8;
}

/* Code blocks (wrapped by docs.js) */
.code-block {
  margin: 22px 0;
  overflow: hidden;
  background: #0b1426;
  border: 1px solid #1d2c47;
  border-radius: 12px;
  box-shadow: 0 16px 36px -26px rgba(5, 10, 20, 0.9);
}

.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px 7px 15px;
  background: #0f1a2f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block__lang {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8ca1c6;
}

.code-block__copy {
  padding: 4px 10px;
  font-size: 11.5px;
  color: #b9c9e6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.code-block__copy:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.code-block__copy.is-done {
  color: #7ef0cf;
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #2b3d5e transparent;
}

.code-block pre::-webkit-scrollbar {
  height: 8px;
}

.code-block pre::-webkit-scrollbar-thumb {
  background: #2b3d5e;
  border-radius: 8px;
}

.doc-body pre code {
  padding: 0;
  color: #d7e2f7;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre;
  word-break: normal;
  tab-size: 2;
}

/* --------------------------------------------------------------------------
   Right rail
   -------------------------------------------------------------------------- */

.docs-rail {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: grid;
  gap: 14px;
}

.rail-card {
  padding: 17px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.rail-card__title {
  margin-bottom: 11px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.doc-facts {
  display: grid;
  gap: 9px;
  margin: 0;
}

.doc-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
}

.doc-facts dt {
  flex: none;
  color: var(--muted);
}

.doc-facts dd {
  margin: 0;
  color: #26344d;
  font-weight: 600;
  text-align: right;
}

.rail-actions {
  display: grid;
  gap: 7px;
}

.rail-actions button,
.rail-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  font-size: 12px;
  color: #42526c;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.rail-actions button:hover,
.rail-actions a:hover {
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-color: #dbe5ff;
}

.rail-actions svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted-2);
}

.rail-actions button:hover svg {
  color: var(--brand);
}

.rail-related {
  display: grid;
  gap: 4px;
}

.rail-related a {
  display: block;
  padding: 7px 8px;
  border-radius: 7px;
  transition: background 0.18s;
}

.rail-related a:hover {
  background: var(--bg);
}

.rail-related b {
  display: block;
  font-size: 12px;
  color: var(--text);
}

.rail-related small {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.rail-card--help {
  background: linear-gradient(180deg, #f7f9ff, #fff);
  border-color: #dbe5ff;
}

.rail-card--help > p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

.rail-card--help a {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-deep);
}

/* Pager */
.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-bottom: 82px;
}

.doc-pager__link {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.doc-pager__link:hover {
  transform: translateY(-2px);
  border-color: #cfdcf5;
  box-shadow: var(--shadow-sm);
}

.doc-pager__link--next {
  text-align: right;
}

.doc-pager__link span {
  font-size: 11px;
  color: var(--muted-2);
}

.doc-pager__link b {
  display: block;
  margin-top: 3px;
  font-size: 14.5px;
  color: var(--text);
}

/* Mobile drawer */
.docs-drawer-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 70;
  width: fit-content;
  margin-bottom: 18px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.docs-drawer-toggle svg {
  width: 17px;
  height: 17px;
}

.docs-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 10, 20, 0.48);
  backdrop-filter: blur(2px);
}

.docs-drawer-backdrop.is-open {
  display: block;
}

/* --------------------------------------------------------------------------
   Search modal
   -------------------------------------------------------------------------- */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}

.search-modal.is-open {
  display: block;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.55);
  backdrop-filter: blur(4px);
}

.search-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 32px));
  max-height: min(74vh, 680px);
  margin: min(10vh, 100px) auto 0;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.search-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.search-modal__head > svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--brand);
}

.search-modal__head input {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-modal__head input::placeholder {
  color: #8a97ad;
}

.search-modal__head input::-webkit-search-cancel-button,
.search-modal__head input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.search-modal__close svg {
  width: 16px;
  height: 16px;
}

.search-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 10px;
}

.search-modal__suggest {
  padding: 12px 20px 14px;
}

.search-modal__suggest > p {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.search-modal__suggest > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.search-modal__suggest button {
  padding: 5px 11px;
  font-size: 12px;
  color: #45556f;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.search-modal__suggest button:hover {
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-color: #dbe5ff;
}

.search-modal__count {
  padding: 0 20px 6px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.search-result {
  display: block;
  padding: 13px 20px;
  border-left: 3px solid transparent;
  transition: background 0.16s, border-color 0.16s;
}

.search-result:hover,
.search-result.is-active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
}

.search-result__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  color: var(--muted-2);
}

.search-result__badge {
  padding: 2px 7px;
  font-weight: 700;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid #dbe5ff;
  border-radius: 999px;
}

.search-result__title {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 650;
  color: #16223a;
}

.search-result__snippet {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.search-result mark {
  padding: 0 1px;
  color: inherit;
  background: #fff0b8;
  border-radius: 2px;
}

.search-empty {
  padding: 34px 20px 42px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.search-empty b {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
}

.search-modal__foot {
  display: flex;
  gap: 18px;
  padding: 10px 20px;
  font-size: 10.5px;
  color: var(--muted-2);
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}

.search-modal__foot kbd {
  display: inline-block;
  min-width: 17px;
  margin-right: 2px;
  padding: 1px 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  text-align: center;
  color: #5b6982;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.docs-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 320;
  padding: 10px 18px;
  font-size: 13px;
  color: #fff;
  background: rgba(8, 16, 32, 0.92);
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}

.docs-toast.is-open {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .docs-layout {
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 36px;
  }

  .docs-rail {
    display: none;
  }

  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .docs-hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .docs-hero__panel {
    max-width: 620px;
  }

  .docs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .doc-card {
    padding: 24px;
  }

  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-guide {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 32px;
  }
}

@media (max-width: 920px) {
  .doc-search-trigger {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .doc-search-trigger span,
  .doc-search-trigger kbd {
    display: none;
  }

  .docs-layout {
    display: block;
    padding-top: 20px;
  }

  .docs-drawer-toggle {
    display: inline-flex;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 160;
    width: min(86vw, 344px);
    max-height: none;
    padding: 20px 18px 36px;
    background: #fff;
    box-shadow: 24px 0 60px -30px rgba(5, 10, 20, 0.5);
    transform: translateX(-103%);
    transition: transform 0.3s var(--ease);
  }

  .docs-sidebar.is-open {
    transform: none;
  }

  .docs-sidebar__close {
    display: inline-flex;
  }

  .docs-sidebar__head .docs-sidebar__title {
    margin: 0;
  }

  .docs-sidebar > .docs-sidebar__title {
    margin-top: 20px;
  }

  .doc-hero {
    padding: 24px 0 30px;
  }

  .doc-hero__main {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    margin-top: 20px;
  }

  .doc-hero__actions {
    flex-wrap: wrap;
  }

  .docs-hero {
    padding: 52px 0 46px;
  }

  .docs-section {
    padding: 64px 0;
  }

  .popular-grid {
    grid-template-columns: 1fr;
  }

  .doc-pager {
    grid-template-columns: 1fr;
    padding-bottom: 56px;
  }

  .doc-body {
    font-size: 15px;
  }

  .doc-body h2,
  .doc-body h3 {
    scroll-margin-top: calc(var(--header-h) + 64px);
  }

  .doc-body h2 {
    margin-top: 54px;
  }

  .search-modal__panel {
    margin-top: 12px;
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 620px) {
  .role-grid {
    grid-template-columns: 1fr;
  }

  .docs-hero__row-body small {
    white-space: normal;
  }

  .docs-hero__copy h1 {
    font-size: clamp(32px, 9vw, 42px);
  }

  .docs-search-box {
    height: 52px;
    font-size: 13.5px;
  }

  .docs-search-box kbd {
    display: none;
  }

  .docs-hero__meta {
    gap: 8px 16px;
  }

  .reading-guide {
    padding: 24px;
  }

  .doc-chip {
    font-size: 11px;
  }

  .doc-hero__actions .btn {
    flex: 1;
    min-width: 150px;
  }

  .doc-body h2 {
    font-size: 23px;
  }

  .doc-body h3 {
    font-size: 18.5px;
  }

  .search-modal__panel {
    width: calc(100vw - 16px);
    margin-top: 8px;
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .search-modal__foot {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .header,
  .footer,
  .mobile-nav,
  .docs-sidebar,
  .docs-rail,
  .docs-drawer-toggle,
  .docs-drawer-backdrop,
  .reading-progress,
  .doc-hero__actions,
  .doc-hero .btn,
  .doc-pager,
  .search-modal,
  .docs-toast {
    display: none !important;
  }

  .docs-layout {
    display: block;
    padding: 0;
  }

  .doc-hero {
    padding: 0 0 22px;
    background: none;
    border-bottom: 1px solid #ddd;
  }

  .doc-hero h1 {
    font-size: 26pt;
  }

  .doc-body {
    font-size: 10.5pt;
    line-height: 1.65;
  }

  .doc-body h2 {
    page-break-after: avoid;
    border-top: 0;
    padding-top: 0;
  }

  .doc-body h3 {
    page-break-after: avoid;
  }

  .code-block,
  .table-wrap,
  .doc-body blockquote {
    page-break-inside: avoid;
  }

  .code-block {
    border-color: #ccc;
    box-shadow: none;
  }

  .doc-body a {
    color: inherit;
    text-decoration: none;
  }
}
