/*
 * 用户端「次要页面」的统一版式：账号设置、开发者中心、API 结果、站内信（2026-10-01）。
 * 只服务带 .pg 根节点的模板，排在 novart-flow-theme.css 之后（templates/base.html）。
 * 视觉值取自 docs/flow/前端设计.md「视觉规范」：发丝线描边、白色低透明度卡片、主色 #2563eb、12.5–13.5px 正文、数字等宽。
 * 结构：页头（标题 + 说明 + 右侧操作）→ 统计条 / 页签 / 左侧分节导航 → 卡片（卡头 + 卡体）→ 表格 / 表单行 / 空状态。
 */

/* 第二个选择器压过 user-preview.css 的 `.page.user-preview-page.developer-page { width: min(1560px, calc(100% - 48px)) }`
   （开发者中心 / 接口文档的 main 否则会被削掉 48px，手机上右侧空一大块） */
body.nf-theme main.page:has(> .pg),
html body.nf-theme main.page.user-preview-page:has(> .pg) {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.nf-theme .pg {
  --pg-line: rgba(255, 255, 255, 0.06);
  --pg-border: rgba(255, 255, 255, 0.08);
  --pg-card: rgba(255, 255, 255, 0.025);
  --pg-field: rgba(0, 0, 0, 0.3);
  --pg-ink: #f0f0f0;
  --pg-dim: #a0a0a0;
  --pg-faint: #808080;
  box-sizing: border-box;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  color: var(--pg-ink);
  font-family: var(--nf-font);
  font-size: 13px;
  line-height: 1.55;
}

body.nf-theme .pg *,
body.nf-theme .pg *::before,
body.nf-theme .pg *::after {
  box-sizing: border-box;
}

/* ── 页头 ── */
body.nf-theme .pg .pg-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}

body.nf-theme .pg .pg-title {
  margin: 0;
  font-family: var(--nf-font);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
}

body.nf-theme .pg .pg-sub {
  margin: 4px 0 0;
  max-width: 640px;
  font-size: 12.5px;
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── 按钮 ── */
body.nf-theme .pg .pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-height: 0;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  color: var(--pg-ink);
  font: 600 12.5px/1 var(--nf-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.nf-theme .pg .pg-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body.nf-theme .pg .pg-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.nf-theme .pg .pg-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}

body.nf-theme .pg .pg-btn.primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

body.nf-theme .pg .pg-btn.danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

body.nf-theme .pg .pg-btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

body.nf-theme .pg .pg-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

body.nf-theme .pg .pg-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--pg-faint);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

body.nf-theme .pg .pg-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

body.nf-theme .pg .pg-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── 提示条 ── */
body.nf-theme .pg .notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 12.5px;
}

/* ── 卡片 ── */
body.nf-theme .pg .pg-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  background: var(--pg-card);
  box-shadow: none;
  overflow: hidden;
}

body.nf-theme .pg .pg-card + .pg-card,
body.nf-theme .pg .pg-stats + .pg-card,
body.nf-theme .pg .pg-card + .pg-stats {
  margin-top: 16px;
}

body.nf-theme .pg .pg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--pg-line);
}

body.nf-theme .pg .pg-card-title {
  margin: 0;
  font-family: var(--nf-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}

body.nf-theme .pg .pg-card-desc {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-card-body {
  padding: 16px 18px;
}

body.nf-theme .pg .pg-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--pg-line);
  background: rgba(255, 255, 255, 0.015);
}

body.nf-theme .pg .pg-card-foot .pg-hint {
  margin-right: auto;
}

body.nf-theme .pg .pg-hint {
  margin: 0;
  font-size: 12px;
  color: var(--pg-faint);
}

/* ── 统计条 ── */
body.nf-theme .pg .pg-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 0;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  background: var(--pg-card);
  overflow: hidden;
}

body.nf-theme .pg .pg-card .pg-stats {
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.nf-theme .pg .pg-stat {
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--pg-line);
}

body.nf-theme .pg .pg-stat:last-child {
  border-right: 0;
}

body.nf-theme .pg .pg-stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--pg-faint);
  white-space: nowrap;
}

body.nf-theme .pg .pg-stat-value {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.nf-theme .pg .pg-stat-value small {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-stat-value.is-ok { color: #34d399; }
body.nf-theme .pg .pg-stat-value.is-bad { color: #f87171; }
body.nf-theme .pg .pg-stat-value.is-accent { color: #93c5fd; }

/* ── 页签 ── */
body.nf-theme .pg .pg-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--pg-line);
  overflow-x: auto;
}

body.nf-theme .pg .pg-tab {
  flex: none;
  height: auto;
  min-height: 0;
  margin: 0 0 -1px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--pg-dim);
  font: 500 13px/1.4 var(--nf-font);
  cursor: pointer;
}

body.nf-theme .pg .pg-tab:hover {
  color: #fff;
}

body.nf-theme .pg .pg-tab.is-active {
  border-bottom-color: #3b82f6;
  color: #fff;
}

body.nf-theme .pg .pg-tab .pg-count {
  margin-left: 6px;
}

body.nf-theme .pg [data-pg-panel][hidden] {
  display: none !important;
}

/* ── 左侧分节导航 + 内容 ── */
body.nf-theme .pg .pg-split {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

body.nf-theme .pg .pg-subnav {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.nf-theme .pg .pg-subnav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--pg-dim);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

body.nf-theme .pg .pg-subnav a:hover,
body.nf-theme .pg .pg-subnav a.is-active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

body.nf-theme .pg .pg-subnav a.is-active {
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
}

body.nf-theme .pg .pg-section {
  scroll-margin-top: 24px;
}

/* ── 表单行（标签在左、控件在右） ── */
body.nf-theme .pg .pg-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--pg-line);
}

body.nf-theme .pg .pg-row:last-child {
  border-bottom: 0;
}

body.nf-theme .pg .pg-row-label {
  font-size: 12.5px;
  color: var(--pg-dim);
}

body.nf-theme .pg .pg-row-label small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-row-value {
  min-width: 0;
  color: #fff;
  font-weight: 500;
  overflow-wrap: anywhere;
}

body.nf-theme .pg .pg-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

body.nf-theme .pg .pg-inline > .pg-input {
  flex: 1 1 auto;
  max-width: 360px;
}

body.nf-theme .pg .pg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

body.nf-theme .pg .pg-field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--pg-dim);
}

body.nf-theme .pg .pg-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

body.nf-theme .pg .pg-input,
body.nf-theme .pg input.pg-input,
body.nf-theme .pg select.pg-input {
  width: 100%;
  height: 36px;
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--pg-field);
  box-shadow: none;
  color: #fff;
  font: 400 13px/1.4 var(--nf-font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.nf-theme .pg .pg-input::placeholder {
  color: #6b6b72;
}

body.nf-theme .pg .pg-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

body.nf-theme .pg .pg-input:focus {
  border-color: rgba(59, 130, 246, 0.7);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

body.nf-theme .pg input[type="date"].pg-input {
  color-scheme: dark;
}

/* ── 身份块（头像 + 名字 + 邮箱 + 徽标） ── */
body.nf-theme .pg .pg-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--pg-line);
}

body.nf-theme .pg .pg-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
}

body.nf-theme .pg .pg-identity-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

body.nf-theme .pg .pg-identity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--pg-faint);
}

/* ── 徽标 / 状态 ── */
body.nf-theme .pg .pg-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--pg-dim);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

body.nf-theme .pg .pg-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

body.nf-theme .pg .pg-badge.plain::before {
  display: none;
}

body.nf-theme .pg .pg-badge.is-ok { border-color: rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.1); color: #34d399; }
body.nf-theme .pg .pg-badge.is-bad { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1); color: #f87171; }
body.nf-theme .pg .pg-badge.is-run { border-color: rgba(56, 189, 248, 0.3); background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
body.nf-theme .pg .pg-badge.is-warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
body.nf-theme .pg .pg-badge.is-info { border-color: rgba(96, 165, 250, 0.35); background: rgba(37, 99, 235, 0.12); color: #93c5fd; }

body.nf-theme .pg .pg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pg-dim);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body.nf-theme .pg code,
body.nf-theme .pg .pg-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

body.nf-theme .pg code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #d4d4d8;
}

body.nf-theme .pg .plus { color: #34d399; }
body.nf-theme .pg .minus { color: #f0f0f0; }

/* ── 表格 ── */
body.nf-theme .pg .pg-table-wrap {
  width: 100%;
  overflow-x: auto;
}

body.nf-theme .pg table.pg-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: transparent;
  font-size: 12.5px;
}

body.nf-theme .pg .pg-table th {
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--pg-line);
  background: rgba(255, 255, 255, 0.015);
  color: var(--pg-faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

body.nf-theme .pg .pg-table td {
  padding: 11px 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: transparent;
  color: var(--pg-ink);
  vertical-align: middle;
}

body.nf-theme .pg .pg-table tbody tr:last-child td {
  border-bottom: 0;
}

body.nf-theme .pg .pg-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

body.nf-theme .pg .pg-table .pg-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.nf-theme .pg .pg-table .pg-muted,
body.nf-theme .pg .pg-muted {
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-table .pg-time {
  color: var(--pg-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body.nf-theme .pg .pg-table .pg-cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--pg-faint);
  font-size: 11.5px;
}

body.nf-theme .pg .pg-table .pg-actions-cell {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

/* ── 分页 ── */
body.nf-theme .pg .pg-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--pg-faint);
  font-variant-numeric: tabular-nums;
}

/* ── 空状态 ── */
body.nf-theme .pg .pg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 20px;
  text-align: center;
}

body.nf-theme .pg .pg-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--pg-faint);
}

body.nf-theme .pg .pg-empty-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.nf-theme .pg .pg-empty-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
}

body.nf-theme .pg .pg-empty-desc {
  margin: 0 0 10px;
  max-width: 420px;
  font-size: 12.5px;
  color: var(--pg-faint);
}

/* ── 折叠块 ── */
body.nf-theme .pg details.pg-details {
  border-top: 1px solid var(--pg-line);
}

body.nf-theme .pg details.pg-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--pg-dim);
  font-size: 12.5px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

body.nf-theme .pg details.pg-details > summary::-webkit-details-marker {
  display: none;
}

body.nf-theme .pg details.pg-details > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

body.nf-theme .pg details.pg-details[open] > summary::before {
  transform: rotate(45deg);
}

body.nf-theme .pg details.pg-details > summary:hover {
  color: #fff;
}

body.nf-theme .pg .pg-details-body {
  padding: 0 18px 16px;
}

/* ── 列表（站内信 / API 结果） ── */
body.nf-theme .pg .pg-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.nf-theme .pg .pg-list-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

body.nf-theme .pg .pg-list-item:last-child {
  border-bottom: 0;
}

body.nf-theme .pg .pg-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

body.nf-theme .pg .pg-dot.is-unread {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

body.nf-theme .pg .pg-list-title {
  margin: 0;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
}

body.nf-theme .pg .pg-list-body {
  margin: 4px 0 0;
  color: var(--pg-dim);
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.nf-theme .pg .pg-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  color: var(--pg-faint);
  font-size: 11.5px;
}

body.nf-theme .pg .pg-list-side {
  color: var(--pg-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ── 小屏 ── */
@media (max-width: 900px) {
  body.nf-theme .pg {
    padding: 18px 16px 40px;
  }

  body.nf-theme .pg .pg-head {
    flex-direction: column;
    align-items: flex-start;
  }

  body.nf-theme .pg .pg-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  body.nf-theme .pg .pg-subnav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }

  body.nf-theme .pg .pg-subnav a {
    flex: none;
  }

  body.nf-theme .pg .pg-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body.nf-theme .pg .pg-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  body.nf-theme .pg .pg-stat {
    border-right: 0;
    border-bottom: 1px solid var(--pg-line);
  }
}

/* 开发者中心：Key 表里的「不限」预算标签沿用徽标样式 */
body.nf-theme .pg .api-key-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--pg-dim);
  font-size: 11px;
  font-weight: 500;
}

body.nf-theme .pg .developer-api-key-action-icons {
  display: inline-flex;
  gap: 2px;
}

body.nf-theme .pg .developer-api-key-budget-cell span {
  display: block;
  color: var(--pg-faint);
  font-size: 11.5px;
}

/* ══ 接口文档（templates/developer_docs.html，2026-10-01）══════════════════════════════════════════
   三栏：左侧分组导航（sticky）｜正文（限宽约 880px，长文阅读宽度）｜右侧「本页目录」（≥1360px 才出现）。
   正文里的旧类名（developer-doc-list / -callout / -flow / developer-video-model-doc）保留不动，这里统一重画；
   app.css / user-preview.css 对这些类的旧样式由 .pg-docs 前缀的更高优先级压住。 */
body.nf-theme .pg.pg-docs {
  max-width: 1480px;
}

body.nf-theme .pg-docs .pgd-layout {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr) 200px;
  gap: 36px;
  align-items: start;
}

/* 左侧导航 */
body.nf-theme .pg-docs .pgd-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

body.nf-theme .pg-docs .pgd-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.nf-theme .pg-docs .pgd-nav-label {
  padding: 0 10px 6px;
  color: var(--pg-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.nf-theme .pg-docs .pgd-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pg-dim);
  font: 500 13px/1.3 var(--nf-font);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

body.nf-theme .pg-docs .pgd-nav-item svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

body.nf-theme .pg-docs .pgd-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

body.nf-theme .pg-docs .pgd-nav-item.is-active {
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
}

body.nf-theme .pg-docs .pgd-nav-item.is-active svg {
  opacity: 1;
}

/* 速查条：Base URL / 鉴权头 / 去拿 Key */
body.nf-theme .pg-docs .pgd-quick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 12px;
  border: 1px solid var(--pg-border);
  border-radius: 12px;
  background: var(--pg-card);
}

body.nf-theme .pg-docs .pgd-quick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 6px 6px 12px;
  border-radius: 9px;
  background: var(--pg-field);
}

body.nf-theme .pg-docs .pgd-quick-label {
  flex: none;
  color: var(--pg-faint);
  font-size: 11.5px;
}

body.nf-theme .pg-docs .pgd-quick-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: none;
  color: #e5e7eb;
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.nf-theme .pg-docs .pgd-quick-link {
  padding: 0 8px;
  color: #93c5fd;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}

body.nf-theme .pg-docs .pgd-quick-link:hover {
  color: #bfdbfe;
}

/* 正文 */
body.nf-theme .pg-docs .pgd-main {
  min-width: 0;
  max-width: 880px;
  color: #d4d4d8;
  font-size: 13.5px;
  line-height: 1.7;
}

body.nf-theme .pg-docs .developer-doc-pane {
  content-visibility: visible;
  contain-intrinsic-size: none;
  display: block;
  padding: 0;
  border: 0;
  background: none;
}

body.nf-theme .pg-docs .developer-doc-pane[hidden] {
  display: none;
}

body.nf-theme .pg-docs .pgd-main h3 {
  margin: 36px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--pg-line);
  color: #fff;
  font: 650 17px/1.35 var(--nf-font);
  letter-spacing: -0.005em;
  scroll-margin-top: 20px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-pane > h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 20px;
}

body.nf-theme .pg-docs .pgd-main h4 {
  margin: 28px 0 10px;
  color: #f4f4f5;
  font: 600 15px/1.4 var(--nf-font);
  scroll-margin-top: 20px;
}

body.nf-theme .pg-docs .pgd-main h5 {
  margin: 18px 0 8px;
  color: var(--pg-dim);
  font: 600 12px/1.4 var(--nf-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.nf-theme .pg-docs .pgd-main p {
  margin: 0 0 12px;
}

body.nf-theme .pg-docs .pgd-main .muted {
  color: var(--pg-dim);
}

body.nf-theme .pg-docs .pgd-main strong {
  color: #f4f4f5;
  font-weight: 600;
}

body.nf-theme .pg-docs .pgd-main a:not(.pg-btn) {
  color: #93c5fd;
  text-decoration: none;
}

body.nf-theme .pg-docs .pgd-main a:not(.pg-btn):hover {
  text-decoration: underline;
}

/* 行内 code */
body.nf-theme .pg-docs .pgd-main :not(pre) > code {
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  word-break: break-word;
}

/* 列表 */
body.nf-theme .pg-docs .pgd-main .developer-doc-list {
  margin: 0 0 16px;
  padding-left: 20px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-list li {
  margin: 0;
  padding-left: 2px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-list li + li {
  margin-top: 6px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-list li::marker {
  color: var(--pg-faint);
}

body.nf-theme .pg-docs .pgd-main .developer-doc-list .developer-doc-list {
  margin: 6px 0 0;
}

/* 接口行：方法徽标 + 路径 */
body.nf-theme .pg-docs .pgd-main code.pgd-endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 8px 2px 3px;
}

body.nf-theme .pg-docs .pgd-method {
  display: inline-block;
  min-width: 42px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

body.nf-theme .pg-docs .pgd-method.is-get { background: rgba(34, 197, 94, 0.16); color: #86efac; }
body.nf-theme .pg-docs .pgd-method.is-post { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
body.nf-theme .pg-docs .pgd-method.is-put,
body.nf-theme .pg-docs .pgd-method.is-patch { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
body.nf-theme .pg-docs .pgd-method.is-delete { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }

/* 代码块：顶栏（语言 + 复制）+ 正文 */
body.nf-theme .pg-docs .pgd-code {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--pg-border);
  border-radius: 10px;
  background: #0b0c0e;
}

body.nf-theme .pg-docs .pgd-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 6px 0 12px;
  border-bottom: 1px solid var(--pg-line);
  background: rgba(255, 255, 255, 0.025);
}

body.nf-theme .pg-docs .pgd-code-lang {
  color: var(--pg-faint);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

body.nf-theme .pg-docs .pgd-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--pg-dim);
  font: 500 11.5px/1 var(--nf-font);
  cursor: pointer;
}

body.nf-theme .pg-docs .pgd-code-copy:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

body.nf-theme .pg-docs .pgd-code-copy.is-done,
body.nf-theme .pg-docs .pg-icon-btn.is-done {
  color: #86efac;
}

body.nf-theme .pg-docs .pgd-code-copy svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.nf-theme .pg-docs .pgd-main pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e4e4e7;
  font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
  scrollbar-width: thin;
}

body.nf-theme .pg-docs .pgd-main pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}

/* 提示块 */
body.nf-theme .pg-docs .pgd-main .developer-doc-callout {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-left: 3px solid #3b82f6;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.07);
  box-shadow: none;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-callout > strong:first-child {
  display: block;
  margin-bottom: 6px;
  color: #dbeafe;
  font-size: 13.5px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-callout p {
  margin: 0;
  color: #cbd5e1;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-callout p + p,
body.nf-theme .pg-docs .pgd-main .developer-doc-callout .developer-doc-list {
  margin-top: 8px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-callout .developer-doc-list {
  margin-bottom: 0;
}

body.nf-theme .pg-docs .pgd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

body.nf-theme .pg-docs .developer-doc-callout .pgd-actions {
  margin-bottom: 0;
}

/* 步骤卡（异步任务模式） */
body.nf-theme .pg-docs .pgd-main .developer-doc-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 8px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid var(--pg-border);
  border-radius: 10px;
  background: var(--pg-card);
  box-shadow: none;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step > span {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step > strong {
  font-size: 13.5px;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step > p {
  margin: 0;
  color: var(--pg-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 表格（视频模型总览） */
body.nf-theme .pg-docs .pgd-table {
  margin: 0 0 18px;
  border: 1px solid var(--pg-border);
  border-radius: 10px;
}

body.nf-theme .pg-docs .pgd-table td {
  vertical-align: top;
  line-height: 1.7;
}

/* 每个视频模型一个折叠块 */
body.nf-theme .pg-docs .pgd-main .developer-video-model-doc {
  margin: 0 0 10px;
  border: 1px solid var(--pg-border);
  border-radius: 10px;
  background: var(--pg-card);
  overflow: hidden;
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc > summary::-webkit-details-marker {
  display: none;
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc > summary::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin: 0 2px;
  border-right: 1.6px solid var(--pg-dim);
  border-bottom: 1.6px solid var(--pg-dim);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc[open] > summary::before {
  transform: rotate(45deg);
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc[open] > summary {
  border-bottom: 1px solid var(--pg-line);
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc > summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.nf-theme .pg-docs .pgd-main .developer-video-model-doc-body {
  padding: 4px 16px 6px;
}

/* 右侧本页目录 */
body.nf-theme .pg-docs .pgd-toc {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

body.nf-theme .pg-docs .pgd-toc[hidden] {
  display: none;
}

body.nf-theme .pg-docs .pgd-toc-label {
  margin: 0 0 8px;
  color: var(--pg-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.nf-theme .pg-docs .pgd-toc nav {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--pg-line);
}

body.nf-theme .pg-docs .pgd-toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid transparent;
  color: var(--pg-faint);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.12s ease, border-color 0.12s ease;
}

body.nf-theme .pg-docs .pgd-toc a.is-sub {
  padding-left: 22px;
}

body.nf-theme .pg-docs .pgd-toc a:hover {
  color: #fff;
}

body.nf-theme .pg-docs .pgd-toc a.is-active {
  border-left-color: #60a5fa;
  color: #bfdbfe;
}

@media (max-width: 1360px) {
  body.nf-theme .pg-docs .pgd-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 32px;
  }

  body.nf-theme .pg-docs .pgd-toc {
    display: none;
  }
}

@media (max-width: 1080px) {
  body.nf-theme .pg-docs .pgd-quick {
    grid-template-columns: minmax(0, 1fr);
  }

  body.nf-theme .pg-docs .pgd-main .developer-doc-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.nf-theme .pg-docs .pgd-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.nf-theme .pg-docs .pgd-nav {
    position: static;
    flex-direction: row;
    gap: 4px;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body.nf-theme .pg-docs .pgd-nav-group {
    flex-direction: row;
    gap: 4px;
  }

  body.nf-theme .pg-docs .pgd-nav-label {
    display: none;
  }

  body.nf-theme .pg-docs .pgd-nav-item {
    width: auto;
    white-space: nowrap;
  }

  body.nf-theme .pg-docs .pgd-main .developer-doc-flow {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 接口清单行：方法徽标已经起到列表符号的作用，去掉圆点 */
body.nf-theme .pg-docs .pgd-main .developer-doc-list li:has(> code.pgd-endpoint:first-child) {
  margin-left: -20px;
  list-style: none;
}

/* 直接打开本页时顶栏是 fixed 的（48px），粘顶要让开它；在宿主页 iframe 里（html.nf-in-frame）没有顶栏 */
html:not(.nf-in-frame) body.nf-theme .pg-docs .pgd-nav,
html:not(.nf-in-frame) body.nf-theme .pg-docs .pgd-toc {
  top: calc(var(--nf-top-h, 48px) + 16px);
  max-height: calc(100vh - var(--nf-top-h, 48px) - 32px);
}

html:not(.nf-in-frame) body.nf-theme .pg-docs .pgd-main h3,
html:not(.nf-in-frame) body.nf-theme .pg-docs .pgd-main h4 {
  scroll-margin-top: calc(var(--nf-top-h, 48px) + 16px);
}

/* 旧 app.css 把提示块里的所有 strong 设成 display:block（段落里的加粗会被拆成单独一行），只保留标题那一个 */
body.nf-theme .pg-docs .pgd-main .developer-doc-callout p strong,
body.nf-theme .pg-docs .pgd-main .developer-doc-callout li strong {
  display: inline;
  margin: 0;
  font-size: inherit;
}

/* 步骤卡 2×2：正文 880px 宽时四列每格不到 200px，行内接口路径会被拆得很碎 */
body.nf-theme .pg-docs .pgd-main .developer-doc-flow {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step > span {
  align-self: flex-start;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

/* 视频模型总览：模型名 + slug 合成一列（上下两行）不折行，其余列按内容给最小宽，仍放不下时横向滚动 */
body.nf-theme .pg-docs .pgd-table {
  overflow-x: auto;
}

body.nf-theme .pg-docs .pgd-table table {
  min-width: 680px;
}

body.nf-theme .pg-docs .pgd-table th,
body.nf-theme .pg-docs .pgd-table td:first-child {
  white-space: nowrap;
}

body.nf-theme .pg-docs .pgd-model-name {
  margin-bottom: 4px;
  color: #fff;
  font-weight: 600;
}

body.nf-theme .pg-docs .pgd-table td:nth-child(2) {
  min-width: 160px;
}

body.nf-theme .pg-docs .pgd-table td:nth-child(3) {
  min-width: 120px;
}

body.nf-theme .pg-docs .pgd-table td:nth-child(4) {
  min-width: 140px;
}

body.nf-theme .pg-docs .pgd-table td:nth-child(5) {
  min-width: 96px;
}

body.nf-theme .pg-docs .pgd-table td code {
  white-space: nowrap;
}

body.nf-theme .pg-docs .pgd-main .developer-doc-flow-step > strong {
  margin: 0;
}

/* ══ 模型价格（templates/model_prices.html，2026-10-02）══════════════════════════════════════════
   一类一张表：分组行（图标 + 组名 + 个数）→ 二级分组小标题 → 模型行（名称 + 标识 | 状态 | 价格各列）。 */
body.nf-theme .pg.pg-model-prices {
  max-width: 1280px;
}

body.nf-theme .pg-model-prices .pgm-checked {
  font-size: 12px;
}

body.nf-theme .pg-model-prices .pgm-hint {
  margin: 0 0 12px;
}

body.nf-theme .pg-model-prices .pgm-table th,
body.nf-theme .pg-model-prices .pgm-table td {
  vertical-align: top;
}

body.nf-theme .pg-model-prices .pgm-group-row th {
  padding-top: 14px;
  padding-bottom: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}

body.nf-theme .pg-model-prices .pgm-group-row .pg-count {
  margin-left: 6px;
}

body.nf-theme .pg-model-prices .pgm-group-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: -5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

body.nf-theme .pg-model-prices .pgm-group-icon .admin-group-icon {
  display: block;
  object-fit: contain;
  border-radius: 3px;
}

body.nf-theme .pg-model-prices .pgm-sub-row th {
  padding: 8px 14px 4px 44px;
  color: var(--pg-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: none;
}

body.nf-theme .pg-model-prices .pgm-model strong {
  display: block;
  color: var(--pg-ink);
  font-weight: 600;
}

body.nf-theme .pg-model-prices .pgm-model code {
  color: var(--pg-faint);
  font-size: 11.5px;
}

body.nf-theme .pg-model-prices .pgm-status {
  white-space: nowrap;
}

body.nf-theme .pg-model-prices .pgm-status.is-ok {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

body.nf-theme .pg-model-prices .pgm-status.is-off {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

body.nf-theme .pg-model-prices .pgm-lines div + div {
  margin-top: 2px;
}

body.nf-theme .pg-model-prices .pgm-lines {
  color: var(--pg-ink);
  font-variant-numeric: tabular-nums;
}

body.nf-theme .pg-model-prices .pgm-old {
  color: var(--pg-faint);
}

body.nf-theme .pg-model-prices .pgm-sale {
  color: #fcd34d;
}
