/* 开放接口文档中心 */
#api-docs-page {
  display: none;
  padding: 100px 0 60px;
  min-height: 100vh;
  background: #f5f7fb;
  box-sizing: border-box;
}
#api-docs-page *,
#api-docs-page *::before,
#api-docs-page *::after {
  box-sizing: border-box;
}
.oad-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 160px;
  gap: 20px;
  position: relative;
  width: 100%;
}
.oad-side, .oad-main, .oad-toc {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  min-width: 0;
}
.oad-side {
  padding: 14px 12px 18px;
  height: fit-content;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.oad-side h3 {
  font-size: 14px;
  color: #64748b;
  margin: 0 12px 12px;
  font-weight: 600;
}
.oad-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.oad-skill-btn {
  border: none;
  background: #2563eb;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.oad-skill-btn:hover { background: #1d4ed8; }
.oad-skill-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}
.oad-ai-card,
.oad-side-tip,
.oad-ai-label { display: none !important; }

.oad-cat {
  margin-bottom: 8px;
}
.oad-cat-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  border-radius: 8px;
}
.oad-cat-title:hover { background: #f1f5f9; }
.oad-badge {
  font-size: 11px;
  color: #fff;
  background: #f59e0b;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
}
.oad-ep-list { list-style: none; margin: 0; padding: 0 0 6px 8px; }
.oad-ep-list li a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.oad-ep-list li a:hover,
.oad-ep-list li a.active {
  background: #eff6ff;
  color: #1d4ed8;
}
.oad-main {
  padding: 28px 32px 40px;
  min-height: 640px;
  position: relative;
}
.oad-main-head {
  display: block;
  margin-bottom: 18px;
}
.oad-main-head .icon,
.oad-main-head > div.icon,
#api-docs-page .oad-main-head .icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}
.oad-main-head h1 {
  font-size: clamp(18px, 2.4vw, 22px);
  margin: 0;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.oad-badge { display: none !important; }
.oad-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
  color: #475569;
  font-size: 14px;
  word-break: break-word;
}
.oad-section { margin-bottom: 28px; }
.oad-section h2 {
  font-size: 16px;
  color: #0f172a;
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid #3b82f6;
}
.oad-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #334155;
}
.oad-meta-row > span {
  flex: 0 0 auto;
  color: #64748b;
  min-width: 4.5em;
}
.oad-meta-row code {
  background: #eef2ff;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
  max-width: 100%;
}
.oad-copy {
  border: none;
  background: #3b82f6;
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.oad-copy:hover { background: #2563eb; }
.oad-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}
.oad-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}
.oad-table th, .oad-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.oad-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}
.oad-req { color: #dc2626; font-weight: 600; }
.oad-pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.oad-toc {
  padding: 16px 12px;
  height: fit-content;
  position: sticky;
  top: 90px;
  font-size: 13px;
}
.oad-toc h4 {
  margin: 0 0 10px 8px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}
.oad-toc a {
  display: block;
  color: #64748b;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}
.oad-toc a:hover { color: #1d4ed8; background: #eff6ff; }
.oad-lock {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 24px;
}
.oad-lock-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  padding: 28px 24px;
  text-align: center;
}
.oad-lock-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #0f172a;
}
.oad-lock-card p {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 14px;
}
.oad-lock-card input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.oad-lock-card .oad-btn {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.oad-lock-card .oad-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.oad-lock-err {
  color: #dc2626;
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}
.oad-blur-demo {
  filter: blur(3px);
  user-select: none;
  pointer-events: none;
  opacity: 0.55;
}
.oad-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.oad-topbar .hint {
  font-size: 13px;
  color: #64748b;
  flex: 1 1 200px;
  min-width: 0;
  word-break: break-word;
}
.oad-topbar .hint strong { color: #1e40af; }

/* 平板：隐藏右侧导航 */
@media (max-width: 1100px) {
  .oad-wrap {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .oad-toc { display: none; }
}

/* 小平板 / 大手机：单栏 */
@media (max-width: 860px) {
  #api-docs-page {
    padding: 84px 0 40px;
  }
  .oad-wrap {
    grid-template-columns: 1fr;
    padding: 0 12px;
    gap: 12px;
  }
  .oad-side {
    position: relative;
    top: 0;
    max-height: none;
    overflow: visible;
    padding: 12px 10px 14px;
  }
  .oad-main {
    padding: 18px 14px 24px;
    min-height: 0;
  }
  .oad-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .oad-meta-row > span {
    min-width: 0;
  }
  .oad-section { margin-bottom: 22px; }
  .oad-lock {
    padding: 16px;
    position: absolute;
  }
  .oad-lock-card {
    padding: 22px 16px;
  }
  .oad-lock-card h3 { font-size: 18px; }
}

/* 手机：侧栏接口可横滑浏览，表格可横滑 */
@media (max-width: 560px) {
  #api-docs-page {
    padding: 76px 0 28px;
  }
  .oad-wrap {
    padding: 0 10px;
    gap: 10px;
  }
  .oad-side,
  .oad-main {
    border-radius: 10px;
  }
  .oad-cat-title {
    font-size: 13px;
    padding: 8px 10px;
  }
  .oad-ep-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .oad-ep-list li {
    flex: 0 0 auto;
  }
  .oad-ep-list li a {
    white-space: nowrap;
    padding: 7px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }
  .oad-ep-list li a.active {
    border-color: #bfdbfe;
  }
  .oad-box,
  .oad-pre {
    padding: 12px;
    font-size: 12px;
  }
  .oad-table {
    font-size: 12px;
    min-width: 480px;
  }
  .oad-table th,
  .oad-table td {
    padding: 8px 10px;
  }
  .oad-topbar .hint {
    font-size: 12px;
  }
}
