/* =====================================================================
   方方软件 · 产品页统一顶栏（AI 赋码平台 / AI 审计智能体 共用）
   只做三件事：加一条 52px 固定顶栏、把页面往下让 52px、给出板块切换
   ===================================================================== */

body.ffbar-on { padding-top: 52px !important; }

.ffbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 2147483000;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px 0 16px;
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(11, 26, 47, .09);
    box-shadow: 0 10px 24px -24px rgba(11, 26, 47, .7);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1;
    color: #22364f;
    box-sizing: border-box;
}

.ffbar * { box-sizing: border-box; }

.ffbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    color: #0b1a2f;
    text-decoration: none;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: .01em;
}
.ffbar-brand svg { width: 24px; height: 24px; display: block; flex: none; }
.ffbar-brand:hover { color: #1f5eff; }

.ffbar-sep {
    width: 1px;
    height: 18px;
    background: rgba(11, 26, 47, .12);
    flex: none;
}

.ffbar-menu { display: flex; align-items: center; gap: 2px; min-width: 0; }

.ffbar-menu a {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 13px;
    border-radius: 8px;
    color: #5c7593;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background .16s, color .16s;
}
.ffbar-menu a:hover { background: rgba(31, 94, 255, .07); color: #0b1a2f; }
.ffbar-menu a.on {
    background: rgba(31, 94, 255, .1);
    color: #1447cc;
    font-weight: 650;
}

.ffbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

.ffbar-wx {
    font-size: 12.5px;
    color: #5c7593;
    white-space: nowrap;
}
.ffbar-wx b { color: #22364f; font-weight: 600; }

.ffbar-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(11, 26, 47, .12);
    background: #fff;
    color: #22364f;
    text-decoration: none;
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    transition: .16s;
}
.ffbar-back:hover { border-color: #bcd3ef; color: #1f5eff; }

/* ---------- 把两个产品的既有布局往下让开 ---------- */
/* AI 赋码平台：左栏 fixed，顶栏 sticky */
body.ffq .sidebar { top: 52px; }
body.ffq .topbar { top: 52px; }
body.ffq .app { min-height: calc(100vh - 52px); }

/* AI 审计智能体：整屏 100dvh 的弹性布局 */
body.ffa .app { height: calc(100dvh - 52px); }

/* ---------- 深色主题（两个产品都有 data-theme="dark"） ---------- */
html[data-theme="dark"] .ffbar {
    background: rgba(20, 27, 40, .88);
    border-bottom-color: rgba(255, 255, 255, .08);
    color: #d7e3f2;
    box-shadow: 0 12px 26px -24px #000;
}
html[data-theme="dark"] .ffbar-brand { color: #eaf2fb; }
html[data-theme="dark"] .ffbar-brand:hover { color: #7aa6ff; }
html[data-theme="dark"] .ffbar-sep { background: rgba(255, 255, 255, .14); }
html[data-theme="dark"] .ffbar-menu a { color: #93a9c4; }
html[data-theme="dark"] .ffbar-menu a:hover { background: rgba(120, 160, 255, .12); color: #eaf2fb; }
html[data-theme="dark"] .ffbar-menu a.on { background: rgba(120, 160, 255, .18); color: #a8c6ff; }
html[data-theme="dark"] .ffbar-wx { color: #93a9c4; }
html[data-theme="dark"] .ffbar-wx b { color: #dbe6f5; }
html[data-theme="dark"] .ffbar-back {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .12);
    color: #dbe6f5;
}
html[data-theme="dark"] .ffbar-back:hover { color: #fff; border-color: rgba(255, 255, 255, .24); }

@media (max-width: 1240px) {
    .ffbar-wx { display: none; }
}

@media (max-width: 980px) {
    .ffbar-menu a { padding: 0 9px; font-size: 12.8px; }
}

@media (max-width: 720px) {
    .ffbar { gap: 8px; padding: 0 10px; }
    .ffbar-brand span.tt { display: none; }
    .ffbar-menu a { padding: 0 8px; font-size: 12.5px; }
    .ffbar-wx { display: none; }
    .ffbar-back { padding: 0 9px; }
}
