/* ============================================================
   八方云 · API 网关 —— 站点皮肤
   把 New API 的顶部导航与页脚对齐 bafang.tech 的视觉语言
   主色 #2563EB / 渐变 #3B82F6 → #1D4ED8 / 深底 #0A1122
   2026-11-12：logo / ico 换 VI 反色版（纯色 #0B5CFF 云形，透明底）
   ============================================================ */

/* ---------- 全站字体：与 bafang.tech 官网完全一致 ----------
   官网 body 字体栈（-apple-system → PingFang SC → 微软雅黑），并且 * 都开抗锯齿。
   New API 自带 "Public Sans"（只有拉丁字形，中文回落到另一套系统字体），
   和官网并排看字重/字面都不一样，这里整站接管。
   代码/密钥类保持等宽，否则 token 会串行。 */
html,body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif !important;
}
body *{
  font-family:inherit !important;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
code,pre,kbd,samp,textarea,
.font-mono,[class*="font-mono"],
code *,[class*="font-mono"] *{
  font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace !important;
}

/* ---------- 顶部导航栏 ---------- */
header:has(nav){
  background:rgba(255,255,255,.72) !important;
  -webkit-backdrop-filter:blur(18px) saturate(180%) !important;
  backdrop-filter:blur(18px) saturate(180%) !important;
  border-bottom:1px solid rgba(15,23,42,.06) !important;
  box-shadow:0 6px 24px -22px rgba(15,23,42,.45) !important;
}
html.dark header:has(nav){
  background:rgba(10,17,34,.78) !important;
  border-bottom-color:rgba(255,255,255,.08) !important;
  box-shadow:0 6px 24px -20px rgba(0,0,0,.8) !important;
}
/* 内层容器：去掉 New API 滚动时加的 pt-3，让导航恒为通栏单层 */
header:has(nav) > div{max-width:1152px !important;padding:0 !important}

/* 导航条：New API 滚动后会把 nav 变成「悬浮胶囊」（rounded + 半透明白 + ring + blur），
   与上面的通栏底色叠在一起就成了两层。这里全部压平成通栏。 */
header:has(nav) nav{
  height:66px !important;gap:30px !important;
  padding-left:0 !important;padding-right:0 !important;
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  --tw-ring-shadow:0 0 #0000 !important;
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
}

/* ---------- 导航 logo：逐像素照搬官网 lockup ----------
   官网原始：.logo{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:800;letter-spacing:-.3px}
            .logo .lg{width:35px;height:24px}   .logo i{9.5px/800 + brand-50 胶囊}
   New API 把 logo 容器定成正方形 size-7(28×28)，云标 1.45:1 放进去会被压成 28×19，
   而且 img 撑到 44×30 会从容器里向左溢出去 12px（和版心对不齐），所以容器和图片都改成 35×24。 */
header:has(nav) a[href="/"]:has(img){gap:9px !important}
header:has(nav) a[href="/"]:has(img) > div:first-child{
  width:35px !important;height:24px !important;
  flex:0 0 24px !important;border-radius:0 !important;
}
header:has(nav) img[src^="data:image/svg+xml"]{
  width:35px !important;height:24px !important;max-width:none !important;
  border-radius:0 !important;object-fit:contain !important;margin:0 !important;
}
html.dark header:has(nav) img[src^="data:image/svg+xml"]{filter:brightness(1.2) saturate(1.05)}

/* 品牌名：官网 .logo b —— 17px / 800 / -0.3px */
header nav a[href="/"]:has(img) span{
  font-size:17px !important;font-weight:800 !important;
  letter-spacing:-.3px !important;color:#0B1220 !important;
}
html.dark header nav a[href="/"]:has(img) span{color:#fff !important}

/* AI+ 徽章：官网 .logo i —— 9.5px/800、brand 字 + brand-50 底 + brand-100 描边 */
header nav a[href="/"]:has(img)::after{
  content:"AI+" !important;
  font-style:normal !important;
  font-size:9.5px !important;font-weight:800 !important;
  letter-spacing:.4px !important;line-height:1.35 !important;
  color:#0B5CFF !important;background:#EFF5FF !important;
  border:1px solid #DCE8FF !important;border-radius:5px !important;
  padding:1px 5px !important;margin-left:2px !important;flex:none !important;
}
html.dark header nav a[href="/"]:has(img)::after{
  color:#7CC0FF !important;background:rgba(94,168,255,.14) !important;
  border-color:rgba(94,168,255,.3) !important;
}

@media(max-width:520px){
  header:has(nav) a[href="/"]:has(img){gap:8px !important}
  header:has(nav) a[href="/"]:has(img) > div:first-child{
    width:28px !important;height:19px !important;flex:0 0 19px !important;
  }
  header:has(nav) img[src^="data:image/svg+xml"]{width:28px !important;height:19px !important}
  header nav a[href="/"]:has(img) span{font-size:15.5px !important}
}

/* 菜单项（New API 给每个导航项都带 title 属性） */
header nav a[title]{
  font-size:14px !important;font-weight:600 !important;
  padding:8px 13px !important;border-radius:9px !important;
  color:#475569 !important;
  transition:color .2s,background .2s !important;
}
header nav a[title]:hover{color:#2563EB !important;background:#EFF5FF !important}
header nav a[title][aria-current="page"]{color:#2563EB !important;font-weight:700 !important}
html.dark header nav a[title]{color:rgba(255,255,255,.7) !important}
html.dark header nav a[title]:hover{color:#fff !important;background:rgba(94,168,255,.14) !important}
html.dark header nav a[title][aria-current="page"]{color:#7CC0FF !important}

/* 登录按钮 → 官网胶囊渐变按钮 */
header nav a[href="/sign-in"]{
  height:38px !important;padding:0 20px !important;border-radius:999px !important;
  background:linear-gradient(135deg,#3B82F6,#1D4ED8) !important;
  color:#fff !important;font-size:13.5px !important;font-weight:700 !important;
  border:0 !important;
  box-shadow:0 12px 26px -14px rgba(37,99,235,.8) !important;
  transition:transform .22s cubic-bezier(.2,.8,.2,1),box-shadow .22s,filter .22s !important;
}
header nav a[href="/sign-in"]:hover{
  transform:translateY(-1.5px) !important;
  box-shadow:0 18px 32px -15px rgba(37,99,235,.9) !important;
  filter:brightness(1.05) !important;
}
header nav a[href="/sign-in"]:active{transform:scale(.975) !important}

/* 右侧图标按钮（语言 / 主题）保持克制 */
header nav button{color:#64748B !important}
header nav button:hover{color:#2563EB !important;background:#EFF5FF !important}
html.dark header nav button{color:rgba(255,255,255,.6) !important}
html.dark header nav button:hover{color:#fff !important;background:rgba(94,168,255,.14) !important}

/* ---------- 页脚外壳：改成通栏深底 ---------- */
footer:has(.bf-foot){
  background:#0A1122 !important;
  border-top:0 !important;
  margin-top:0 !important;
}
footer:has(.bf-foot) > div{
  max-width:1140px !important;
  padding:0 !important;
}
footer:has(.bf-foot) > div > div{
  display:block !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
  padding:0 !important;
}
footer:has(.bf-foot) .custom-footer{
  width:100% !important;
  max-width:none !important;
  text-align:left !important;
  color:rgba(255,255,255,.6) !important;
  font-size:13px !important;
  padding:56px 28px 0 !important;
}

/* 四列主体 */
.bf-fgrid{
  display:grid;grid-template-columns:1.6fr 1fr 1fr 1.1fr;gap:36px;
  padding-bottom:40px;border-bottom:1px solid rgba(255,255,255,.09);
}
.bf-flogo{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:800;
  color:#fff;letter-spacing:-.3px}
.bf-flogo svg{width:35px;height:24px;flex:none;display:block}
.bf-flogo i{font-style:normal;font-size:9.5px;font-weight:800;color:#7CC0FF;
  background:rgba(94,168,255,.14);border:1px solid rgba(94,168,255,.3);
  padding:1px 5px;border-radius:5px;letter-spacing:.4px;margin-left:2px}
.bf-fbrand p{font-size:12.5px;line-height:1.85;margin-top:16px;max-width:260px;
  color:rgba(255,255,255,.5)}
.bf-fc{margin-top:18px;display:flex;flex-direction:column;gap:9px}
.bf-fc div{display:flex;align-items:flex-start;gap:8px;font-size:12.5px;
  color:rgba(255,255,255,.55);line-height:1.5}
.bf-fc svg{width:13px;height:13px;stroke:rgba(255,255,255,.42);fill:none;
  stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none;margin-top:2px}
.bf-fc a{color:rgba(255,255,255,.55);transition:color .2s}
.bf-fc a:hover{color:#fff}
.bf-fcol h5{font-size:12px;font-weight:800;color:#fff;letter-spacing:.6px;margin-bottom:14px}
.bf-fcol a{display:block;font-size:12.5px;color:rgba(255,255,255,.55);padding:5px 0;
  transition:color .2s,transform .2s}
.bf-fcol a:hover{color:#fff;transform:translateX(2px)}

/* 八方云版权行 */
.bf-legal{display:flex;align-items:center;justify-content:space-between;gap:20px;
  flex-wrap:wrap;padding:22px 0 12px;font-size:11.5px;color:rgba(255,255,255,.4)}
.bf-lk{display:flex;gap:18px;flex-wrap:wrap}
.bf-lk a{color:rgba(255,255,255,.4);transition:color .2s}
.bf-lk a:hover{color:rgba(255,255,255,.8)}
/* 公司名可点（链回公司官网） */
.bf-foot a.cp-link{color:inherit;text-decoration:none;transition:color .2s}
.bf-foot a.cp-link:hover{color:#fff;text-decoration:underline;text-underline-offset:3px}

/* 原生 New API 版权区：保留内容，压到底部右侧做补充说明 */
footer:has(.bf-foot) .custom-footer ~ div{
  width:100% !important;
  border:0 !important;
  padding:0 28px 26px !important;
  justify-content:flex-end !important;
  background:transparent !important;
  gap:6px !important;
}
footer:has(.bf-foot) .custom-footer ~ div,
footer:has(.bf-foot) .custom-footer ~ div span,
footer:has(.bf-foot) .custom-footer ~ div a{
  font-size:11px !important;
  color:rgba(255,255,255,.42) !important;
  font-weight:400 !important;
}
footer:has(.bf-foot) .custom-footer ~ div a{color:rgba(255,255,255,.55) !important}
footer:has(.bf-foot) .custom-footer ~ div a:hover{color:rgba(255,255,255,.72) !important}

/* ---------- 小屏 ---------- */
@media (max-width:900px){
  header:has(nav) > div{max-width:100% !important}
  /* 小屏恢复左右内边距，否则 logo 会顶出屏幕被裁 */
  header:has(nav) nav{padding-left:24px !important;padding-right:16px !important;gap:12px !important}
  .bf-fgrid{grid-template-columns:1fr 1fr;gap:30px 24px}
  .bf-fbrand{grid-column:1 / -1}
}
@media (max-width:820px){
  .bf-fgrid{grid-template-columns:1fr 1fr;gap:28px 20px}
  .bf-fbrand{grid-column:1 / -1}
  footer:has(.bf-foot) .custom-footer{padding:40px 20px 0 !important}
  .bf-legal{flex-direction:column;align-items:flex-start;gap:10px;padding-top:18px}
  .bf-lk{gap:14px}
  footer:has(.bf-foot) .custom-footer ~ div{
    justify-content:flex-start !important;padding:0 20px 22px !important;
  }
}
@media (max-width:520px){
  .bf-fgrid{grid-template-columns:1fr;gap:26px}
  .bf-fbrand p{max-width:none}
}
