/* ============================================================
 * BTMP 全站统一顶栏样式（浅色版，保证全站颜色一致）
 * 命名空间: .btmp-topbar-*  避免与各页冲突
 * ============================================================ */

.btmp-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    background: #ffffffee;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #e8e8ed;
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 0.92rem;
    color: #1d1d1f;
}

.btmp-topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1d1d1f;
    text-decoration: none;
    margin-right: 28px;
}

.btmp-topbar-logo:hover {
    color: #0071e3;
}

.btmp-topbar-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btmp-topbar-nav-item {
    position: relative;
    padding: 6px 12px;
    color: #424245;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.btmp-topbar-nav-item:hover {
    background: #f0f0f5;
    color: #1d1d1f;
}

.btmp-topbar-nav-item.active {
    color: #0071e3;
    background: #e8f0fe;
}

/* 复盘 ▾ 下拉 */
.btmp-topbar-dropdown {
    position: relative;
    display: inline-block;
}

.btmp-topbar-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 200px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 1px solid #e8e8ed;
    padding: 6px;
    z-index: 1100;
}

.btmp-topbar-dropdown:hover .btmp-topbar-dropdown-menu,
.btmp-topbar-dropdown.open .btmp-topbar-dropdown-menu {
    display: block;
}

.btmp-topbar-dropdown-item {
    display: block;
    padding: 8px 12px;
    color: #1d1d1f;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
}

.btmp-topbar-dropdown-item:hover {
    background: #f0f0f5;
}

.btmp-topbar-dropdown-divider {
    height: 1px;
    background: #e8e8ed;
    margin: 6px 4px;
}

/* 搜索框 */
.btmp-topbar-search {
    margin-left: 18px;
    flex: 0 0 auto;
    width: 220px;
    height: 34px;
    padding: 0 10px 0 32px;
    border: 1px solid #e8e8ed;
    border-radius: 10px;
    background: #f5f5f7 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2'><circle cx='11' cy='11' r='7'/><line x1='16.5' y1='16.5' x2='21' y2='21'/></svg>") no-repeat 10px center;
    font-size: 0.85rem;
    color: #1d1d1f;
    outline: none;
    transition: all 0.15s;
}

.btmp-topbar-search::placeholder {
    color: #86868b;
    font-size: 0.82rem;
}

.btmp-topbar-search:focus {
    background-color: #fff;
    border-color: #0071e3;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.btmp-topbar-spacer { flex: 1; }

/* 模式标识 */
.btmp-topbar-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f0f0f5;
    color: #424245;
    font-size: 0.82rem;
    font-weight: 500;
    margin-right: 14px;
    user-select: none;
}

.btmp-topbar-mode.intraday {
    background: #fee2e2;
    color: #b91c1c;
}

.btmp-topbar-mode.intraday::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
    animation: btmp-pulse 1.6s ease-out infinite;
}

@keyframes btmp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* 头像区 */
.btmp-topbar-user {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 6px;
    border-radius: 20px;
    background: #f5f5f7;
    cursor: pointer;
    user-select: none;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 0.86rem;
}

.btmp-topbar-user:hover {
    background: #e8e8ed;
}

.btmp-topbar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071e3 0%, #4cb1ff 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btmp-topbar-user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 180px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border: 1px solid #e8e8ed;
    padding: 6px;
    z-index: 1100;
}

.btmp-topbar-user.open .btmp-topbar-user-menu {
    display: block;
}

.btmp-topbar-user-menu a {
    display: block;
    padding: 8px 12px;
    color: #1d1d1f;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
}

.btmp-topbar-user-menu a:hover {
    background: #f0f0f5;
}

.btmp-topbar-user-menu .divider {
    height: 1px;
    background: #e8e8ed;
    margin: 6px 4px;
}

/* 视角 Tab（calendar 页用） */
.btmp-view-tab {
    display: inline-flex;
    background: #f0f0f5;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.btmp-view-tab a {
    padding: 6px 18px;
    border-radius: 8px;
    color: #424245;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.btmp-view-tab a.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btmp-view-tab a:hover:not(.active) {
    color: #0071e3;
}

.btmp-view-tab-wrap {
    max-width: var(--btmp-shell-max, 1400px);
    margin: 14px auto 0;
    padding: 0 var(--btmp-shell-pad-x, 24px);
}

@media (max-width: 900px) {
    .btmp-topbar { padding: 0 12px; }
    .btmp-topbar-search { width: 140px; }
    .btmp-topbar-mode { display: none; }
}
