/* =========================================================
   api工厂官网设计系统 site.css
   所有类名使用 af- 前缀，可与旧版 Bootstrap 主题共存
   ========================================================= */
:root {
  --af-primary: #5b47ff;
  --af-primary-dark: #4535d9;
  --af-blue: #008aff;
  --af-grad: linear-gradient(135deg, #6c47ff 0%, #008aff 100%);
  --af-ink: #0f172a;
  --af-text: #334155;
  --af-muted: #64748b;
  --af-line: #e5e9f2;
  --af-bg: #ffffff;
  --af-bg-soft: #f6f8fc;
  --af-dark: #0b1020;
  --af-dark-2: #131a30;
  --af-green: #10b981;
  --af-orange: #f59e0b;
  --af-red: #ef4444;
  --af-radius: 14px;
  --af-radius-sm: 8px;
  --af-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --af-shadow-lg: 0 20px 50px rgba(30, 30, 80, .16);
  --af-header-h: 64px;
  --af-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body.af-body {
  margin: 0;
  background: var(--af-bg);
  color: var(--af-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.af-body *, .af-body *::before, .af-body *::after { box-sizing: border-box; }
:where(.af-body) a { color: var(--af-primary); text-decoration: none; }
:where(.af-body) a:hover { text-decoration: underline; }
:where(.af-body) img { max-width: 100%; }
:where(.af-body) h1, :where(.af-body) h2, :where(.af-body) h3, :where(.af-body) h4 { color: var(--af-ink); line-height: 1.25; margin: 0; font-weight: 700; }
:where(.af-body) p { margin: 0; }
:where(.af-body) ul { margin: 0; padding: 0; list-style: none; }
.af-skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 14px; z-index: 999; }
.af-skip:focus { left: 8px; top: 8px; }
.af-body :focus-visible { outline: 2px solid var(--af-blue); outline-offset: 2px; }

.af-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.af-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.af-ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.af-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 10px; font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; text-decoration: none !important; white-space: nowrap; font-family: inherit; line-height: 1; }
.af-btn:hover { transform: translateY(-1px); }
.af-btn--primary { background: var(--af-grad); color: #fff !important; box-shadow: 0 6px 18px rgba(91, 71, 255, .35); }
.af-btn--primary:hover { box-shadow: 0 10px 24px rgba(91, 71, 255, .45); }
.af-btn--ghost { background: #fff; color: var(--af-ink) !important; border-color: var(--af-line); }
.af-btn--ghost:hover { border-color: var(--af-primary); color: var(--af-primary) !important; }
.af-btn--dark { background: var(--af-ink); color: #fff !important; }
.af-btn--light { background: #fff; color: var(--af-primary) !important; }
.af-btn--outline-light { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .4); }
.af-btn--lg { height: 50px; padding: 0 28px; font-size: 16px; border-radius: 12px; }
.af-btn--sm { height: 34px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.af-btn--block { display: flex; width: 100%; }

/* ---------- Header ---------- */
.af-header { position: sticky; top: 0; z-index: 100; height: var(--af-header-h); background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.af-header.is-scrolled { border-color: var(--af-line); box-shadow: 0 4px 20px rgba(15, 23, 42, .05); }
.af-header .af-container { display: flex; align-items: center; height: 100%; gap: 28px; }
.af-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--af-ink) !important; text-decoration: none !important; letter-spacing: .5px; }
.af-brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--af-grad); color: #fff; display: grid; place-items: center; font-size: 17px; }
.af-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.af-nav-item { position: relative; }
.af-nav-link { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--af-text) !important; font-size: 15px; font-weight: 500; background: none; border: 0; cursor: pointer; font-family: inherit; text-decoration: none !important; }
.af-nav-link:hover, .af-nav-item.is-open > .af-nav-link, .af-nav-link[aria-current="page"] { background: var(--af-bg-soft); color: var(--af-primary) !important; }
.af-nav-link .af-ico { width: 14px; height: 14px; transition: transform .2s; }
.af-nav-item.is-open > .af-nav-link .af-ico { transform: rotate(180deg); }
.af-dd { position: absolute; top: calc(100% + 8px); left: 0; min-width: 320px; background: #fff; border: 1px solid var(--af-line); border-radius: 14px; box-shadow: var(--af-shadow-lg); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s; }
.af-nav-item.is-open > .af-dd { opacity: 1; visibility: visible; transform: none; }
.af-dd a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--af-ink) !important; text-decoration: none !important; align-items: flex-start; }
.af-dd a:hover { background: var(--af-bg-soft); }
.af-dd .af-dd-ico { width: 34px; height: 34px; border-radius: 9px; background: #eef0ff; color: var(--af-primary); display: grid; place-items: center; flex-shrink: 0; }
.af-dd b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.af-dd small { display: block; font-size: 12.5px; color: var(--af-muted); line-height: 1.4; }
.af-header-cta { display: flex; gap: 10px; align-items: center; }
.af-burger { display: none; width: 40px; height: 40px; border: 1px solid var(--af-line); border-radius: 10px; background: #fff; cursor: pointer; margin-left: auto; color: var(--af-ink); }
.af-new { background: var(--af-grad); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

@media (max-width: 991px) {
  .af-burger { display: grid; place-items: center; }
  .af-header .af-container { gap: 12px; }
  .af-nav, .af-header-cta { display: none; }
  .af-header.is-menu-open { height: auto; min-height: var(--af-header-h); position: fixed; left: 0; right: 0; bottom: 0; top: 0; overflow-y: auto; background: #fff; }
  .af-header.is-menu-open .af-container { flex-wrap: wrap; align-items: flex-start; height: auto; padding-top: 12px; padding-bottom: 24px; }
  .af-header.is-menu-open .af-brand, .af-header.is-menu-open .af-burger { height: 40px; }
  .af-header.is-menu-open .af-nav { display: flex; flex-direction: column; align-items: stretch; width: 100%; order: 3; gap: 0; margin-top: 8px; }
  .af-header.is-menu-open .af-header-cta { display: flex; width: 100%; order: 4; flex-direction: column; margin-top: 12px; }
  .af-header.is-menu-open .af-header-cta .af-btn { width: 100%; }
  .af-nav-link { width: 100%; justify-content: space-between; height: 48px; font-size: 16px; border-bottom: 1px solid var(--af-line); border-radius: 0; }
  .af-dd { position: static; min-width: 0; box-shadow: none; border: 0; padding: 0 0 8px 8px; display: none; opacity: 1; visibility: visible; transform: none; }
  .af-nav-item.is-open > .af-dd { display: block; }
}

/* ---------- Sections ---------- */
.af-section { padding: 88px 0; }
.af-section--soft { background: var(--af-bg-soft); }
.af-section--dark { background: var(--af-dark); color: #cbd5e1; }
.af-section--dark h2, .af-section--dark h3 { color: #fff; }
.af-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.af-eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; color: var(--af-primary); text-transform: uppercase; margin-bottom: 12px; }
.af-head h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 14px; }
.af-head p { font-size: 17px; color: var(--af-muted); }
.af-section--dark .af-head p { color: #94a3b8; }
.af-grid { display: grid; gap: 20px; }
.af-grid--2 { grid-template-columns: repeat(2, 1fr); }
.af-grid--3 { grid-template-columns: repeat(3, 1fr); }
.af-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 991px) { .af-grid--3, .af-grid--4 { grid-template-columns: repeat(2, 1fr); } .af-section { padding: 64px 0; } }
@media (max-width: 640px) { .af-grid--2, .af-grid--3, .af-grid--4 { grid-template-columns: 1fr; } .af-container { padding: 0 18px; } }

.af-card { background: #fff; border: 1px solid var(--af-line); border-radius: var(--af-radius); padding: 26px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.af-card:hover { box-shadow: var(--af-shadow); border-color: #d6dcf0; }
.af-card h3 { font-size: 18px; margin-bottom: 8px; }
.af-card p { font-size: 14.5px; color: var(--af-muted); }
a.af-card { display: block; color: inherit !important; text-decoration: none !important; }
a.af-card:hover { transform: translateY(-3px); }
.af-card-ico { width: 44px; height: 44px; border-radius: 12px; background: #eef0ff; color: var(--af-primary); display: grid; place-items: center; margin-bottom: 16px; font-size: 20px; }
.af-card-ico.is-green { background: #e6f9f1; color: var(--af-green); }
.af-card-ico.is-orange { background: #fff4e0; color: var(--af-orange); }
.af-card-ico.is-blue { background: #e5f3ff; color: var(--af-blue); }
.af-link { font-weight: 600; font-size: 14.5px; display: inline-flex; gap: 4px; align-items: center; margin-top: 12px; }
.af-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eef0ff; color: var(--af-primary); }
.af-tag--green { background: #e6f9f1; color: #059669; }
.af-tag--gray { background: #f1f5f9; color: var(--af-muted); }

/* ---------- Hero ---------- */
.af-hero { position: relative; overflow: hidden; padding: 64px 0 72px; background: radial-gradient(900px 420px at 85% -10%, rgba(108, 71, 255, .14), transparent 60%), radial-gradient(700px 400px at 0% 0%, rgba(0, 138, 255, .1), transparent 60%), #fff; }
.af-hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 991px) { .af-hero-grid { grid-template-columns: 1fr; } .af-hero { padding: 40px 0 56px; } }
.af-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--af-line); font-size: 13px; color: var(--af-muted); margin-bottom: 20px; }
.af-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--af-green); }
.af-hero h1 { font-size: clamp(32px, 4.6vw, 54px); letter-spacing: -.5px; }
.af-grad-text { background: var(--af-grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.af-hero-lead { font-size: 18px; color: var(--af-muted); margin: 18px 0 26px; max-width: 560px; }
.af-modes { display: grid; gap: 12px; margin-bottom: 26px; }
.af-mode { display: flex; gap: 14px; padding: 16px 18px; background: #fff; border: 1px solid var(--af-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.af-mode-num { width: 32px; height: 32px; border-radius: 50%; background: var(--af-grad); color: #fff; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; }
.af-mode h3 { font-size: 16px; margin-bottom: 2px; }
.af-mode p { font-size: 14px; color: var(--af-muted); line-height: 1.55; }
.af-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Code window ---------- */
.af-code { background: var(--af-dark); border-radius: 14px; overflow: hidden; border: 1px solid #1e2742; box-shadow: var(--af-shadow-lg); color: #d6deeb; text-align: left; }
.af-code-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #0f1630; border-bottom: 1px solid #1e2742; }
.af-code-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.af-code-bar i:nth-child(1) { background: #ff5f57; } .af-code-bar i:nth-child(2) { background: #febc2e; } .af-code-bar i:nth-child(3) { background: #28c840; }
.af-code-title { margin-left: 8px; font-size: 12.5px; color: #8b97b8; font-family: var(--af-mono); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-copy { background: rgba(255, 255, 255, .08); color: #cbd5e1; border: 0; border-radius: 6px; font-size: 12px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.af-copy:hover { background: rgba(255, 255, 255, .16); }
.af-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--af-mono); font-size: 13.5px; line-height: 1.75; color: #d6deeb; background: transparent; border: 0; }
.af-code pre code { font-family: inherit; background: none; color: inherit; padding: 0; }
.af-code mark { background: rgba(251, 146, 60, .25); color: #ffa657; padding: 0 3px; border-radius: 3px; }
.hljs-comment, .hljs-quote { color: #6b7ba3; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in { color: #c792ea; }
.hljs-string, .hljs-attribute, .hljs-value, .hljs-regexp { color: #a8e6a1; }
.hljs-number, .hljs-title, .hljs-name { color: #82aaff; }
.hljs-tag, .hljs-tag .hljs-title { color: #ff8b9b; }
.hljs-attr, .hljs-params, .hljs-symbol { color: #ffcb6b; }
.hljs-function .hljs-title, .hljs-class .hljs-title { color: #82aaff; }

/* ---------- Tabs ---------- */
.af-tabs-nav { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--af-bg-soft); border-radius: 12px; border: 1px solid var(--af-line); }
.af-tab { border: 0; background: none; padding: 7px 12px; font-size: 13.5px; font-weight: 600; color: var(--af-muted); border-radius: 8px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.af-tab:hover { color: var(--af-ink); }
.af-tab[aria-selected="true"] { background: #fff; color: var(--af-primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.af-panel[hidden] { display: none; }
.af-tabs-nav--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.af-tabs-nav--scroll::-webkit-scrollbar { display: none; }

/* ---------- SDK panel (hero) ---------- */
.af-sdk { background: #fff; border: 1px solid var(--af-line); border-radius: 18px; padding: 18px; box-shadow: var(--af-shadow-lg); min-width: 0; }
.af-sdk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.af-sdk-top b { font-size: 15px; color: var(--af-ink); }
.af-ver { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-family: var(--af-mono); padding: 3px 10px; border-radius: 999px; background: #e6f9f1; color: #059669; font-weight: 600; }
.af-sdk .af-tabs-nav { margin-bottom: 12px; }
.af-sdk .af-code { box-shadow: none; }
.af-sdk .af-code pre { min-height: 250px; font-size: 13px; }
.af-sdk-foot { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }

/* ---------- Steps ---------- */
.af-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
@media (max-width: 991px) { .af-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .af-steps { grid-template-columns: 1fr; } }
.af-step { position: relative; background: #fff; border: 1px solid var(--af-line); border-radius: var(--af-radius); padding: 24px; counter-increment: s; }
.af-step::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--af-grad); color: #fff; font-weight: 700; margin-bottom: 14px; }
.af-step h3 { font-size: 17px; margin-bottom: 6px; }
.af-step p { font-size: 14.5px; color: var(--af-muted); }
.af-step code { font-family: var(--af-mono); background: #f1f4fb; padding: 1px 6px; border-radius: 5px; font-size: 13px; color: var(--af-primary-dark); }

/* ---------- Compare ---------- */
.af-table-wrap { overflow-x: auto; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: #fff; }
.af-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 14.5px; }
.af-table th, .af-table td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--af-line); }
.af-table thead th { background: var(--af-bg-soft); color: var(--af-ink); font-size: 14px; }
.af-table tbody tr:last-child td { border-bottom: 0; }
.af-table td:first-child { font-weight: 600; color: var(--af-ink); width: 18%; white-space: nowrap; }
.af-table .is-us { background: #f6f4ff; color: var(--af-ink); }
.af-table thead th.is-us { background: #ece8ff; color: var(--af-primary-dark); }
.af-check { color: var(--af-green); font-weight: 700; }
.af-list { display: grid; gap: 12px; }
.af-list li { display: flex; gap: 10px; align-items: flex-start; }
.af-list li .af-ico { color: var(--af-green); margin-top: 5px; }
.af-list b { color: var(--af-ink); }

/* ---------- Page hero (inner) ---------- */
.af-page-hero { padding: 56px 0 44px; background: radial-gradient(800px 300px at 90% -20%, rgba(108, 71, 255, .13), transparent 60%), var(--af-bg-soft); border-bottom: 1px solid var(--af-line); }
.af-page-hero h1 { font-size: clamp(28px, 3.8vw, 42px); margin-bottom: 12px; }
.af-page-hero p { font-size: 17px; color: var(--af-muted); max-width: 720px; }
@media (max-width: 860px) { .af-page-hero .af-container[style*="grid-template-columns"] { display: block !important; } .af-page-hero .af-container[style*="grid-template-columns"] > div + div { margin-top: 20px; } }
.af-crumbs { font-size: 13.5px; color: var(--af-muted); margin-bottom: 14px; }
.af-crumbs a { color: var(--af-muted); }

/* ---------- Prose (legal) ---------- */
.af-prose { max-width: 820px; margin: 0 auto; padding: 48px 24px 80px; }
.af-prose h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 6px; }
.af-prose h3 { font-size: 17px; margin: 22px 0 8px; }
.af-prose p, .af-prose li { margin-bottom: 10px; color: var(--af-text); }
.af-prose ul { list-style: disc; padding-left: 22px; }
.af-prose ol { padding-left: 22px; }
.af-prose .af-meta { color: var(--af-muted); font-size: 14px; }
.af-notice { background: #fff8e8; border: 1px solid #fde3a7; color: #7a4b00; border-radius: 12px; padding: 14px 18px; font-size: 14.5px; }
.af-notice b { color: #5c3800; }
.af-notice--danger { background: #fff1f1; border-color: #fbc9c9; color: #7f1d1d; }
.af-notice--info { background: #eef6ff; border-color: #cfe4ff; color: #1e3a8a; }
.af-legal-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.af-legal-nav a { padding: 6px 14px; border: 1px solid var(--af-line); border-radius: 999px; font-size: 14px; color: var(--af-text); }
.af-legal-nav a[aria-current="page"] { background: var(--af-primary); border-color: var(--af-primary); color: #fff; }

/* ---------- CTA ---------- */
.af-cta { background: var(--af-grad); border-radius: 24px; padding: 56px 32px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.af-cta h2 { color: #fff; font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.af-cta p { color: rgba(255, 255, 255, .85); margin-bottom: 26px; font-size: 17px; }
.af-cta-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.af-footer { background: var(--af-dark); color: #94a3b8; padding: 64px 0 28px; font-size: 14.5px; }
.af-footer a { color: #b6c0d6 !important; text-decoration: none !important; }
.af-footer a:hover { color: #fff !important; }
.af-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
@media (max-width: 991px) { .af-footer-grid { grid-template-columns: 1fr 1fr; } .af-footer-grid > :first-child { grid-column: 1 / -1; } }
.af-footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; letter-spacing: .5px; }
.af-footer li { margin-bottom: 9px; }
.af-footer .af-brand { color: #fff !important; margin-bottom: 14px; }
.af-footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid #1e2742; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: 13.5px; }
.af-footer-bottom nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Misc ---------- */
.af-logos { display: flex; flex-wrap: wrap; gap: 10px 12px; justify-content: center; }
.af-logos span { padding: 7px 16px; border: 1px solid var(--af-line); border-radius: 999px; background: #fff; font-size: 14px; color: var(--af-text); font-weight: 500; }
.af-case { display: block; color: inherit !important; text-decoration: none !important; }
.af-case-img { aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--af-bg-soft); border: 1px solid var(--af-line); }
.af-case-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.af-case:hover .af-case-img img { transform: scale(1.04); }
.af-case h3 { font-size: 16px; margin: 12px 0 2px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.af-case p { font-size: 13.5px; color: var(--af-muted); }
.af-form label { display: block; font-size: 14px; font-weight: 600; color: var(--af-ink); margin-bottom: 6px; }
.af-form input, .af-form textarea, .af-input { width: 100%; padding: 11px 14px; border: 1px solid var(--af-line); border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff; color: var(--af-ink); }
.af-form input:focus, .af-form textarea:focus, .af-input:focus { outline: 0; border-color: var(--af-primary); box-shadow: 0 0 0 3px rgba(91, 71, 255, .15); }
.af-form .af-field { margin-bottom: 16px; }
.af-check-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--af-muted); }
.af-check-row input { width: auto; margin-top: 5px; }
.af-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.af-chip { padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--af-line); font-size: 13px; color: var(--af-text); }
.af-section--dark .af-chip { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #cbd5e1; }
.af-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 991px) { .af-two { grid-template-columns: 1fr; gap: 28px; } }
.af-tool { text-align: center; padding: 20px 10px; }
.af-tool b { display: block; color: var(--af-ink); margin-top: 6px; font-size: 14.5px; }
.af-section--dark .af-card { background: var(--af-dark-2); border-color: #222b4a; }
.af-section--dark .af-card p { color: #94a3b8; }
.af-section--dark .af-card h3 { color: #fff; }
.af-section--dark .af-tool b { color: #e2e8f0; }
.af-section--dark .af-card-ico { background: rgba(108, 71, 255, .18); color: #a99bff; }
.af-chat { display: grid; gap: 10px; }
.af-msg { padding: 10px 14px; border-radius: 12px; font-size: 14px; max-width: 92%; line-height: 1.6; }
.af-msg--u { background: #eef0ff; color: var(--af-ink); justify-self: start; border-bottom-left-radius: 3px; }
.af-msg--a { background: #e6f9f1; color: #065f46; justify-self: end; border-bottom-right-radius: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Legacy bridge: 旧 Bootstrap 页面主体与新风格对齐 ---------- */
.af-legacy { font-family: inherit; }
.af-legacy .card { border-radius: 14px; border: 1px solid var(--af-line); box-shadow: none; }
.af-legacy .btn { border-radius: 10px; font-weight: 600; }
.af-legacy .btn-primary { background: var(--af-grad); border: 0; }
.af-legacy .bg-section-secondary { background: var(--af-bg-soft) !important; }
.af-legacy .bg-gradient-primary { background: var(--af-grad) !important; }
.af-legacy h1, .af-legacy h2, .af-legacy h3, .af-legacy h4, .af-legacy h5 { color: var(--af-ink); }
.af-legacy .text-white, .af-legacy .bg-gradient-primary h1, .af-legacy .bg-gradient-primary h2, .af-legacy .bg-gradient-primary h3 { color: #fff !important; }
.af-legacy a { text-decoration: none; }

/* 防止 grid 子项被 pre / 长代码撑破（移动端、平板适配） */
.af-two > *, .af-grid > *, .af-hero-grid > *, .af-steps > *, .af-footer-grid > * { min-width: 0; }
.af-code { max-width: 100%; }
.af-code pre { max-width: 100%; }
.af-code-title { min-width: 0; }
