/* 金蝶开发者页互动增强 v20260727 */

.kd-error-search-wrap {
  max-width: var(--shell-max, 1440px);
  margin: 0.75rem auto 1rem;
  padding: 0 1rem;
}
.kd-error-search__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.4rem;
}
.kd-error-search__label .fa {
  color: #10b981;
  margin-right: 0.35rem;
}
.kd-error-search__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9375rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kd-error-search__input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.kd-error-search__meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

[data-kd-error-card] {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
[data-kd-error-card].kd-error-card--hidden {
  display: none !important;
}
[data-kd-error-card] .kd-error-card__solution {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s;
  margin-top: 0;
}
[data-kd-error-card].is-expanded .kd-error-card__solution,
[data-kd-error-card]:focus-within .kd-error-card__solution {
  max-height: 240px;
  opacity: 1;
  margin-top: 0.5rem;
}
[data-kd-error-card]::after {
  content: '点击展开解决方案';
  display: block;
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}
[data-kd-error-card].is-expanded::after {
  content: '点击收起';
}

.kd-oauth-checklist {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 2px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #fff);
}
.kd-oauth-checklist__title {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e40af;
}
.kd-oauth-checklist__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kd-oauth-checklist__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.8125rem;
  color: #334155;
}
.kd-oauth-checklist__list input {
  margin-top: 0.15rem;
  accent-color: #3b82f6;
}
.kd-oauth-checklist__progress {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}
.kd-oauth-checklist__progress a {
  color: #2563eb;
  font-weight: 700;
}

pre {
  position: relative;
}
.kd-code-copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  border: none;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
}

.kd-dev-mobile-jump {
  display: none;
}
@media (max-width: 768px) {
  .kd-dev-mobile-jump {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0));
    z-index: 44;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .kd-dev-mobile-jump a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 0.625rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
  }
  .kd-dev-mobile-jump a .fa {
    font-size: 0.875rem;
    color: #6ee7b7;
  }
  body.kd-dev-has-mobile-jump.has-biz-private-sticky {
    padding-bottom: calc(7.5rem + env(safe-area-inset-bottom, 0));
  }
  #backToTop {
    bottom: calc(7.5rem + env(safe-area-inset-bottom, 0)) !important;
  }
  #dev-community-float {
    display: none !important;
  }
}

@media (min-width: 769px) {
  [data-kd-error-card]::after {
    display: none;
  }
  [data-kd-error-card] .kd-error-card__solution {
    max-height: none;
    opacity: 1;
    margin-top: 0.5rem;
  }
}

/* P0: 商务条移动端折叠 */
.dev-purchase-bar--collapsible {
  max-width: var(--shell-max, 1440px);
  margin: 0 auto;
  padding: 0 1rem;
}
.dev-purchase-bar--collapsible summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: linear-gradient(135deg, #fffbeb, #fff);
}
.dev-purchase-bar--collapsible summary::-webkit-details-marker {
  display: none;
}
.dev-purchase-bar--collapsible summary::after {
  content: '展开';
  float: right;
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 700;
}
.dev-purchase-bar--collapsible[open] summary::after {
  content: '收起';
}
.dev-purchase-bar--collapsible .dev-purchase-bar__actions {
  margin-top: 0.5rem;
}
@media (min-width: 769px) {
  .dev-purchase-bar--collapsible summary {
    cursor: default;
    pointer-events: none;
  }
  .dev-purchase-bar--collapsible summary::after {
    display: none;
  }
}

/* P1: 阅读进度条 */
.kd-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}
.kd-read-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  transition: width 0.12s ease-out;
}

/* P1: 星辰 API 域 Tab */
#kd-api-domains .kd-api-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.kd-api-tabs__btn {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #fff;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.kd-api-tabs__btn.is-active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
[data-kd-api-domain].kd-api-card--dim {
  opacity: 0.35;
  transform: scale(0.98);
}
.kd-api-detail-panels {
  margin-top: 1rem;
}
.kd-api-detail {
  display: none;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #f8fafc;
  font-size: 0.8125rem;
  color: #334155;
  line-height: 1.55;
}
.kd-api-detail.is-active {
  display: block;
}
.kd-api-detail strong {
  color: #1e40af;
}
.kd-oauth-checklist--cosmos {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5, #fff);
}
.kd-oauth-checklist--cosmos .kd-oauth-checklist__title {
  color: #047857;
}
.kd-oauth-checklist--cosmos .kd-oauth-checklist__list input {
  accent-color: #10b981;
}

/* P1: 出站链确认 */
.kd-ext-modal[hidden] {
  display: none !important;
}
.kd-ext-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.kd-ext-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.kd-ext-modal__panel {
  position: relative;
  max-width: 420px;
  width: 100%;
  padding: 1.25rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.kd-ext-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.kd-ext-modal__summary {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
}
.kd-ext-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.kd-ext-modal__go {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}
.kd-ext-modal__stay {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.code-examples-official {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  font-size: 0.8125rem;
  color: #64748b;
  text-align: center;
}
.code-examples-official a {
  color: #047857;
  font-weight: 700;
}

.kd-dev-resources-fold {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.kd-dev-resources-fold__summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  font-size: 0.875rem;
  font-weight: 700;
  color: #475569;
  list-style: none;
}
.kd-dev-resources-fold__summary::-webkit-details-marker {
  display: none;
}
.kd-dev-resources-fold[open] .kd-dev-resources-fold__summary {
  border-color: #10b981;
  color: #047857;
  margin-bottom: 0.75rem;
}
.kd-dev-resources-fold__body {
  border-left: 3px solid #d1fae5;
  padding-left: 0.25rem;
}

.kd-recipe-card--expandable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kd-recipe-card--expandable.is-expanded {
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}
.kd-recipe-card__more {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin: 0.5rem 0 0;
}
.kd-recipe-card__detail {
  display: none;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #ecfdf5;
  font-size: 0.8125rem;
  color: #065f46;
  line-height: 1.55;
}
.kd-recipe-card.is-expanded .kd-recipe-card__more {
  display: none;
}
.kd-recipe-card.is-expanded .kd-recipe-card__detail {
  display: block;
}

#page-toc {
  display: none !important;
}

.kd-dev-toc {
  display: none;
}
@media (min-width: 1024px) {
  .kd-dev-toc {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    position: fixed;
    right: max(0.75rem, calc(50% - 720px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 10.5rem;
    max-width: 168px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 0.75rem 0.55rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    font-size: 0.75rem;
  }
  .kd-dev-toc__title {
    font-weight: 800;
    color: #94a3b8;
    margin: 0 0 0.35rem 0.35rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .kd-dev-toc__link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    line-height: 1.35;
    transition: background 0.15s, color 0.15s;
  }
  .kd-dev-toc__link:hover {
    background: #eff6ff;
    color: #3b82f6;
  }
  .kd-dev-toc__link.is-active {
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 700;
  }
  .kd-dev-toc__icon {
    width: 0.875rem;
    text-align: center;
    color: #3b82f6;
    flex-shrink: 0;
  }
  .kd-dev-toc__link--top {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.25rem;
    padding-top: 0.55rem;
    color: #94a3b8;
  }
  .kd-dev-toc__link--top:hover {
    color: #3b82f6;
  }
  body.kd-dev-has-toc {
    scroll-padding-top: 5.5rem;
  }
  html {
    scroll-behavior: smooth;
  }
}

/* 深色集成区 · 卡片文字对比度（星辰 developer #integration） */
#integration .kingdee-star-card {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(255, 255, 255, 0.15);
}
#integration .kingdee-star-card h4 {
  color: #111827;
}
#integration .kingdee-star-card p {
  color: #4b5563;
}
#integration .kingdee-star-card .text-gray-900 {
  color: #111827 !important;
}
#integration .kingdee-star-card .text-gray-600 {
  color: #4b5563 !important;
}
