/* ============================================================
   统一顶栏 / 导航样式 —— 唯一实现（2026-10-15）
   结构见 templates/_topbar.html；6 个页面共用（首页/模拟交易/资金流向/
   产业链拆解/轮动池/交易策略）。
   ⚠️ 不要在页面 <style> 里重复定义 .top-bar / .brand* / .nav-links /
      .nav-link 的顶栏样式，否则又会分叉。
   ============================================================ */

.top-bar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    height: 48px; padding: 0 20px;
    /* 用绝对色值 + 显式字体栈，保证 style.css / style_v2.css / 首页 三套主题下完全一致 */
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
}
/* 左侧：品牌 + 页内工具；flex:1 把其余元素推到右侧 */
.top-bar .top-left {
    display: flex; align-items: center; gap: 10px;
    flex: 1 1 auto; min-width: 0;
}
.top-bar .top-center {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: #8b949e;
    white-space: nowrap; flex: 0 0 auto;
}
/* 中间元素在标题栏里水平居中（导航按钮位置不变）：绝对居中，
   不受左右两侧宽度影响。用于 模拟交易 / 资金流向 两页。
   窄屏（≤1500px）会自动退回普通流式排布，避免与品牌/导航重叠。 */
.top-bar .top-center.is-centered {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
    max-width: calc(100% - 24px);
}
@media (max-width: 1500px) {
    .top-bar .top-center.is-centered {
        position: static; left: auto; top: auto; transform: none;
    }
}
.top-bar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-bar .brand-emoji { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.top-bar .brand-title {
    font-size: 15px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 右侧：导航按钮（统一样式 + 当前页高亮 .active） */
.top-bar .nav-links {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto; flex: 0 0 auto;
}
.top-bar .nav-link {
    display: inline-flex; align-items: center;
    white-space: nowrap; flex: 0 0 auto;
    color: #8b949e;
    text-decoration: none; font-size: 13px; font-weight: 600; line-height: 1;
    padding: 7px 12px;
    border: 1px solid transparent; border-radius: 8px;
    transition: color .15s, background .15s, border-color .15s;
}
.top-bar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.top-bar .nav-link.active {
    color: #fff;
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.32);
}
.top-bar .nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.top-bar .meta-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: #6e7681; flex: 0 0 auto;
}
/* 首页右侧「登录 / 用户头像」：高度收敛，避免把顶栏撑高 */
.top-bar .nav-login-btn { padding: 6px 14px; line-height: 1; }
.top-bar .nav-avatar { width: 30px; height: 30px; font-size: 14px; }
.top-bar .nav-user-area { align-items: center; }
/* 隐私模式按钮：紧贴品牌标题，且不得撞高顶栏（模拟盘页） */
.top-bar .privacy-btn {
    margin-left: -6px; flex: 0 0 auto; align-self: center;
    height: 22px; padding: 0 6px; font-size: 13px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}

@media (max-width: 960px) {
    .top-bar { padding: 0 12px; gap: 8px; }
    .top-bar .nav-link { padding: 6px 9px; font-size: 12px; }
    .top-bar .brand-title { font-size: 14px; }
}
