/* 全站顶栏 · token 与 list-common.css / listening-home.css 同源 */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 20px;
    background: #FFF9F1;
    border-bottom: 1px solid #F3E3C8;
    transition: box-shadow .2s ease;
}

.topbar-scrolled {
    box-shadow: 0 1px 8px rgba(61, 52, 40, .06);
}

/* ---------- logo ---------- */

.topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3D3428;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}

.topbar-logo:hover,
.topbar-logo:focus {
    color: #3D3428;
    text-decoration: none;
}

.topbar-logo-icon,
.topbar-logo-short {
    display: none;
}

/* ---------- 面包屑 ---------- */

.topbar-crumbs ol {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.topbar-crumbs li {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.topbar-crumbs li + li::before {
    content: '›';
    margin: 0 8px;
    color: #A79375;
}

.topbar-crumbs a {
    color: #7A6A52;
    text-decoration: none;
}

.topbar-crumbs a:hover {
    color: #3D3428;
    text-decoration: underline;
}

.topbar-crumb-parent span,
.topbar-crumb-mid span {
    color: #7A6A52;
}

.topbar-crumb-current span {
    color: #3D3428;
}

.topbar-logo:focus-visible,
.topbar-crumbs a:focus-visible {
    outline: 3px solid #4A7CF0;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- 用户区推到最右 ---------- */

#user-info {
    margin-left: auto;
}

/* ---------- 响应式 ---------- */

@media (max-width: 991px) {
    .topbar-logo-full {
        display: none;
    }

    .topbar-logo-short {
        display: inline;
    }
}

@media (max-width: 767px) {
    .topbar {
        height: 48px;
        padding: 0 12px;
        gap: 12px;
    }

    .topbar-logo-short {
        display: none;
    }

    .topbar-logo-icon {
        display: inline-block;
    }

    /* 中间级全部隐藏，只留「‹ 上一级」+ 当前项。
       必须写成两级类名：特异性 0,2,0 才压得过 .topbar-crumbs li 的 display:flex（0,1,1），
       媒体查询本身不提升特异性。 */
    .topbar-crumbs .topbar-crumb-mid {
        display: none;
    }

    /* 特异性 0,2,1 压过上面的 li + li::before（0,1,2），把分隔符换成返回箭头 */
    .topbar-crumbs .topbar-crumb-parent::before {
        content: '‹';
        margin: 0 4px 0 0;
        color: #A79375;
    }
}
