/* AI轻创 API 站主页。颜色全部取 New API 原生主题变量，跟随站点浅色 / 深色切换。 */
html.qc-home-on [data-qc-home-hidden] { display: none !important; }

#qc-api-home {
  --qh-fg: var(--foreground, #0a0a0a);
  --qh-muted: var(--muted-foreground, #737373);
  --qh-border: var(--border, #e8e8e8);
  --qh-card: var(--card, #fff);
  --qh-soft: var(--muted, #f5f5f5);
  --qh-primary: var(--primary, #0276ea);
  --qh-primary-fg: var(--primary-foreground, #fff);
  --qh-ok: #16a34a;
  --qh-warn: #d97706;
  position: relative;
  z-index: 1;
  color: var(--qh-fg);
  font-feature-settings: "tnum" 0;
}
#qc-api-home *, #qc-api-home *::before, #qc-api-home *::after { box-sizing: border-box; }
#qc-api-home .qh-ico { display: inline-flex; flex: none; }
#qc-api-home .qh-ico svg { display: block; }

/* 背景：极淡的主色光晕 + 网格，只在首屏 */
#qc-api-home .qh-bg {
  position: absolute; inset: 0 0 auto 0; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 55% at 78% 18%, color-mix(in oklab, var(--qh-primary) 9%, transparent), transparent 70%),
    radial-gradient(40% 40% at 8% 10%, color-mix(in oklab, var(--qh-primary) 5%, transparent), transparent 70%);
}
#qc-api-home .qh-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--qh-border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--qh-border) 70%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 80%);
  opacity: .5;
}

#qc-api-home .qh-wrap { max-width: 1152px; margin: 0 auto; padding: 120px 24px 56px; }

/* —— 首屏 —— */
#qc-api-home .qh-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
#qc-api-home .qh-hero-left { min-width: 0; }
#qc-api-home .qh-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border: 1px solid var(--qh-border); border-radius: 999px; background: var(--qh-card);
  font-size: 12px; font-weight: 500; color: var(--qh-muted);
}
#qc-api-home .qh-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--qh-ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--qh-ok) 18%, transparent); }
#qc-api-home .qh-title {
  margin: 20px 0 0; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.16; font-weight: 700;
  letter-spacing: -0.03em; color: var(--qh-fg);
}
#qc-api-home .qh-sub { margin: 18px 0 0; font-size: 15px; line-height: 1.7; color: var(--qh-muted); max-width: 520px; }

#qc-api-home .qh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
#qc-api-home .qh-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--qh-border); background: var(--qh-card);
  color: var(--qh-fg); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s;
}
#qc-api-home .qh-btn:hover { background: var(--qh-soft); }
#qc-api-home .qh-btn:active { transform: translateY(1px); }
#qc-api-home .qh-btn.is-primary { background: var(--qh-fg); border-color: var(--qh-fg); color: var(--background, #fff); }
#qc-api-home .qh-btn.is-primary:hover { background: color-mix(in oklab, var(--qh-fg) 86%, transparent); }
#qc-api-home .qh-btn.is-primary .qh-ico { transition: transform .15s; }
#qc-api-home .qh-btn.is-primary:hover .qh-ico { transform: translateX(2px); }
#qc-api-home .qh-btn.is-ghost { border-color: transparent; background: transparent; color: var(--qh-muted); }
#qc-api-home .qh-btn.is-ghost:hover { color: var(--qh-fg); background: var(--qh-soft); }
#qc-api-home .qh-btn:focus-visible, #qc-api-home button:focus-visible, #qc-api-home .qh-link:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--qh-primary) 60%, transparent); outline-offset: 2px;
}

#qc-api-home .qh-base {
  display: flex; align-items: center; gap: 10px; margin-top: 22px; max-width: 460px; height: 40px;
  padding: 0 4px 0 14px; border: 1px solid var(--qh-border); border-radius: 10px; background: var(--qh-card);
}
#qc-api-home .qh-base-label { font-size: 12px; font-weight: 500; color: var(--qh-muted); white-space: nowrap; }
#qc-api-home .qh-base-url {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--qh-fg);
}
#qc-api-home .qh-base-copy, #qc-api-home .qh-copy {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--qh-muted); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
#qc-api-home .qh-base-copy:hover, #qc-api-home .qh-copy:hover { background: var(--qh-soft); color: var(--qh-fg); }
#qc-api-home .is-done { color: var(--qh-ok) !important; }

#qc-api-home .qh-stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 30px 0 0; padding: 0; }
#qc-api-home .qh-stat { margin: 0; min-width: 0; }
#qc-api-home .qh-stat dt { font-size: 13px; color: var(--qh-muted); display: flex; align-items: baseline; gap: 6px; }
#qc-api-home .qh-stat dt b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--qh-fg); font-variant-numeric: tabular-nums; }
#qc-api-home .qh-stat dd { margin: 4px 0 0; font-size: 12px; color: var(--qh-muted); opacity: .85; }

/* —— 代码卡 —— */
#qc-api-home .qh-hero-right { min-width: 0; }
#qc-api-home .qh-code {
  border: 1px solid var(--qh-border); border-radius: 16px; background: var(--qh-card); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 32px -12px rgba(0,0,0,.12);
}
#qc-api-home .qh-code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 6px; border-bottom: 1px solid var(--qh-border);
}
#qc-api-home .qh-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
#qc-api-home .qh-tabs::-webkit-scrollbar { display: none; }
#qc-api-home .qh-tab {
  position: relative; height: 44px; padding: 0 12px; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--qh-muted); white-space: nowrap;
}
#qc-api-home .qh-tab:hover { color: var(--qh-fg); }
#qc-api-home .qh-tab[aria-selected="true"] { color: var(--qh-fg); }
#qc-api-home .qh-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--qh-fg);
}
#qc-api-home .qh-code-status {
  display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; font-weight: 500; color: var(--qh-muted); white-space: nowrap;
}
#qc-api-home .qh-code-status[hidden] { display: none; }
#qc-api-home .qh-code-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#qc-api-home .qh-code-status.is-ok { color: var(--qh-ok); }
#qc-api-home .qh-code-status.is-warn { color: var(--qh-warn); }

#qc-api-home .qh-code-bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 4px 18px; }
#qc-api-home .qh-code-method {
  flex: none; height: 20px; padding: 0 6px; border-radius: 5px; display: inline-flex; align-items: center;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em;
  color: var(--qh-ok); background: color-mix(in oklab, var(--qh-ok) 12%, transparent);
}
#qc-api-home .qh-code-path { flex: 1; min-width: 0; font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--qh-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#qc-api-home .qh-code-block { padding: 8px 18px 14px; }
#qc-api-home .qh-code-block.is-res { border-top: 1px dashed var(--qh-border); background: color-mix(in oklab, var(--qh-soft) 55%, transparent); padding-top: 12px; }
#qc-api-home .qh-code-cap { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--qh-muted); margin-bottom: 6px; }
#qc-api-home .qh-pre {
  margin: 0; overflow-x: auto; font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, "Microsoft YaHei", monospace;
  color: var(--qh-fg); tab-size: 2; white-space: pre;
}
#qc-api-home .qh-code-req { display: block; min-height: 13.6em; }
#qc-api-home .qh-code-res { display: block; min-height: 8.5em; }
#qc-api-home .qh-tk-k { color: #7c3aed; }
#qc-api-home .qh-tk-s { color: #0f766e; }
#qc-api-home .qh-tk-n { color: #c2410c; }
#qc-api-home .qh-tk-v { color: #2563eb; font-weight: 600; }
#qc-api-home .qh-tk-cmd { color: #be185d; }
#qc-api-home .qh-tk-c { color: var(--qh-muted); font-style: italic; }
#qc-api-home .qh-code-note {
  padding: 10px 18px; border-top: 1px solid var(--qh-border); font-size: 12px; line-height: 1.6; color: var(--qh-muted);
}
#qc-api-home .qh-code-note[hidden] { display: none; }

/* —— 核心优势三栏 —— */
#qc-api-home .qh-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 64px; }
#qc-api-home .qh-feat {
  min-width: 0; padding: 22px 22px 20px; border: 1px solid var(--qh-border); border-radius: 14px; background: var(--qh-card);
  transition: border-color .15s;
}
#qc-api-home .qh-feat:hover { border-color: color-mix(in oklab, var(--qh-fg) 22%, var(--qh-border)); }
#qc-api-home .qh-feat-ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--qh-soft); color: var(--qh-fg);
}
#qc-api-home .qh-feat h3 { margin: 14px 0 0; font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; }
#qc-api-home .qh-feat p { margin: 8px 0 0; font-size: 13px; line-height: 1.7; color: var(--qh-muted); }
#qc-api-home .qh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
#qc-api-home .qh-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px;
  font: 500 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--qh-soft); color: var(--qh-fg);
}
#qc-api-home .qh-chip.is-ok .qh-ico { color: var(--qh-ok); }
#qc-api-home .qh-routes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
#qc-api-home .qh-routes li {
  display: grid; gap: 2px; min-width: 0; padding: 7px 10px; border-radius: 7px; background: var(--qh-soft); font-size: 12px; line-height: 1.45;
}
#qc-api-home .qh-route-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
#qc-api-home .qh-route-meta { color: var(--qh-muted); font-variant-numeric: tabular-nums; }
#qc-api-home .qh-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 500;
  color: var(--qh-fg); text-decoration: none; border-bottom: 1px solid var(--qh-border); padding-bottom: 2px;
}
#qc-api-home .qh-link:hover { border-color: var(--qh-fg); }

/* —— 响应式 —— */
@media (max-width: 1100px) {
  #qc-api-home .qh-hero { gap: 40px; }
}
@media (max-width: 960px) {
  #qc-api-home .qh-wrap { padding: 104px 20px 48px; }
  #qc-api-home .qh-hero { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  #qc-api-home .qh-feats { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
}
@media (max-width: 520px) {
  #qc-api-home .qh-wrap { padding: 92px 16px 40px; }
  #qc-api-home .qh-title { font-size: 30px; }
  #qc-api-home .qh-sub { font-size: 14px; }
  #qc-api-home .qh-actions { gap: 8px; }
  #qc-api-home .qh-btn { flex: 1 1 auto; justify-content: center; }
  #qc-api-home .qh-btn.is-primary { flex-basis: 100%; }
  #qc-api-home .qh-base { max-width: none; }
  #qc-api-home .qh-stats { gap: 20px; }
  #qc-api-home .qh-code-head { padding-right: 10px; }
  #qc-api-home .qh-tab { padding: 0 10px; }
  #qc-api-home .qh-code-status { display: none; }
  #qc-api-home .qh-pre { font-size: 12px; }
  #qc-api-home .qh-code-bar, #qc-api-home .qh-code-block, #qc-api-home .qh-code-note { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #qc-api-home * { transition: none !important; }
}
