/* ===========================================================
 * 全局 Header 组件样式（汉堡按钮 + 校区下拉菜单）
 * 依赖：public/js/header.js
 * 仅在主页 index.html 显示：作为内联元素注入到 #userBar .user-info
 * 与"用户名 / 审核 / 消息 / 退出"同一排，最左对齐
 * =========================================================== */

.bbq-header-inline {
    display: inline-block;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
}

/* ----- 汉堡按钮（三横杠），与 user-bar 其他按钮同高 ----- */
.bbq-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 0;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    vertical-align: middle;
}

.bbq-burger:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: #3b82f6;
}

.bbq-burger:active {
    transform: scale(0.94);
}

.bbq-burger[aria-expanded="true"] {
    background: #3b82f6;
    border-color: #3b82f6;
}

.bbq-burger-line {
    display: block;
    width: 16px;
    height: 2px;
    background: #3b82f6;
    border-radius: 2px;
    transition: background 0.15s;
}

.bbq-burger[aria-expanded="true"] .bbq-burger-line {
    background: #ffffff;
}

/* ----- 下拉菜单（向下展开，从汉堡按钮正下方垂下）----- */
.bbq-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: calc(100vw - 20px);
    background: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    font-size: 14px;
    color: #334155;
    animation: bbq-menu-fade 0.15s ease-out;
    z-index: 1000;
    text-align: left;
    /* 防止菜单被父级 sticky 元素的 transform/overflow 裁剪 */
    transform: translateZ(0);
}

@keyframes bbq-menu-fade {
    from { opacity: 0; transform: translateY(-4px) translateZ(0); }
    to   { opacity: 1; transform: translateY(0) translateZ(0); }
}

.bbq-menu[hidden] {
    display: none;
}

.bbq-menu-section {
    padding: 6px 14px;
}

.bbq-menu-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.bbq-menu-current {
    font-size: 15px;
    font-weight: 600;
    color: #3b82f6;
    padding: 2px 0;
}

.bbq-menu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

.bbq-menu-list {
    max-height: 240px;
    overflow-y: auto;
}

.bbq-campus-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #334155;
    font-size: 14px;
    transition: background 0.1s;
    border-radius: 0;
}

.bbq-campus-item:not(:disabled):hover {
    background: rgba(59, 130, 246, 0.1);
}

.bbq-campus-item:disabled {
    cursor: default;
    color: #3b82f6;
}

.bbq-campus-current {
    background: rgba(59, 130, 246, 0.06);
}

.bbq-campus-name {
    flex: 1;
}

.bbq-campus-tick {
    color: #3b82f6;
    font-weight: 700;
}

.bbq-menu-empty {
    padding: 6px 14px;
    color: #94a3b8;
    font-style: italic;
    font-size: 13px;
}

.bbq-menu-link {
    display: block;
    padding: 8px 14px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s;
}

.bbq-menu-link:hover {
    background: rgba(59, 130, 246, 0.1);
}

.bbq-menu-action {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.06);
    color: #1e40af;
    border: none;
    border-top: 1px solid rgba(59, 130, 246, 0.18);
    border-bottom: 1px solid rgba(59, 130, 246, 0.18);
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s;
}

.bbq-menu-action:hover {
    background: rgba(59, 130, 246, 0.14);
}

/* ----- 切换校区独立卡片（弹层） ----- */
.bbq-switcher {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: bbq-switcher-fade 0.15s ease-out;
}

.bbq-switcher[hidden] {
    display: none;
}

@keyframes bbq-switcher-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bbq-switcher-card {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: bbq-switcher-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bbq-switcher-pop {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.bbq-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.bbq-switcher-header h3 {
    margin: 0;
    font-size: 17px;
    color: #1e293b;
}

.bbq-switcher-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}

.bbq-switcher-close:hover {
    background: #f1f5f9;
    color: #334155;
}

.bbq-switcher-search {
    position: relative;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.bbq-switcher-search-icon {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.bbq-switcher-search input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.bbq-switcher-search input:focus {
    border-color: #3b82f6;
    background: #ffffff;
}

.bbq-switcher-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 100px;
    max-height: 50vh;
}

.bbq-switcher-item {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #1e293b;
    transition: background 0.1s;
}

.bbq-switcher-item:not(:disabled):hover {
    background: rgba(59, 130, 246, 0.08);
}

.bbq-switcher-item:disabled {
    cursor: default;
    background: rgba(59, 130, 246, 0.06);
    color: #3b82f6;
}

.bbq-switcher-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bbq-switcher-item-name {
    font-size: 15px;
    font-weight: 500;
}

.bbq-switcher-item-slug {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: ui-monospace, "SF Mono", monospace;
}

.bbq-switcher-item-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    font-style: italic;
}

.bbq-switcher-item-tick {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #3b82f6;
    font-weight: 600;
}

.bbq-switcher-empty {
    padding: 30px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
}

.bbq-switcher-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.bbq-menu-logout {
    display: block;
    width: calc(100% - 24px);
    margin: 4px 12px;
    padding: 10px 14px;
    background: #fff;
    color: #e74c3c;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.1s;
}

.bbq-menu-logout:hover {
    background: #fef2f2;
}

/* ----- 跨校区提示（letter-display 页面使用） ----- */
.cross-campus-notice {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0 0 14px 0;
    border-left: 3px solid #3b82f6;
}

.letter-campus-bar {
    background: #f8fafc;
    padding: 8px 24px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.letter-meta-campus {
    display: inline-block;
    font-size: 12px;
    color: #3b82f6;
    background: #eff6ff;
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 500;
}

/* ----- 移动端尺寸调整 ----- */
@media (max-width: 768px) {
    .bbq-burger {
        width: 32px;
        height: 32px;
    }
    .bbq-burger-line {
        width: 14px;
    }
    .bbq-menu {
        min-width: 180px;
        max-width: calc(100vw - 16px);
    }
}

@media (max-width: 480px) {
    .bbq-menu {
        min-width: 160px;
        font-size: 13px;
    }
    .bbq-menu-link,
    .bbq-campus-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

