/* 接口文档 Tab 专用样式（作用域隔离，不改全局 api-intel-* 基础定义） */
.api-intel-docs-shell {
  --docs-gap: 0.75rem;
  --docs-radius: 14px;
  --docs-section-bg: rgba(255, 255, 255, 0.42);
  --docs-section-line: rgba(14, 116, 144, 0.1);
  --docs-scroll-thumb: rgba(14, 116, 144, 0.28);
  --docs-title-size: 0.95rem;
  --docs-label-size: 0.78rem;
  --docs-control-h: 2.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.api-intel-docs-shell .docs-split.api-intel-split {
  gap: var(--docs-gap);
  align-items: start;
}

.api-intel-docs-shell .api-intel-card.docs-step {
  margin: 0;
  padding: 0.95rem 1.05rem 1.05rem;
  border-radius: var(--docs-radius);
  background: var(--aiintel-surface-glass, rgba(255, 255, 255, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 14px 32px -26px rgba(15, 28, 46, 0.28);
}

.api-intel-docs-shell .docs-step__head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.api-intel-docs-shell .docs-step__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(14, 116, 144, 0.78);
}

.api-intel-docs-shell .docs-step__eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0891b2, #0f766e);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.16);
}

.api-intel-docs-shell .docs-step__head h3 {
  margin: 0;
  font-size: var(--docs-title-size);
  font-weight: 780;
  letter-spacing: -0.01em;
  color: var(--aiintel-ink, #0f172a);
}

.api-intel-docs-shell .docs-step__head > .api-intel-muted {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.api-intel-docs-shell .docs-section {
  margin-top: 0.7rem;
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 12px;
  background: var(--docs-section-bg);
  border: 1px solid var(--docs-section-line);
}

.api-intel-docs-shell .docs-section:first-of-type {
  margin-top: 0;
}

.api-intel-docs-shell .docs-section__title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aiintel-muted, #64748b);
}

.api-intel-docs-shell .docs-section .api-intel-grid-2 {
  margin-top: 0;
}

.api-intel-docs-shell .docs-field--span-2 {
  grid-column: 1 / -1;
}

.api-intel-docs-shell .api-intel-field {
  font-size: var(--docs-label-size);
}

.api-intel-docs-shell .api-intel-field input,
.api-intel-docs-shell .api-intel-field select,
.api-intel-docs-shell textarea#api-intel-spec-content {
  min-height: var(--docs-control-h);
  border-radius: 10px;
  border: 1px solid rgba(14, 116, 144, 0.14);
  background: rgba(255, 255, 255, 0.62);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.api-intel-docs-shell .api-intel-field input:focus,
.api-intel-docs-shell .api-intel-field select:focus,
.api-intel-docs-shell textarea#api-intel-spec-content:focus {
  outline: none;
  border-color: rgba(14, 116, 144, 0.5);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.14);
}

.api-intel-docs-shell textarea#api-intel-spec-content {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  resize: vertical;
  max-height: 9.5rem;
  overflow: auto;
  font-family: var(--aiintel-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--aiintel-ink, #0f172a);
}

.api-intel-docs-shell .docs-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.api-intel-docs-shell .docs-cta-row .api-intel-btn--primary {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 8px 18px -10px rgba(14, 116, 144, 0.7);
}

.api-intel-docs-shell .docs-scroll {
  margin-top: 0.55rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--docs-scroll-thumb) transparent;
}

.api-intel-docs-shell .docs-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.api-intel-docs-shell .docs-scroll::-webkit-scrollbar-thumb {
  background: var(--docs-scroll-thumb);
  border-radius: 999px;
}

.api-intel-docs-shell #api-intel-l5-sync-jobs.docs-scroll {
  max-height: 6rem;
}

.api-intel-docs-shell #api-intel-spec-list.docs-scroll {
  max-height: min(280px, 32vh);
}

.api-intel-docs-shell #api-intel-changes-watch.docs-scroll:empty {
  display: none;
}

.api-intel-docs-shell #api-intel-changes-watch.docs-scroll {
  max-height: 12rem;
  margin-top: 0.55rem;
}

.api-intel-docs-shell #api-intel-changes-list.docs-scroll {
  max-height: min(420px, 48vh);
  margin-top: 0.55rem;
}

.api-intel-docs-shell #api-intel-l5-map-box.docs-scroll {
  max-height: min(320px, 40vh);
  margin-top: 0.55rem;
  padding-right: 0.15rem;
}

.api-intel-docs-shell .api-intel-docs-shell__map .api-intel-row,
.api-intel-docs-shell #api-intel-spec-list .api-intel-row,
.api-intel-docs-shell #api-intel-changes-list .api-intel-row,
.api-intel-docs-shell #api-intel-changes-watch .api-intel-row {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(14, 116, 144, 0.12);
}

.api-intel-docs-shell .api-intel-fold {
  margin-top: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--docs-section-line);
  background: rgba(255, 255, 255, 0.34);
  padding: 0.15rem 0.7rem 0.55rem;
}

.api-intel-docs-shell .api-intel-fold > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--aiintel-ink-soft, #334155);
  padding: 0.55rem 0.15rem;
  list-style: none;
}

.api-intel-docs-shell .api-intel-fold > summary::-webkit-details-marker {
  display: none;
}

.api-intel-docs-shell .api-intel-fold > summary::before {
  content: "›";
  display: inline-block;
  width: 1rem;
  color: rgba(14, 116, 144, 0.85);
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.api-intel-docs-shell .api-intel-fold[open] > summary::before {
  transform: rotate(90deg);
}

.api-intel-docs-shell .api-intel-toolbar {
  margin-bottom: 0.35rem;
}

.api-intel-docs-shell #api-intel-changes-meta:empty {
  display: none;
}

.api-intel-docs-shell #api-intel-changes-meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-intel-docs-shell #api-intel-changes-summary:empty {
  display: none;
}

.api-intel-docs-shell .docs-step--map .docs-section--manual {
  margin-top: 0.75rem;
}

@media (min-width: 1101px) {
  .api-intel-docs-shell .docs-split.api-intel-split {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.2fr);
    gap: 0.85rem;
  }

  .api-intel-docs-shell .api-intel-split__work {
    position: sticky;
    top: 8.25rem;
  }
}

@media (max-width: 1100px) {
  .api-intel-docs-shell .api-intel-split__work {
    position: static;
  }

  .api-intel-docs-shell #api-intel-spec-list.docs-scroll {
    max-height: min(240px, 28vh);
  }

  .api-intel-docs-shell #api-intel-changes-list.docs-scroll {
    max-height: min(360px, 42vh);
  }
}

.api-intel-docs-shell .docs-next-list {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: rgba(15, 28, 46, 0.82);
  font-size: 0.88rem;
  line-height: 1.45;
}

.api-intel-docs-shell .docs-next-list strong {
  font-weight: 650;
}

.api-intel-docs-shell .docs-overview {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(14, 116, 144, 0.06);
  border: 1px solid rgba(14, 116, 144, 0.12);
  line-height: 1.45;
}

.api-intel-docs-shell .api-intel-gap-ul,
.api-intel-docs-shell .api-intel-suggest-ol {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(15, 28, 46, 0.88);
}

.api-intel-docs-shell .api-intel-gap-ul {
  list-style: none;
  padding-left: 0;
}

.api-intel-docs-shell .api-intel-gap-tag {
  display: inline-block;
  min-width: 2.4em;
  margin-right: 0.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.api-intel-docs-shell .api-intel-gap-tag.is-missing {
  color: #9f1239;
  background: rgba(244, 63, 94, 0.12);
}

.api-intel-docs-shell .api-intel-gap-tag.is-partial {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
}

.api-intel-docs-shell #api-intel-docs-gap-list.docs-scroll {
  max-height: min(280px, 32vh);
  overflow: auto;
}

.api-intel-docs-shell .docs-split--direct .api-intel-split__work {
  min-width: 0;
}

@media (max-width: 760px) {
  .api-intel-docs-shell .api-intel-card.docs-step {
    padding: 0.85rem 0.8rem 0.95rem;
  }

  .api-intel-docs-shell .docs-cta-row .api-intel-btn {
    flex: 1 1 auto;
  }

  .api-intel-docs-shell .api-intel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .api-intel-docs-shell .api-intel-field--inline input,
  .api-intel-docs-shell .api-intel-field--inline select {
    min-width: 0;
    width: 100%;
  }
}


/* —— nosync：文档区通栏强调建议阅读 —— */
.api-intel-docs-shell .docs-step--diff .docs-cta-row .api-intel-btn--primary {
  min-width: 7.5rem;
}

.api-intel-docs-shell .docs-step--map .docs-step__head h3 {
  font-size: 0.95rem;
}

.api-intel-docs-shell #api-intel-docs-suggestions {
  min-height: 4.5rem;
  max-height: min(280px, 36vh);
  overflow: auto;
}


/* 通栏文档区：建议为主阅读 */
.api-intel-docs-shell .docs-split--direct {
  align-items: stretch;
}
.api-intel-docs-shell .docs-step--diff #api-intel-docs-suggestions {
  min-height: 6rem;
}
.api-intel-docs-shell .docs-step--map {
  margin-top: 0.15rem;
}


/* —— 32：文档对照工作台（合并差异+对应关系） —— */
.api-intel-docs-shell .docs-coverage {
  --docs-cov-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem 1.05rem;
  max-height: calc(100vh - 12rem);
  min-height: 0;
  overflow: hidden;
}

.api-intel-docs-shell .docs-coverage__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-shrink: 0;
}

.api-intel-docs-shell .docs-coverage__head-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.api-intel-docs-shell .docs-coverage__head-main h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 780;
  letter-spacing: -0.015em;
  color: var(--aiintel-ink, #0f172a);
}

.api-intel-docs-shell .docs-coverage__head-main > .api-intel-muted {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.api-intel-docs-shell .docs-coverage__head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  flex-shrink: 0;
}

.api-intel-docs-shell .docs-coverage__metrics {
  flex-shrink: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(14, 116, 144, 0.1);
}

.api-intel-docs-shell .docs-coverage__metrics-line {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

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

.api-intel-docs-shell .docs-coverage__block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
}

.api-intel-docs-shell .docs-coverage__title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--aiintel-muted, #64748b);
}

.api-intel-docs-shell .docs-coverage__insights {
  flex: 0 1 auto;
}

.api-intel-docs-shell .docs-coverage__insights #api-intel-docs-suggestions {
  min-height: 4.5rem;
  max-height: min(220px, 28vh);
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.api-intel-docs-shell .docs-coverage__gaps #api-intel-docs-gap-list {
  max-height: min(160px, 22vh);
}

.api-intel-docs-shell .docs-coverage__matrix {
  flex: 1 1 auto;
  min-height: 0;
}

.api-intel-docs-shell .docs-coverage__matrix #api-intel-l5-map-box {
  flex: 1 1 auto;
  max-height: min(260px, 32vh);
  min-height: 7rem;
  overflow: auto;
  padding: 0.15rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.api-intel-docs-shell .docs-coverage__matrix .api-intel-l5-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.api-intel-docs-shell .docs-coverage__matrix .api-intel-l5-table th,
.api-intel-docs-shell .docs-coverage__matrix .api-intel-l5-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  vertical-align: top;
}

.api-intel-docs-shell .docs-coverage__matrix .api-intel-l5-table th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.96);
  font-weight: 700;
  color: #475569;
  z-index: 1;
}

.api-intel-docs-shell .docs-coverage__matrix .api-intel-l5-table tr:hover td {
  background: rgba(14, 116, 144, 0.04);
}

.api-intel-docs-shell .docs-coverage__manual {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.api-intel-docs-shell .docs-split--direct .api-intel-split__work {
  position: sticky;
  top: 8.25rem;
  align-self: start;
}

@media (max-width: 1100px) {
  .api-intel-docs-shell .docs-coverage {
    max-height: none;
    overflow: visible;
  }
  .api-intel-docs-shell .docs-split--direct .api-intel-split__work {
    position: static;
  }
  .api-intel-docs-shell .docs-coverage__head {
    flex-direction: column;
  }
  .api-intel-docs-shell .docs-coverage__head-actions {
    width: 100%;
  }
  .api-intel-docs-shell .docs-coverage__head-actions .api-intel-btn {
    flex: 1 1 auto;
  }
}
