/* 千剧工坊 · 开放 API 密钥管理与官方文档页面样式（黑白极简玻璃态 · 昼夜双主题适配） */
.ap-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ap-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(24, 24, 27, 0.65);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.ap-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ap-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ap-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
  font-size: 11.5px;
  font-weight: 500;
}

.ap-badge.is-strong {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  font-weight: 600;
}

.ap-hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f4f4f5;
}

.ap-hero p {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
  line-height: 1.55;
}

.ap-hero-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ap-base-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 9, 11, 0.55);
  color: #d4d4d8;
  font-size: 12px;
}

.ap-base-pill code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #ffffff;
  font-size: 12px;
}

.ap-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 27, 0.72);
  align-self: flex-start;
}

.ap-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.ap-tab:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.06);
}

.ap-tab.is-on {
  background: #ffffff;
  color: #09090b;
  font-weight: 600;
}

.ap-card {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 27, 0.62);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ap-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ap-card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f4f4f5;
}

.ap-create-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ap-create-form .input {
  width: 240px;
  max-width: 100%;
  height: 36px;
  border-radius: 10px;
}

.ap-secret-banner {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-secret-banner strong {
  font-size: 13.5px;
  color: #ffffff;
}

.ap-secret-banner p {
  margin: 0;
  font-size: 12px;
  color: #d4d4d8;
}

.ap-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ap-secret-code {
  flex: 1 1 280px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 9, 11, 0.72);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.ap-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ap-table th,
.ap-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  vertical-align: middle;
}

.ap-table th {
  font-size: 12px;
  font-weight: 500;
  color: #71717a;
  white-space: nowrap;
}

.ap-table td {
  color: #e4e4e7;
}

.ap-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.ap-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}

.ap-status.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.ap-status.is-revoked {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.24);
}

.ap-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.ap-model-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(17, 17, 20, 0.65);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-model-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ap-model-top h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f4f4f5;
}

.ap-model-top code {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.ap-price-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ap-price-pill {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: #e4e4e7;
}

.ap-specs {
  margin: 0;
  font-size: 12px;
  color: #a1a1aa;
  line-height: 1.65;
}

/* Docs Layout */
.ap-docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ap-docs-toc {
  position: sticky;
  top: 76px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 27, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ap-docs-toc a {
  padding: 7px 10px;
  border-radius: 8px;
  color: #a1a1aa;
  font-size: 12.5px;
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}

.ap-docs-toc a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.ap-docs-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ap-doc-sec {
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 24, 27, 0.62);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ap-doc-sec h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f4f4f5;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ap-method {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.ap-doc-sec p,
.ap-doc-sec li {
  margin: 0;
  font-size: 13px;
  color: #d4d4d8;
  line-height: 1.65;
}

.ap-doc-sec ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ap-code-box {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d0d10;
  overflow: hidden;
}

.ap-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  color: #a1a1aa;
}

.ap-code-pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #f4f4f5;
}

.ap-lang-tabs {
  display: inline-flex;
  gap: 4px;
}

.ap-lang-tab {
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 11.5px;
  cursor: pointer;
}

.ap-lang-tab.is-on {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 600;
}

.ap-empty {
  padding: 28px 16px;
  text-align: center;
  color: #71717a;
  font-size: 13px;
}

@media (max-width: 860px) {
  .ap-docs-layout {
    grid-template-columns: 1fr;
  }
  .ap-docs-toc {
    position: static;
  }
}

/* Day / Light Theme High-Contrast Overrides */
html:is([data-theme="light"], [data-theme="day"]) .ap-hero,
html:is([data-theme="light"], [data-theme="day"]) .ap-card,
html:is([data-theme="light"], [data-theme="day"]) .ap-docs-toc,
html:is([data-theme="light"], [data-theme="day"]) .ap-doc-sec {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-hero h1,
html:is([data-theme="light"], [data-theme="day"]) .ap-card-head h2,
html:is([data-theme="light"], [data-theme="day"]) .ap-model-top h3,
html:is([data-theme="light"], [data-theme="day"]) .ap-doc-sec h3,
html:is([data-theme="light"], [data-theme="day"]) .ap-secret-banner strong {
  color: #111113;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-hero p,
html:is([data-theme="light"], [data-theme="day"]) .ap-specs,
html:is([data-theme="light"], [data-theme="day"]) .ap-docs-toc a,
html:is([data-theme="light"], [data-theme="day"]) .ap-secret-banner p {
  color: #52525b;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-doc-sec p,
html:is([data-theme="light"], [data-theme="day"]) .ap-doc-sec li,
html:is([data-theme="light"], [data-theme="day"]) .ap-table td {
  color: #27272a;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #27272a;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-badge.is-strong,
html:is([data-theme="light"], [data-theme="day"]) .ap-tab.is-on {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-tab {
  color: #52525b;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-tab:hover,
html:is([data-theme="light"], [data-theme="day"]) .ap-docs-toc a:hover {
  color: #111113;
  background: rgba(0, 0, 0, 0.05);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-base-pill,
html:is([data-theme="light"], [data-theme="day"]) .ap-model-card,
html:is([data-theme="light"], [data-theme="day"]) .ap-price-pill {
  background: #f4f4f6;
  border-color: rgba(0, 0, 0, 0.09);
  color: #18181b;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-base-pill code,
html:is([data-theme="light"], [data-theme="day"]) .ap-model-top code {
  color: #111113;
  background: rgba(0, 0, 0, 0.06);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-table th,
html:is([data-theme="light"], [data-theme="day"]) .ap-table td {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-status.is-active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-status.is-revoked {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-secret-banner {
  background: rgba(24, 24, 27, 0.04);
  border-color: rgba(24, 24, 27, 0.24);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-secret-code {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.14);
  color: #111113;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-method {
  background: #18181b;
  color: #ffffff;
}

.ap-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.ap-copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
}

html:is([data-theme="light"], [data-theme="day"]) .ap-code-box {
  background: #18181b;
  border-color: rgba(0, 0, 0, 0.14);
}

html:is([data-theme="light"], [data-theme="day"]) .ap-code-head {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
}

@media (max-width: 640px) {
  .ap-wrap {
    padding: 14px 12px 48px;
    gap: 14px;
  }
  .ap-hero {
    padding: 16px;
    gap: 12px;
  }
  .ap-hero h1 {
    font-size: 20px;
  }
  .ap-hero-side {
    width: 100%;
  }
  .ap-base-pill {
    width: 100%;
    height: auto;
    min-height: 36px;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }
  .ap-base-pill > span {
    white-space: nowrap;
    font-weight: 600;
  }
  .ap-base-pill code {
    flex: 1 1 180px;
    min-width: 0;
    word-break: break-all;
    font-size: 11.5px;
    line-height: 1.45;
  }
  .ap-tabs {
    align-self: stretch;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ap-tabs::-webkit-scrollbar {
    display: none;
  }
  .ap-tab {
    white-space: nowrap;
    flex: 1 1 0;
    justify-content: center;
    padding: 0 8px;
    gap: 4px;
    font-size: 11.5px;
  }
  .ap-card {
    padding: 16px 14px;
  }
  .ap-create-form .input {
    width: 100%;
    flex: 1 1 100%;
  }
  .ap-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ap-table {
    min-width: 540px;
  }
  .ap-empty {
    text-align: left;
    padding: 20px 8px;
    white-space: normal;
  }
}
