/* 学生端顶部账户操作区 */
.top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid #edf0f6;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    z-index: 99;
    backdrop-filter: blur(12px);
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.top-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.top-action:hover {
    transform: translateY(-1px);
}

.top-action--gift {
    background: #f4f1ff;
    color: var(--primary);
    border-color: rgba(108, 92, 231, .18);
}

.top-action--gift:hover {
    background: #ece7ff;
    box-shadow: 0 8px 18px rgba(108, 92, 231, .14);
}

.top-action--balance {
    background: #fff;
    color: #333847;
    border-color: #e6e8f0;
    font-weight: 800;
}

.top-action--recharge {
    background: #fff;
    color: var(--primary);
    border-color: rgba(108, 92, 231, .38);
}

.top-action--recharge:hover {
    background: #f8f6ff;
    box-shadow: 0 8px 18px rgba(108, 92, 231, .12);
}

.top-action--login {
    min-width: 86px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(108, 92, 231, .24);
}

.top-action--login:hover {
    background: #5b4bd5;
}

.top-bar__user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e6e8f0;
    transition: box-shadow .16s ease, transform .16s ease;
}

.top-bar__user:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(25, 34, 68, .08);
}

.top-bar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.top-bar__nickname {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: #333847;
}

@media (max-width: 1023px) {
    .top-bar {
        left: 0;
        padding: 0 16px 0 60px;
    }
}

@media (max-width: 767px) {
    .top-bar {
        left: 0;
        justify-content: flex-end;
        height: 56px;
        padding: 0 14px 0 72px;
        overflow: hidden;
    }

    .top-actions {
        gap: 8px;
        width: 100%;
    }

    .top-action {
        min-height: 34px;
        padding: 0 12px;
        font-size: 13px;
    }

    .top-action--gift {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .top-action--gift i,
    .top-action--recharge,
    .top-action--balance {
        display: none !important;
    }

    .top-action--login {
        min-width: 64px;
        padding: 0 16px;
    }

    .top-bar__user {
        flex: 0 0 auto;
        min-height: 38px;
        width: 38px;
        padding: 3px;
        border: 0;
        background: transparent;
    }

    .top-bar__avatar {
        width: 36px;
        height: 36px;
    }

    .top-bar__nickname {
        display: none;
    }
}
